Matteo Fenu's Raspberrarium Turns Two LEDs Into a Convincing Day-Night and Lunar Cycle Simulator
Provide your plants with a little photonic enrichment with this simple Raspberry Pi-powered terrarium lighting system.
Self-described technology and art enthusiast Matteo Fenu has released a package designed to turn a Raspberry Pi and two programmable LEDs into a lighting system for terrariums — syncing itself to the real-world daylight and lunar cycles.
"Raspberrarium [is] a minimal lighting system using a Raspberry Pi and two WS2812 LEDs," Fenu explains of the project. "This project simulates: a real daylight cycle (sunrise, noon, sunset); real moon phases during the night. This project is designed for small-scale containers. The container can be anything: a glass jar; a small terrarium; any enclosed decorative space."
A terrarium, for those unfamiliar, is typically an enclosed ecosystem — effectively a sealed-off greenhouse designed to accept only heat and light from its surroundings while providing ideal conditions for the growth of plants that would not thrive in the environment outside. While most rely on ambient lighting, the Raspberrarium attempts to offer something for terrariums positioned away from windows: a real day-night cycle.
The hardware is simple: a pair of WS2812 programmable RGB LEDs are linked to the general-purpose input/output (GPIO) header of a Raspberry Pi single-board computer and placed under the control of a Python program. Using the Astral Python library, the program calculates the current position of the sun and moon — and during the day changes the color temperature and brightness of the LEDs to approximate sunlight.
At night, the program switches to tracking the moon. Not only does this mode adjust the brightness, it uses both LEDs separately to approximate the waxing or waning of the moon — with both LEDs on for a full moon, and both off for a new moon. "For a small container," Fenu notes, "this is enough to create a convincing effect. This project keeps the logic simple. LED 0 is always treated as the left side; LED 1 is always treated as the right side. If you are in the southern hemisphere, simply rotate the container/LED[s]."
The project's source code is available on GitHub under an unspecified open source license; those looking to build a Raspberrarium of their own, however, are advised that WS2812 LEDs are not full-spectrum and thus cannot provide what plants crave without a supporting grow-light or access to natural light through a window.