Step 0 – Pre-build Overview
MATERIALS: 1 x BBC micro:bit, 1 x Micro USB cable,
1 x Breakout board, 1 x Mini buzzer, 1 x OLED,
1 x Moisture sensor, 2 x Female-Female wires
- Get to know the buzzer, OLED and moisture sensor
- Make something with a moisture sensor
Step 1 – Components
Step 2 – Pre-coding
Note: If you get a warning telling you some packages will be removed because of incompatibility issues, either follow the prompts or create a new project in the Projects file menu.
Step 3 – Coding
When the moisture sensor value is less than 50, this indicates that there is not enough water in the pot. As a result, the buzzer will sound and the OLED will display the message “Water your plant!”. Or else, if the moisture sensor value is larger than 50, the buzzer will not sound and the OLED will display the message “Your plant is in good condition”.