Build Guide 🫙 🌱

RASPBERRARIUM

+ MOTHER
NATURE

A tiny self-contained terrarium paired with a Raspberry Pi lighting system that simulates a full day/night cycle and the phases of the moon.

The finished Raspberrarium

The finished Raspberrarium: a sealed jar ecosystem lit from above.

Everything in this build came from things I had around me. You don't need the exact jar, the exact materials, or anything you see in this tutorial or any other tutorial online. Use whatever you already have, and let your creativity guide you. Don't feel stuck: the best terrariums come from a bit of resourcefulness, not a shopping list.

A fallen branch

A branch (best with moss on it)

Spare containers

Containers

Leaves, branches, and tiny insects

Leaves, branches, tiny insects

Small plants

Plants

Overview

This guide walks through how to assemble the physical terrarium, from the layered substrate at the bottom of the jar to the lid that houses the lighting, ventilation, and watering points on top.

The electronics and software are covered in the Raspberrarium code repository . Here we focus only on the build itself.

Materials

The jar used for the build

The jar used for this build.

On top of the physical build, the terrarium is lit by a small Raspberry Pi setup that runs the day/night and moon-phase cycle. The wiring, code, and setup instructions for that part live in the Raspberrarium code repository . For the electronics you'll need:

* The syringe isn't the only option. Another approach is to fit a thin transparent tube through the lid and seal it in place, so water can be poured directly into the tube. Adding a small piece of mesh or a grid at the outer end helps keep insects from crawling in or out. Use whichever method suits you best, and in either case try to avoid watering directly onto the leaves or letting any water reach the LEDs.

Base Layers

The base of the terrarium is built up in several layers. Each one has a role in drainage, filtration, or supporting plant life, and together they create a small but self-sustaining foundation.

As you add each layer, gently tamp it down with a spoon or any small flat tool to compact it evenly. This keeps the layers stable, prevents pockets of air, and helps the whole base settle properly before the next one goes on top.

The layers

Gravel 1

Gravel: drainage layer at the very bottom.

Tree bark 2

Tree bark: adds structure and holds moisture.

Crushed charcoal 3

Crushed charcoal: filters the water and keeps things fresh.

Sand and ash 4

Sand and ash: a fine barrier between the lower and upper layers.

Dirt 5

Dirt: a middle layer with some organic content.

Soil 6

Soil: the top layer, where the plants are rooted.

Side view of the layers

Side view of the jar showing the layers

A side view of the finished base shows each layer clearly through the glass.

Lid, Lighting & Ventilation

The lid does a lot of work in this build. It holds the lighting, allows air to move, and gives you a way to water the terrarium without opening it again once it's sealed.

The jar lid with holes and LED configuration

The lid has eight small holes drilled through it.

Seven of those holes are used for ventilation and for adding water. The eighth hole is larger, and is used to feed the LED strip cables through the top of the lid. Once the cables are in place, a small drop of super glue seals the hole so the enclosure stays airtight. A small square of translucent plastic is also glued in front of the LEDs as a light diffuser: without it the LEDs look harsh and pinpoint, but the diffuser spreads the light evenly so the inside of the jar feels lit by a soft, ambient source rather than two bright dots.

Polyester fabric layer

A thin layer of breathable fabric is placed under the lid before sealing.

Before closing the jar for good, a thin layer of fabric is laid across the opening. This lets humid air and excess moisture slowly escape through the tiny holes in the lid, which keeps the terrarium from rotting while still staying mostly closed. Once the lid is screwed on, any excess fabric sticking out around the rim can be trimmed off with scissors for a cleaner finish.

Watering with a syringe

Water is added through the small holes in the lid with a syringe.

Once sealed, the terrarium almost takes care of itself. When it does need a small top-up, a syringe slides through one of the tiny holes in the lid, so the jar can be watered without ever being reopened.

Lighting Concept

Demo of the day and night light cycle

Sunrise, daylight, sunset, and night, all simulated by two LEDs.

The lighting system uses just two LEDs, but the effect is surprisingly convincing. A 24-hour cycle is divided into 96 steps (one every 15 minutes), which lets the color and brightness drift smoothly from sunrise, through midday, into sunset, and then through the night. The GIF above is a sped-up demo made from a shortened version of the code for illustration; the real code runs the full 96-step cycle over 24 hours.

Demo of the moon phase simulation

The moon phases are approximated by balancing the brightness of the left and right LEDs.

At night, the two LEDs simulate the phases of the moon. A full moon lights both sides evenly; a waxing moon is brighter on the right, a waning moon brighter on the left, and a new moon goes dark. It's intentionally simplified: with only two LEDs the goal isn't astronomical accuracy, just a clean, readable visual effect for a very small space. This GIF is also a sped-up demo; in the actual build each phase lasts around a week, following the real lunar cycle.

Moon phases in the northern and southern hemispheres

Moon phases as seen from the northern and southern hemispheres. Source: The Open University.