Low-Water Alarm for Hydroponics


In a hydroponics system, water is added to a reservoir, which is absorbed by plant roots to grow healthy plants. If the water level gets too low, the roots of the plant can’t reach the water.
Let’s create a signal to notify us when the water level of our reservoir needs to be refilled.
This hydroponics project will:
- use the float sensor to detect water levels
- make a noise when the water level drops

Prepare
You’ll need the following items to complete this project:
- Smart Hydroponics Kit
- micro:bit V2
- Computer with access to Microsoft MakeCode
- Water
Build
First, let’s assemble our Low-Water Alarm 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 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 Low-Water Alarm.
- 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 project works, then try testing it in real life.
Improve
Think about any visual cues to add to your Low-Water Alarm! How would you modify the sample code provided, or create your own code that includes the following features?
- An icon on the micro:bit display when the water is low
- A timer to display how long the water has been low
Related Content
Feeling Stuck? Explore the Knowledge Base for common questions and troubleshooting tips.