We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

Raspberry Pi Pico–powered sunrise alarm clock

In a particularly pleasant awakening, issue 164 of Raspberry Pi Official Magazine has arrived, and with it, this home-made sunrise alarm clock. Built on Raspberry Pi Pico 2 W, the alarm has done wonders for one couple’s sleep patterns — and their wallets.

Isn’t the change of seasons welcome? Birds are nesting, spring flowers are brightening our gardens, and the trees are beginning to bud. It’s been a long winter for many reasons, made all the tougher for being so endlessly dark, cold, and windy. No wonder some of us were keen to hibernate! One maker, Pawel Skiba, got an unexpected wake-up call that prompted him to create a Raspberry Pi Pico–based sunrise alarm clock, making the inevitable transition to morning that little bit less of a jolt.

Sound the alarm

Pawel speaks for many of us when he bemoans the endless winter nights. “It’s dark when we come back home after work, and it’s dark when the alarm clock again plays the same melody that irritates us more each morning.” You’ll probably also empathise with not wanting to leave a warm bed because it still feels like the middle of the night. Pawel was “passively” struggling with this fact, but “finally decided to fight winter darkness when one day I heard my lovely wife saying: ‘Enough! I’m about to buy a light alarm clock and it will cost you 250 euros – plus tax.'”

Spurred into action, Pawel soon discovered that it’s scientifically proven that humans need light to wake up properly, due to biological processes triggered in our bodies when sunlight touches our skin. In essence, “there must be some light in the bedroom if I want to get rid of the ‘it’s the middle of the night’ [thoughts] and other heavy-head feelings.”

At 6am, the first red glow of dawn is simulated by red LEDs behind the bed

Pawel’s wife had already mentioned something that could address the lack-of-light issue. “Light alarm clocks simulate the sunrise process by slowly lighting up our bedrooms when we’re still asleep.” Starting with red light shining on the horizon, sunrise lamps gradually shift to lighter colours, suffusing the room with warm white light and then bright white light to help the user wake up gently — and fully. It took Pawel next to no time to realise that these devices look just like regular alarm clocks, but with “one or a few small but powerful LED diodes” added. As Chief Technology Officer at RapidLab, which specialises in Internet of Things (IoT) research and design, creating one of his own “was not rocket science”.

Bathed in sunlight

In a bid to make his wife happy — and avoid pressing the ‘Buy Now’ button on a certain online retailer — Pawel set about collecting the necessary components to replace the dreaded alarm clock. Having looked into making his own sunrise lamp, he decided he wasn’t that keen on them, and opted to create his own setup with much more light than a commercially available device is able to provide.

A step-down converter accommodates the power difference between the 5V Raspberry Pi Pico and the 12V LEDs, which switch on at timed intervals

Pawel spent a few sleepless nights designing the system, starting out with a handful of powerful LEDs fitted with diffusers to protect the eyes. In the end, he decided to use a metre-long strip of red light at the head of the bed, rather than individual LEDs. This red light turns on 40 minutes before the couple needs to wake up, reflecting off the wall behind them in a fair approximation of a dawn glow. Warm white LEDs running along another side of the bed reflect light upwards around 30 minutes before it’s time to rise, and at the base and head of the bed, further warm white LEDs turn on 10 and 20 minutes later.

The entire setup is controlled by a Raspberry Pi Pico 2 W connected to a Waveshare 1.3-inch OLED module for the clock display. Pawel chose a Raspberry Pi–based system for its low cost and reliability. He had used Raspberry Pi Pico in previous projects, including the Locoloro interactive AI parrot that his company, RapidLab, created for an Ecuadorian restaurant in his home town (see RPOM issue 158).

Subsequent lights — mainly warm white ones — suffuse the room for a gentle wake-up call

Pawel coded everything in MicroPython to create what he calls “the sunrise magic”. While the setup itself was not overly complex, it needed a step-down converter fitted to handle the power difference between the 5V Raspberry Pi Pico 2 W and the 12V LED strips. Pawel’s initial prototype involved two separate power supplies but, as he observes, keeping the wiring simple made far more sense. “Too many wires are a bad omen for each wire,” he reasons. Since Pico’s 3.3V GPIO pins cannot drive the LED strips directly, a ULN2003AN Darlington transistor array was used for switching. There was also the practical consideration of trying to build an elegant and sophisticated bedroom lighting system that didn’t have tempting wires that might attract curious children.

The final stage shines bright white light directly into the sleeping couple’s faces

Pawel has been delighted with how his Pico Light Alarm Clock turned out: “Nothing brings me more pleasure than building devices which physically work and solve daily challenges.” This project is his favourite example to date.

Issue 164 of Raspberry Pi Official Magazine is out NOW!

You can grab this issue from Tesco, Sainsbury’s, Asda, WHSmith, and other newsagents, including the Raspberry Pi Store in Cambridge. It’s also available from our online store, which ships around the world. And you can get a digital version via our app on Android or iOS.

You can also subscribe to the print version of our magazine. Not only do we deliver worldwide, but people who sign up to the six- or twelve-month print subscription get a FREE Raspberry Pi Pico 2 W!

No comments
Jump to the comment form

Leave a Comment