Light the Lorikeet with Raspberry Pi Pico
Connect five addressable RGB LEDs with an interactive 3D build, complete code and colour experiments.
Build a five-pixel colour light, follow every connection in 3D, then run a program that changes all five LEDs from red to green to blue once a second. Learn which wire supplies power, which carries data, and why a colour change needs an explicit send command.
Bring the host board and USB connection described in the first step. The shopping list below contains the additional breadboard circuit parts.
Step 1 — Gather the parts and identify the input
An original RP2040 Raspberry Pi Pico H (or Pico with two soldered straight headers), a micro-USB data cable and Thonny on your computer. Install MicroPython for the original Pico before running this program.
- 1 × Little Bird Lorikeet WS2812B Rainbow Board (five LEDs, input header soldered).
- 1 × 830-contact solderless breadboard; 1 × 330 Ω resistor; jumper leads.
- A computer and the correct data-capable USB cable. No battery or separate LED supply is required for this single-board, low-brightness test.
- 1 × 74AHCT125 DIP-14 level shifter, plus 1 × 100 nF ceramic capacitor.
- Male-to-male jumpers for the breadboard. The Pi 5 also needs three female-to-male jumpers for its GPIO header.
Unplug all power before adding or moving wires. Match the printed −, + and DIN labels on the Lorikeet input header; the pads at the other end are the output for another board. Never connect 5 V to a 3.3 V GPIO. Use one board and keep LEVEL at 24 for the first USB-powered test. Do not power the LEDs from a GPIO pin or the 3V3 rail.
For longer chains or high brightness, use a suitably rated external regulated 5 V LED supply and a common ground. Keep its positive output separate from the host 5 V rail. Adafruit recommends a bulk capacitor at an external LED supply; do not scale this small USB-powered circuit without reviewing the power requirements.
Step 2 — Follow the complete 3D build
Press Play to follow the connections, or rotate and zoom to inspect a pin. The individual actions below let you work at your own pace. The final colour animation shows the supplied program’s sequence; it does not run edits from the code editor.
Loading assembly…
Insert the Pico H across the centre channel, with GP0 in C26 and the U S B connector on the right. Both rows must sit in separate strips. Use a board with straight headers already soldered. Insert the Lorikeet input header into A55, A56 and A57. Its minus pin is ground, plus is five volts, and DIN receives data. Keep the five L E Ds facing up; the board extends beyond the breadboard. Insert the 330 ohm resistor with one lead in D53 and the other in D57. The D57 strip already connects to Lorikeet DIN. Either resistor orientation works. Insert the 74AHCT125 across the centre channel. The pin-one dot is on the upper right: pin one goes into E48, pin seven into E42, and pin fourteen into F48. Use AHCT, not HC. Insert the 100 nanofarad ceramic capacitor into H49 and H50. It is not polarised. Short wires will connect it across the buffer supply. Connect buffer output pin three to the free end of the 330 ohm resistor. The buffer raises the data level to five volts. Connect the Pico’s ground pin to the ground rail. Every signal in this circuit needs the same ground reference. Connect the Pico’s U S B power pin to the positive rail. Keep the supply unplugged until every connection is checked. Connect the ground rail to the Lorikeet board’s ground pin, using a free hole on the same strip as the Lorikeet minus pin. Connect the positive rail to the Lorikeet board’s 5 volts pin. This is five volts for the L E Ds; it is not a general purpose input and output signal. Connect buffer pin seven to ground. Connect buffer pin fourteen to five volts. Connect pin one to ground to enable the first buffer channel. Connect pin four to five volts to disable the unused second channel. Connect pin ten to five volts to disable the unused third channel. Connect pin thirteen to five volts to disable the unused fourth channel. Connect unused input pin five to ground so it cannot float. Connect unused input pin nine to ground. Connect unused input pin twelve to ground. Connect one capacitor lead to the five volt supply at buffer pin fourteen. Connect the other capacitor lead to buffer ground, pin seven. This capacitor helps stabilise the buffer supply. Connect the Pico’s GP0 pin to buffer input pin two. This side carries the three point three volt signal. Check five volts, ground and the data path. Then connect power and run the code below. All five L E Ds should show red, green and blue, changing once a second.
Step 3 — Place Raspberry Pi Pico · RP2040 with headers
Insert the Pico H across the centre channel, with GP0 in C26 and the USB connector on the right. Both rows must sit in separate strips. Use a board with straight headers already soldered.
Exact breadboard holes
- pico · GP0 → C26
- pico · GP1 → C25
- pico · GND → C24
- pico · GP2 → C23
- pico · GP3 → C22
- pico · GP4 → C21
- pico · GP5 → C20
- pico · GND → C19
- pico · GP6 → C18
- pico · GP7 → C17
- pico · GP8 → C16
- pico · GP9 → C15
- pico · GND → C14
- pico · GP10 → C13
- pico · GP11 → C12
- pico · GP12 → C11
- pico · GP13 → C10
- pico · GND → C9
- pico · GP14 → C8
- pico · GP15 → C7
- pico · GP16 → H7
- pico · GP17 → H8
- pico · GND → H9
- pico · GP18 → H10
- pico · GP19 → H11
- pico · GP20 → H12
- pico · GP21 → H13
- pico · GND → H14
- pico · GP22 → H15
- pico · RUN → H16
- pico · GP26 → H17
- pico · GP27 → H18
- pico · AGND → H19
- pico · GP28 → H20
- pico · ADC_VREF → H21
- pico · 3V3 → H22
- pico · 3V3_EN → H23
- pico · GND → H24
- pico · VSYS → H25
- pico · VBUS → H26
Loading assembly…
Insert the Pico H across the centre channel, with GP0 in C26 and the U S B connector on the right. Both rows must sit in separate strips. Use a board with straight headers already soldered.
Step 4 — Place Little Bird Lorikeet · five WS2812B LEDs
Insert the Lorikeet input header into A55, A56 and A57. Its minus pin is ground, plus is five volts, and DIN receives data. Keep the five LEDs facing up; the board extends beyond the breadboard.
Exact breadboard holes
- lorikeet · GND → A55
- lorikeet · 5V → A56
- lorikeet · DIN → A57
Loading assembly…
Insert the Lorikeet input header into A55, A56 and A57. Its minus pin is ground, plus is five volts, and DIN receives data. Keep the five L E Ds facing up; the board extends beyond the breadboard.
Step 5 — Place 330 Ω resistor
Insert the 330 ohm resistor with one lead in D53 and the other in D57. The D57 strip already connects to Lorikeet DIN. Either resistor orientation works.
Exact breadboard holes
- resistor · Pin 0 → D53
- resistor · Pin 1 → D57
Loading assembly…
Insert the 330 ohm resistor with one lead in D53 and the other in D57. The D57 strip already connects to Lorikeet DIN. Either resistor orientation works.
Step 6 — Place 74AHCT125 · 3.3V to 5V buffer
Insert the 74AHCT125 across the centre channel. The pin-one dot is on the upper right: pin one goes into E48, pin seven into E42, and pin fourteen into F48. Use AHCT, not HC.
Exact breadboard holes
- buffer · 1OE → E48
- buffer · 1A → E47
- buffer · 1Y → E46
- buffer · 2OE → E45
- buffer · 2A → E44
- buffer · 2Y → E43
- buffer · GND → E42
- buffer · 3Y → F42
- buffer · 3A → F43
- buffer · 3OE → F44
- buffer · 4Y → F45
- buffer · 4A → F46
- buffer · 4OE → F47
- buffer · VCC → F48
Loading assembly…
Insert the 74AHCT125 across the centre channel. The pin-one dot is on the upper right: pin one goes into E48, pin seven into E42, and pin fourteen into F48. Use AHCT, not HC.
Step 7 — Place 100 nF ceramic capacitor
Insert the 100 nanofarad ceramic capacitor into H49 and H50. It is not polarised. Short wires will connect it across the buffer supply.
Exact breadboard holes
- bypass · 0 → H49
- bypass · 1 → H50
Loading assembly…
Insert the 100 nanofarad ceramic capacitor into H49 and H50. It is not polarised. Short wires will connect it across the buffer supply.
Step 8 — Connect A46 → A53
Connect buffer output pin three to the free end of the 330 ohm resistor. The buffer raises the data level to five volts.
| Connect | To |
|---|---|
| A46 | A53 |
Loading assembly…
Connect buffer output pin three to the free end of the 330 ohm resistor. The buffer raises the data level to five volts.
Step 9 — Connect A24 → T− rail 19
Connect the Pico’s ground pin to the ground rail. Every signal in this circuit needs the same ground reference.
| Connect | To |
|---|---|
| A24 | T− rail 19 |
Loading assembly…
Connect the Pico’s ground pin to the ground rail. Every signal in this circuit needs the same ground reference.
Step 10 — Connect J26 → T+ rail 20
Connect the Pico’s VBUS pin to the positive rail. Keep the supply unplugged until every connection is checked.
| Connect | To |
|---|---|
| J26 | T+ rail 20 |
Loading assembly…
Connect the Pico’s U S B power pin to the positive rail. Keep the supply unplugged until every connection is checked.
Step 11 — Connect T− rail 45 → B55
Connect the ground rail to the Lorikeet board’s ground pin, using a free hole on the same strip as the Lorikeet minus pin.
| Connect | To |
|---|---|
| T− rail 45 | B55 |
Loading assembly…
Connect the ground rail to the Lorikeet board’s ground pin, using a free hole on the same strip as the Lorikeet minus pin.
Step 12 — Connect T+ rail 45 → B56
Connect the positive rail to the Lorikeet board’s 5V pin. This is five volts for the LEDs; it is not a GPIO signal.
| Connect | To |
|---|---|
| T+ rail 45 | B56 |
Loading assembly…
Connect the positive rail to the Lorikeet board’s 5 volts pin. This is five volts for the L E Ds; it is not a general purpose input and output signal.
Step 13 — Connect A42 → T− rail 34
Connect buffer pin seven to ground.
| Connect | To |
|---|---|
| A42 | T− rail 34 |
Loading assembly…
Connect buffer pin seven to ground.
Step 14 — Connect J48 → T+ rail 39
Connect buffer pin fourteen to five volts.
| Connect | To |
|---|---|
| J48 | T+ rail 39 |
Loading assembly…
Connect buffer pin fourteen to five volts.
Step 15 — Connect A48 → T− rail 39
Connect pin one to ground to enable the first buffer channel.
| Connect | To |
|---|---|
| A48 | T− rail 39 |
Loading assembly…
Connect pin one to ground to enable the first buffer channel.
Step 16 — Connect A45 → T+ rail 36
Connect pin four to five volts to disable the unused second channel.
| Connect | To |
|---|---|
| A45 | T+ rail 36 |
Loading assembly…
Connect pin four to five volts to disable the unused second channel.
Step 17 — Connect J44 → T+ rail 35
Connect pin ten to five volts to disable the unused third channel.
| Connect | To |
|---|---|
| J44 | T+ rail 35 |
Loading assembly…
Connect pin ten to five volts to disable the unused third channel.
Step 18 — Connect J47 → T+ rail 38
Connect pin thirteen to five volts to disable the unused fourth channel.
| Connect | To |
|---|---|
| J47 | T+ rail 38 |
Loading assembly…
Connect pin thirteen to five volts to disable the unused fourth channel.
Step 19 — Connect A44 → T− rail 35
Connect unused input pin five to ground so it cannot float.
| Connect | To |
|---|---|
| A44 | T− rail 35 |
Loading assembly…
Connect unused input pin five to ground so it cannot float.
Step 20 — Connect J43 → T− rail 33
Connect unused input pin nine to ground.
| Connect | To |
|---|---|
| J43 | T− rail 33 |
Loading assembly…
Connect unused input pin nine to ground.
Step 21 — Connect J46 → T− rail 37
Connect unused input pin twelve to ground.
| Connect | To |
|---|---|
| J46 | T− rail 37 |
Loading assembly…
Connect unused input pin twelve to ground.
Step 22 — Connect J49 → I48
Connect one capacitor lead to the five volt supply at buffer pin fourteen.
| Connect | To |
|---|---|
| J49 | I48 |
Loading assembly…
Connect one capacitor lead to the five volt supply at buffer pin fourteen.
Step 23 — Connect J50 → B42
Connect the other capacitor lead to buffer ground, pin seven. This capacitor helps stabilise the buffer supply.
| Connect | To |
|---|---|
| J50 | B42 |
Loading assembly…
Connect the other capacitor lead to buffer ground, pin seven. This capacitor helps stabilise the buffer supply.
Step 24 — Connect A26 → A47
Connect the Pico’s GP0 pin to buffer input pin two. This side carries the three point three volt signal.
| Connect | To |
|---|---|
| A26 | A47 |
Loading assembly…
Connect the Pico’s GP0 pin to buffer input pin two. This side carries the three point three volt signal.
Step 25 — Run the colour sequence
Check five volts, ground and the DIN path. Then connect power and run the code below. All five LEDs should show red, green and blue, changing once a second.
Loading assembly…
Check five volts, ground and the data path. Then connect power and run the code below. All five L E Ds should show red, green and blue, changing once a second.
Step 26 — Check the complete circuit
Before applying power, trace ground, five volts and data separately. The resistor must be in the data path, not between 5 V and the Lorikeet. No jumper should bridge the positive and ground rails.
The buffer is one-way: GPIO enters pin 2 (1A), leaves pin 3 (1Y) at 5 V, then passes through 330 Ω to DIN. Unused outputs 6, 8 and 11 remain unconnected. Unused inputs are grounded and their enable pins are high.
Step 27 — Prepare MicroPython on the Pico
Install Thonny and select the MicroPython (Raspberry Pi Pico) interpreter. For a new board, unplug USB, hold BOOTSEL while plugging it in, and use Thonny’s Install or update MicroPython option for the original Pico/RP2040. Installing firmware replaces existing files, so save any previous work first.
Reconnect normally and select the Pico’s serial port in Thonny. The Shell should show a MicroPython prompt. The neopixel module is included in the Pico MicroPython firmware; this is not a desktop Python program. Pico MicroPython setup.
Step 28 — Run the MicroPython program
from machine import Pin
from neopixel import NeoPixel
from time import sleep_ms
LED_COUNT = 5
LEVEL = 24 # A dim first test for one USB-powered board.
HOLD_MS = 1000
pixels = NeoPixel(Pin(0, Pin.OUT), LED_COUNT) # GP0, physical pin 1, via 74AHCT125.
try:
while True:
for colour in ((LEVEL, 0, 0), (0, LEVEL, 0), (0, 0, LEVEL)):
pixels.fill(colour) # Tuples are (red, green, blue).
pixels.write() # Transmit the buffered colours.
sleep_ms(HOLD_MS)
finally:
pixels.fill((0, 0, 0))
pixels.write()
Open the code below in Thonny, save it to the Raspberry Pi Pico as lorikeet.py, then press Run. Use Stop to end it. Once it works, saving a copy on the Pico as main.py makes it start at power-up. GP0 is physical pin 1; do not mistake it for physical pin 0.
Step 29 — Understand the program
Each LED package contains red, green and blue emitters plus a controller. The host sends one timed stream into DIN. The first pixel uses the first colour value, then forwards the remaining values along the board. Each LED keeps its last value until a new frame arrives; one data wire can therefore control all five independently.
Pin(0, Pin.OUT) selects GP0 as the output. NeoPixel(..., 5) allocates five pixel values. LEVEL = 24 keeps each selected channel dim, while HOLD_MS = 1000 makes each frame last one second.
while True repeats indefinitely. The for loop visits three RGB tuples: (24, 0, 0), (0, 24, 0), then (0, 0, 24). fill() copies the tuple to all five pixels, write() sends it, and sleep_ms() waits. Indentation groups the statements that run for each tuple.
The first tuple lights red for one second; the second replaces it with green. The finally block sends black when the script is interrupted normally. Pulling USB power simply removes power; it does not execute Python cleanup.
Step 30 — Test, predict and change one thing
Success check: all five LEDs change together, red → green → blue, with one second per colour and three seconds per full cycle. Let three cycles run and check for flicker before changing anything.
Predict what happens if you halve the hold time. Change only HOLD_MS to 500 (Arduino/Pico), or HOLD_SECONDS to 0.5 (Pi), run again and time one complete red–green–blue cycle. Record your prediction and observation.
Next, keep the green value at zero and use equal red and blue values. Predict the colour before trying it. Finally, explain why changing the saved colour without calling show() or write() leaves the LEDs unchanged.
Check your reasoning
A cycle falls from three seconds to 1.5 seconds. Equal red and blue make magenta. fill() changes a buffer in the host; show()/write() transmits that buffer, so the LEDs cannot see an unsent change.
Step 31 — Find and fix a problem
- No lights: disconnect power; check − to ground, + to 5 V and data to DIN rather than DOUT. Confirm the resistor shares DIN’s strip and LED_COUNT is 5. Reconnect and rerun.
- Flicker or random colours: check the shared ground and shorten the data wiring. On Pico/Pi, check AHCT125 pin 14 to 5 V, pin 7 to ground and active-low pin 1 to ground. Do not substitute a 74HC125.
- Wrong colours: keep the library’s GRB wire order but supply colour tuples/arguments in red, green, blue order. If just one pixel fails, test the first pixel before suspecting the software.
- The board resets: unplug it and check for a short. Return LEVEL to 24 and test only one Lorikeet. Do not keep increasing brightness to diagnose a power fault.
Step 32 — Keep exploring
Parts List
Required Parts (6)
Five WS2812B LEDs. Use the input header marked −, + and DIN.
x1
$2.00
In stock
DIP-14 AHCT buffer, powered at 5 V. Also use a 100 nF bypass capacitor.
x1
$3.15
Out of stock
Use one full-size 830-contact board for the numbered 3D layout.
x1
$8.90
In stock
Use five leads for Arduino, seventeen for Pico, or fourteen plus three female-to-male leads for Pi 5.
x1
$10.60
In stock
Use one 100 nF (0.1 µF) capacitor across the AHCT125 supply.
x1
$0.65
In stockProject Summary
6 parts total
Unavailable items will be skipped