RPi Pico B.Tech/Diploma Beginner

Controlling RGB LED using Raspberry Pi Pico

Controlling RGB LED using Raspberry Pi Pico Board with MicroPython Code for primary colors of RGB to display different brightness & effects

  • Suitable forB.Tech/Diploma RPi Pico students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview
In this guide, we will learn the Controlling of RGB LED using Raspberry Pi Pico Board with MicroPython Code. We will control the three primary colors of the RGB LED to display different brightness randomly, so as to realize the colorful light effect.
Components Required
In this guide, I used
Elecrow Raspberry Pi Pico Starter Kit
to test different Modules. You can buy the kit and perform some other operations as well. From this kit, you can use the following components.
1. Raspberry Pi Pico Board -1
2. RGB LED Module – 1
3. Breadboard -1
4. Jumper Wires – 4
RGB LED
The R, G, and B in RGB LED stand for red, green, and blue respectively. In theory, you can use some combination of these three colors to create any color; Through PWM voltage input can adjust the intensity of the three primary colors (red/green/blue), so as to achieve the full-color mixing effect.
Circuit Diagram & Hardware Setup
We are using RGB LED Module here for interfacing with Raspberry Pi Pico. In case you want to use an RGB LED only, then use a 220-ohm resistor with each, R, G & B Pin.
Connect the R, G & B Pin of the RGB LED to Raspberry Pi Pico GP2, GP3 & GP4 Pin respectively. Connect the GND Pin of RGB LED to Pico GND Pin.
MicroPython Code/Program
The following code will simulate the each LED and using the PWM function, the brightness of each LED is randomly generated.

from
machine
import
Pin
PWM
import
utime
import
random
Led_R
=
PWM
(
Pin
(

)
)
Led_G
=
PWM
(
Pin
(

)
)
Led_B
=
PWM
(
Pin
(

)
)
# Define the frequency
Led_R
freq
(
2000
)
Led_G
freq
(
2000
)
Led_B
freq
(
2000
)
if
__name__
==
"__main__"
:
while
True
:
# range of random numbers
R
=
random
randint
(

65535
)
G
=
random
randint
(

65535
)
B
=
random
randint
(

65535
)
(
R
G
B
)
Led_R
duty_u16
(
R
)
Led_G
duty_u16
(
G
)
Led_B
duty_u16
(
B
)
utime
sleep_ms
(

)
Copy the above MicroPython code to Thonny Editor and run the Script.
You will be able to see random color changes in the RGB Module.

Detailed Project Description

Controlling RGB LED using Raspberry Pi Pico is a hands-on electronics build: a small, well-understood circuit that teaches component behaviour, timing and PCB/breadboard skills before moving to microcontroller projects.

How It Works
1. The circuit is designed and simulated (or calculated) to choose resistor/capacitor values.
2. Components are placed on a breadboard/PCB following the schematic.
3. Power is applied and the behaviour (blink rate, colour sequence, trigger) is observed and measured.
4. Values are tweaked to see their effect on timing or brightness.

Key Components and Their Role
- Raspberry Pi Pico (RP2040): dual-core Cortex-M0+ microcontroller with PIO state machines used for precise, low-level timing.
- Raspberry Pi: single-board Linux computer that runs the higher-level processing and networking.
- Bluetooth Low Energy: short-range low-power wireless link to a phone or browser.

Implementation Steps
1. Collect the components and study each module's datasheet (pin-out, voltage, interface).
2. Wire the circuit on a breadboard following the pin mapping; power sensors from the correct rail (3.3 V / 5 V).
3. Install Thonny, MicroPython and the required libraries; flash a minimal test sketch for each module separately.
4. Write the main firmware: read sensors → process → drive outputs / send data.
5. Configure network or cloud credentials and test communication end-to-end.
6. Calibrate thresholds, add error handling (reconnect, sensor time-out) and run a long-duration test.
7. Finalise on a PCB / enclosure and document wiring, code and results.

Key Features
- Simple, low-cost components
- Clear schematic
- Adjustable timing / effect
- Great first soldering project

Expected Output
On completion the student will have a working circuit that behaves exactly as designed, with measurements confirming the calculated values.

Deliverables
- Complete source code with comments
- Circuit diagram and pin mapping
- Project report with screenshots and results
- Demonstration-ready build

Technologies used

Raspberry PiBLEPythonPWMMicroPython

Hardware components

  • Raspberry Pi

Software & tools

  • Thonny
  • MicroPython

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.