Projects / Pico Bluetooth LED panel

Pico Bluetooth LED panel

Beginner2 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. PICO

    Wire the module

    VCC to VBUS, GND to GND, TXD to GP1, RXD to GP0.

  2. PICO11.7 mA

    Wire the LEDs

    Each LED through 330 ohms to GP10, GP11 and GP12, other end to GND.

  3. PICO

    Run the program

    The module's light blinks fast, waiting to pair.

  4. PICO

    Pair the phone

    Choose HC-06 and enter the code 1234.

  5. PICO

    Open the terminal app

    Connect to HC-06.

  6. PICO11.7 mA

    Send 1

    LED 1 switches and a message comes back.

  7. PICO

    Send 9 and 0

    All on and all off.

In short

How do you build a pico Bluetooth LED panel?

A Pico reads text commands from an HC-06 Bluetooth module on a UART and switches three LEDs, controlled from a phone's serial terminal app. You need Raspberry Pi Pico H, HC-06 Bluetooth module, LED 5 mm red × 3, Resistor 330 Ω × 3 and Breadboard 830 Tie Points. It takes 7 steps and about 120 minutes.

Level
Beginner
Time
About 120 min
Parts
5

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
HC-06 VCCPico VBUS pin 405 V from USB (the module has its own regulator)
HC-06 GNDPico GND pin 38Common ground
HC-06 TXDPico GP1 pin 2 (UART0 RX)Data from the phone to the Pico
HC-06 RXDPico GP0 pin 1 (UART0 TX)Data from the Pico to the phone
LED 1330 ohm to Pico GP10 pin 14, LED to GNDSwitched by command 1
LED 2330 ohm to Pico GP11 pin 15, LED to GNDSwitched by command 2
LED 3330 ohm to Pico GP12 pin 16, LED to GNDSwitched by command 3

Code

The HC-06 is a classic Bluetooth module that acts as a wireless serial cable. Whatever your phone sends to it comes out of its TXD pin as ordinary serial data, and whatever you put into its RXD pin is sent to the phone. The Pico's UART reads that data one character at a time, and the program switches an LED for each command. Cross the wires, so the module's TX goes to the Pico's RX and the module's RX goes to the Pico's TX. The module's data pins work at 3.3 V, which matches the Pico, and it can run from the 5 V pin because the breakout carries a regulator. Pair the phone with the module (the name is usually HC-06 and the code usually 1234) and open a serial Bluetooth terminal app. Android phones can use classic Bluetooth serial this way; iPhones cannot, so try an Android phone or a computer. Change the pairing code if you plan to leave it switched on in a shared place.

from machine import Pin, UART
import time

uart = UART(0, baudrate=9600, tx=Pin(0), rx=Pin(1))  # HC-06 starts at 9600 baud
leds = [Pin(10, Pin.OUT), Pin(11, Pin.OUT), Pin(12, Pin.OUT)]

def say(text):
    uart.write(text + "\r\n")

say("Pico LED panel ready. Send 1, 2 or 3 to toggle, 9 for all on, 0 for all off.")

while True:
    if uart.any():
        ch = uart.read(1)
        if ch is None:
            continue
        c = ch.decode("utf-8", "ignore")
        if c in "123":
            led = leds[int(c) - 1]
            led.toggle()
            say("LED " + c + (" on" if led.value() else " off"))
        elif c == "9":
            for led in leds:
                led.value(1)
            say("All on")
        elif c == "0":
            for led in leds:
                led.value(0)
            say("All off")
    time.sleep_ms(10)

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Send 1LED 1 toggles and the phone shows LED 1 on
Send 1 againLED 1 off
Send 2 and 3The other LEDs toggle
Send 9All three on
Send 0All three off
Move awayStops working at about 10 metres

If it does not work

Module does not show up on the phone

Check it has power and the light is blinking, and pair from the phone Bluetooth settings.

No reply on the phone

Check TXD and RXD are crossed, module TX to Pico RX.

Strange characters

Check the baud rate, 9600 for the module as delivered.

iPhone cannot connect

iPhones do not support classic Bluetooth serial, use an Android phone.

LED does not light

Check the LED direction, the long leg goes to the resistor.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the pico Bluetooth LED panel?

Raspberry Pi Pico H, HC-06 Bluetooth module, LED 5 mm red × 3, Resistor 330 Ω × 3 and Breadboard 830 Tie Points.

How long does the pico Bluetooth LED panel take to build?

About 120 minutes for a beginner maker, in 7 steps.

How do I know the pico Bluetooth LED panel works?

Send 1: LED 1 toggles and the phone shows LED 1 on. Send 1 again: LED 1 off. Send 2 and 3: The other LEDs toggle.

Module does not show up on the phone: what should I check?

Check it has power and the light is blinking, and pair from the phone Bluetooth settings.

No reply on the phone: what should I check?

Check TXD and RXD are crossed, module TX to Pico RX.

Strange characters: what should I check?

Check the baud rate, 9600 for the module as delivered.

iPhone cannot connect: what should I check?

iPhones do not support classic Bluetooth serial, use an Android phone.