·SuperBuilder Team

DIY Sunrise Alarm Clock for $20 (Raspberry Pi + LED Strip)

raspberry pihardwarediyvibe codingsuperbuilderpython

DIY Sunrise Alarm Clock for $20 (Raspberry Pi + LED Strip)

The Philips Hue Wake-Up Light costs $180. This one costs $20 and it's better — because you built it yourself and you can make it do anything.

In this guide you will wire up a Raspberry Pi Pico W with a WS2812B LED strip and write the firmware using SuperBuilder. No prior hardware experience needed. No Python expertise required. You describe what you want, SuperBuilder generates the code, and you flash it.

Want the complete code without reading the whole guide? Comment SUNRISE on the YouTube video and I'll DM you the link — or drop your email at the bottom of this page.


What You Are Building

A bedside lamp that:


Parts List (~$18 total)

PartWhere to buyCost
Raspberry Pi Pico WAmazon / Adafruit~$6
WS2812B LED strip (60 LEDs/m, 0.5m)Amazon~$5
5V 3A USB-C power supplyAmazon~$5
Jumper wires (3 pins)Any electronics kit~$1
Small project box (optional)Amazon~$2

The Pico W has built-in WiFi — no extra modules needed. That is the key ingredient that makes this project possible for under $20.


Wiring (5 minutes)

The WS2812B strip needs only 3 connections to the Pico W:

LED Strip    →    Pico W
─────────────────────────
5V  (red)    →    VBUS (pin 40)
GND (black)  →    GND  (pin 38)
DIN (green)  →    GP0  (pin 1)

That's it. No resistors, no capacitors, no soldering if you use a strip with a JST connector.


Setting Up SuperBuilder

If you don't have SuperBuilder installed yet:

  1. Download from superbuilder.ai
  2. Open it and create a new project — call it sunrise-alarm
  3. Make sure you have a main.py file open (or ask SuperBuilder to create one)

SuperBuilder runs Claude Code under the hood, which means you can describe hardware logic in plain English and get working MicroPython back.


Step 1: LED Sunrise Simulation

Open a chat in SuperBuilder and paste this prompt:

Write MicroPython code for a Raspberry Pi Pico W that controls a WS2812B LED strip on GP0 with 30 LEDs.

Create a sunrise_sequence() function that:
- Takes 15 minutes total to complete
- Starts with 2 LEDs lit in deep red (RGB 20, 0, 0)
- Gradually increases to all 30 LEDs
- Transitions color from red → orange → yellow → warm white
- Uses smooth interpolation between color steps
- Calls utime.sleep_ms(500) between steps so it doesn't block WiFi

Use the neopixel module.

SuperBuilder will generate something like this:

import neopixel
import machine
import utime

NUM_LEDS = 30
PIN = machine.Pin(0)
np = neopixel.NeoPixel(PIN, NUM_LEDS)

SUNRISE_STEPS = [
    (0,   2,  (20,  0,   0)),    # deep red, 2 LEDs
    (120, 6,  (60,  10,  0)),    # red-orange, 6 LEDs
    (240, 12, (120, 40,  0)),    # orange, 12 LEDs
    (360, 18, (180, 80,  10)),   # warm orange, 18 LEDs
    (480, 22, (220, 130, 30)),   # yellow-orange, 22 LEDs
    (600, 26, (240, 180, 80)),   # warm yellow, 26 LEDs
    (720, 30, (255, 220, 150)),  # warm white, all LEDs
    (900, 30, (255, 255, 200)),  # full warm white
]

def lerp_color(c1, c2, t):
    return tuple(int(c1[i] + (c2[i] - c1[i]) * t) for i in range(3))

def sunrise_sequence():
    for i in range(len(SUNRISE_STEPS) - 1):
        t_start, leds_start, color_start = SUNRISE_STEPS[i]
        t_end, leds_end, color_end = SUNRISE_STEPS[i + 1]
        steps = (t_end - t_start) * 2  # 500ms ticks
        for step in range(steps):
            t = step / steps
            leds = int(leds_start + (leds_end - leds_start) * t)
            color = lerp_color(color_start, color_end, t)
            for j in range(NUM_LEDS):
                np[j] = color if j < leds else (0, 0, 0)
            np.write()
            utime.sleep_ms(500)

Test it: flash this to your Pico W using Thonny or mpremote, run sunrise_sequence() in the REPL. You should see the strip slowly wake up.


Step 2: WiFi + Alarm Scheduler

Now tell SuperBuilder:

Extend the MicroPython code to:
1. Connect to WiFi using credentials stored in a config.json file: {"ssid": "...", "password": "..."}
2. Start an HTTP server on port 80 with these endpoints:
   - GET /  → returns a simple HTML page with a form to set alarm time (HH:MM)
   - POST /alarm  → accepts {"time": "07:30"} and saves it
   - GET /status → returns JSON with current time and next alarm
3. Check the alarm time every minute in the main loop
4. When the alarm triggers, run sunrise_sequence() in a non-blocking way
5. Use uasyncio so the web server and alarm check run concurrently

SuperBuilder will wire together the async web server and alarm loop. The HTML page it generates is basic but functional — any phone on your WiFi can set the alarm by visiting the Pico's IP address.


Step 3: Config File

Create a config.json next to main.py:

{
  "ssid": "YourWiFiName",
  "password": "YourWiFiPassword",
  "alarm": "07:00"
}

SuperBuilder will also handle syncing time via NTP so the Pico knows what time it is after reboot.


Step 4: Flash and Run

  1. Copy main.py and config.json to the Pico W root using Thonny or mpremote cp
  2. Reboot the Pico (machine.reset() or unplug/replug)
  3. Open the serial monitor — you will see the WiFi IP address printed
  4. Visit that IP from your phone browser
  5. Set an alarm time

That's it. The alarm will trigger tomorrow morning.


Vibe Coding Moments in This Project

If you follow along, you will hit two moments that show why SuperBuilder makes hardware projects accessible:

Moment 1 — the LED math. Interpolating colors and syncing LED count to time elapsed is annoying to write by hand. SuperBuilder generated clean, readable lerp code in one shot.

Moment 2 — async on a microcontroller. Running a web server and checking the alarm time and animating LEDs simultaneously is what uasyncio is for. It's not obvious how to structure this if you've never done async MicroPython. SuperBuilder got it right without you needing to know the library.

This is vibe coding for hardware: you describe the behavior, the AI handles the implementation details.


Going Further

Once you have the base working, here are natural extensions to try with SuperBuilder:


Get the Complete Code

The code above is the core logic. The full project includes:

Comment SUNRISE on the YouTube video and I'll DM you the link directly — or drop your email below and I'll send it to your inbox.

→ Send me the complete code


FAQ

Do I need to know Python? No. SuperBuilder generates all the code. You just need to be able to copy files to a microcontroller, which Thonny makes point-and-click.

Will this work with a regular Raspberry Pi (not Pico)? Yes, but you'll write Python instead of MicroPython, and use a different LED library (rpi_ws281x). Tell SuperBuilder you're on a Pi 4 and it will adapt the code.

Can I use a different LED strip? WS2812B (also sold as NeoPixel) is the easiest. SK6812 also works. Avoid APA102 strips for this project — they need an extra clock wire.

My LEDs are flickering. Add a 300–500 ohm resistor between GP0 and DIN. Also make sure the strip's power and the Pico share a common ground.

How do I make it brighter? Use a 1-meter strip at 60 LEDs/m instead of 0.5m. Scale NUM_LEDS to 60 in the code. Tell SuperBuilder "update for 60 LEDs" and it will adjust.

SuperBuilder

Build faster with SuperBuilder

Run parallel Claude Code agents with built-in cost tracking, task queuing, and worktree isolation. Free and open source.

Download for Mac