Lesson 4 – Measuring Moisture/Water Levels with the Micro:bit
Lesson 4 was a dedicated lesson with our Year 6 (Swallows Class) student and we spent the day designing and building different projects based on the theme of water.
The students were given a choice of sensors to use – either a water level/rain sensor or a water level/soil moisture sensor and asked to produce an ‘advert’ for a product that they would like to build.
The students came up with some amazing ideas!
- An Alarm to warn when a paddling pool or bath is full
- An method of warning when a horses drinking trough is empty
- A weather/rain detector so that you can decide what to wear in the morning
- An automated plant watering system
We started by connecting our sensors to our BBC micro:bit’s and using some simple code to read the values from the sensor when a button was pressed. We could then ‘calibrate’ our sensors by writing down the values shown when they were put in water (to different depths) and soil (with differing moisture content).
Armed with a table of the different values our sensors provided we were able to use simple IF statements to then decide what to do as the sensor readings increased (or decreased depending on each students project idea).
Once we had the basics down then the students were able to use more complex IF statements using AND logic to measure the lower/higher boundaries of each sensor level & we even managed to use the PXT radio blocks to send our alarm warnings to another micro:bit so that our alarms were ‘remote’. The remote alarms were tested over quite some distance!
The lesson was a great experience for the students who all really enjoyed the lesson! We plan to include one of each sensor on the outside of our space payload so that we can monitor any moisture levels during the ascent/descent & we’re looking forward to then analysing that data. The sensors were about £1 each from a well known auction site and I’d encourage anyone to give them a try!