Instead of an alarm, I wake up to light. At 06:55 the strip starts to glow, at 07:10 it’s at full brightness, and just before 08:00 it fades out again. It repeats every morning.
How it works
- The strip is a battery-powered LED strip on four AAA cells. On a bench supply it draws about 280 mA.
- A BC337 switches it, driven through 220 Ω from a GPIO on a Raspberry Pi Pico. That gives about 11 mA of base current, enough to turn it fully on at the strip’s current. The transistor sits between the two pairs of cells, so the Pico’s ground meets the battery circuit at the emitter and nowhere else. The Pico itself runs off USB.
- The fade is 1 kHz PWM with gamma correction. The eye responds to light roughly logarithmically, so a linear ramp looks like it jumps up and then stalls. Raising the level to the power of 2.2 before it goes to the PWM makes the sunrise look even.
- The clock. A plain Pico has no battery-backed clock. Instead it assumes it was plugged in at a set date and time and counts milliseconds from there, working out summer and winter time itself. Five quick blinks at power-up show that it’s running.
Written in MicroPython.

