Auto-Refill Hydroponics Reservoir

In a hydroponics system, water is used instead of dirt to help plants grow. Over time, water evaporates or gets absorbed by plant leaves. We can automate our hydroponics system using a container of water to refill the reservoir automatically!
Let’s create an Auto-Refill Tank for our hydroponics system.
This hydroponics project will:
- use a float sensor to detect water levels
- refill the hydroponics reservoir using the peristaltic pump
- display an icon when the water reservoir is full

Prepare
You’ll need the following items to complete this project:
- Smart Hydroponics Kit
- micro:bit V2
- Computer with access to Microsoft MakeCode
- Water
- Large waterproof container
Build
First, let’s assemble our Auto-Refilling System using the building blocks and sensors from the Smart Hydroponics Kit:
As you build, think about the placement of your breakout board and the type of audio or visual cues you may wish to add to your project.
Remember to plug your breakout board battery into a power source using a micro USB cable if using your project for more than a day at a time.
Code
Explore the code below to get started using your Auto-Refill Tank.
- Connect your project to the computer and download the starter code to make it work!
- Review the code comments on each block to learn about how your traffic light works, then try testing it in real life.
Improve
Think about accessible features to add to your project! How would you modify the sample code provided, or create your own code that includes the following features?
- A counter to track how many times the water has been refilled
- A noise or LED ring signal when the water level drops
Related Content
Feeling Stuck? Explore the Knowledge Base for common questions and troubleshooting tips.