The gloomier end of the year can be improved with pretty lights and sparkles, at least so goes the thinking behind purveyors of SAD (seasonal affective disorder) lamps, while the festive season also partly owes its timing to attempts to break up the monotony of winter. Teacher Russell Eveleigh’s impressive Sunrise lamp could easily do a turn as a mood-brightening SAD lamp, but was envisaged as an alternative to a Gro clock.

“Gro clocks serve to persuade children to stay in bed until a reasonable hour; in our house, the clocks we had been passed on were simply ignored,” Russell relates. Nonetheless, it was while on paternity leave that Russell began his first forays into Raspberry Pi project creation, using the Raspberry Pi Camera for a time-lapse of his young son sleeping in his Moses basket. “I’m lucky his first word wasn’t LED!” he jokes. More recently, Russell had been looking for an excuse to learn more about addressable LEDs and how they may be controlled via the GPIO pins on Raspberry Pi. 

Snap to it

The Sunrise Lamp resulted from another of Russell’s nascent interests: Snapology, a technique in which origami shapes are created from rigid triangles. Having seen Ed Chew’s award-winning Tetra Lamp made from recycled cartons, Russell became convinced that a programmable light source in the centre of a similar [origami lampshade] “could create some interesting patterns and lead to lie-ins beyond 5 am!” Creating his version became a good way to unwind of an evening, with mindfulness due to the repetition involved in folding 320 triangles and more than 600 connecting pieces for the lamp’s origami shade.

During the night, the light dims and the lamp functions as a night light, then at a predetermined time, the Sunrise Lamp slowly begins to brighten to indicate that it’s morning and time to get up, he explains.

Armed with Raspberry Pi Zero W, a plastic case, and £7 worth of NeoPixels from The Pi Hut, Russell followed the reseller’s detailed instructions for installing LED libraries and NeoPixel maker Adafruit’s guide to installing CircuitPython on Raspberry Pi. 

Having established that a modest number of LEDs could be controlled from Raspberry Pi with no need for an additional power source – its 5 V pin would suffice – Russell soldered the ring to the GPIO header on his Raspberry Pi and used SSH to log in and control the lamp.

Changing things up

Russell was pleased with his Sunrise Lamp and impressed by the intriguing patterns it creates on his ceiling, depending on whether one or more NeoPixels is active. He later revised the setup (seen in his follow-up Moon Phase Lamp) using Apache and PHP directly on the Raspberry Pi Zero. This meant the web page menu could instantly change the light sequence. Raspberry Pi Pico, or a different microcontroller, could also be used to replicate this project, but in this instance Russell was keen to learn about using Raspberry Pi with a web server. 

He was also advised to use red, not blue, lights so as not to interfere with anyone’s sleep patterns. “Apparently there may be some kind of evolutionary link to our ancestors sleeping around camp-fires,” he muses.

From The MagPi store