From worm bin to smart farm: what children learn from insects, soil and a few sensors
A worm bin is one of the few science projects that is alive, smells of nothing when it is working, and gives something back. Add a sensor or two and it becomes something more: a small farm your child can measure, understand and start to automate.

Why insects are worth a child’s attention
Singapore imports more than 90% of its food, so growing more of it here, in very little space, matters. Insects are part of how that can work in a small, crowded place: they need almost no land, and many of them grow on what we throw away.
That is the idea children grasp fastest when they see it: food waste goes in, something useful comes out. Mealworms and black soldier fly larvae turn scraps into protein for animal feed. Earthworms turn kitchen peelings into compost. The droppings they leave behind (called frass) feed plants. Nothing in the loop is rubbish for long, which is the whole point of a circular economy.

How a worm bin works
Composting worms (usually red wigglers or African nightcrawlers, not garden earthworms) live in the top layer of a bin of damp bedding: shredded cardboard, coconut coir or old compost. You bury a handful of chopped fruit and vegetable scraps, the worms and the microbes around them break it down, and a few weeks later the bottom of the bin is dark, crumbly vermicompost.
Worms need three things to be right, and all three are things a child can check. Moisture: the bedding should feel like a wrung-out sponge. Temperature: shade, never direct sun; a bin that cooks in the afternoon heat on a balcony will lose its worms. Food: small amounts, buried, and no meat, dairy, oil, citrus or onion. Most problems with a smelly bin come down to too much food or too much water.

Turning it into a science project
“Is the bin too wet?” is a guess. A reading is evidence. This is where a micro:bit earns its place: the board has a temperature sensor and a light sensor built in, and a soil moisture sensor costs a few dollars and clips on with three wires (the same sensor in our plant monitor guide).
A good first experiment: take readings in the worm bin, in a pot of garden soil and in a cup of dry soil, and write them down side by side. Then ask the question that turns data into understanding: what does each creature need, and how would you know if it wasn’t getting it? Worms, mealworms and a basil plant all give different answers.
On a micro:bit V2, MakeCode’s data logger can record a reading every few minutes for days. Leave it in the bin over a weekend and you have a graph of what actually happened at night, after watering and in the afternoon heat, rather than what everyone assumed.
From measuring to looking after itself
Once a child trusts their readings, the next step is to make the micro:bit do something with them. This is where a worm bin turns into a smart farm, and every step is a project of its own:
A worm bin monitor that shows a happy face when the bin is right, and a warning when it is too dry, wet or warm.
A self-watering garden bed for the plants the compost feeds: when the soil reads dry, a servo or a small pump (driven through a motor board, never straight from a pin) waters it.
A water tank alarm that uses a water level sensor to warn before the garden’s supply runs out.
A garden guard that uses an ultrasonic distance sensor to notice birds or pets coming close and raise a little flag.
None of these needs to be perfect. A prototype that works most of the time, and a child who can explain why it sometimes doesn’t, is a better outcome than a polished kit build.

How to help without taking over
Let your child be the one who decides what “too dry” means. Whatever number they pick, the worms will tell you within a week whether it was right, and changing it is a better lesson than getting it right first time.
And keep the bin somewhere it gets looked at. A worm bin by the kitchen door gets fed, checked and argued about. One at the back of the storeroom quietly dries out.
Common questions
+Is it safe for children to handle worms and mealworms?
Yes, with ordinary care. Composting worms and mealworms don’t bite or sting. Handle them gently with damp hands, keep them out of the sun, and wash hands with soap afterwards, as you would after gardening.
+Will a worm bin smell?
A healthy bin smells of damp earth. A sour or rotten smell almost always means too much food or too much water: stop feeding for a week, add dry shredded cardboard, and the bin usually recovers.
+Which micro:bit sensors are built in, and which do I need to add?
The micro:bit has built-in temperature, light, sound (V2), motion and compass sensors. Soil moisture, water level and distance need an external sensor connected to its pins, usually through a breakout board.
+What age is this right for?
Looking after a worm bin works from about 5. Reading a sensor with an adult’s help works from about 6; choosing thresholds, logging data and automating a response suits ages 8 to 12, and older children can take it much further.
Written by the Code Gakko team. Where this guide describes MOE policy or a competition, please treat the organisation’s own site as the authority — details change from year to year.



