Resources — moisture sensor
Program a micro:bit with Python to Control a Water Pump
BBC microbit Kitronik microbit plant microbit tutorials moisture sensor pump python soil moisture
In this project, you will learn:
- how a relay works;
- how to use code to control a relay to turn a water pump on and off; and
- how to automate the pump based on sensor readings.
You will need:
- To have completed our previous tutorial for calibrating a moisture sensor, with the following:
- a micro:bit, computer with mu editor Thonny editor, and microUSB cable for programming the micro:bit
- a moisture sensor
Additional hardware required for this tutorial:
- 1 x submersible pump and hose to fit
- 1 x MonkMakes relay
- 5 x crocodile leads to connect everything up
- 1 x old water bottle or similar container to hold water
Use Python to calibrate your Kitronik Prong Moisture Sensor
BBC microbit Kitronik MicroPython moisture sensor mu editor Thonny
In this tutorial, you'll learn to:
- Use Python to read the output from a moisture sensor
- Use mu or Thonny editors to debug your micro:bit code
- Calibrate your code to detect the right amount of moisture