
IN OUR previous 10-week “How to be a maker” series, we went on a tour of the basics, culminating in building an autonomous biscuit-fetching robot. If you missed it, you can catch up online at the address below.
This second series will explore some practical applications of the skills you learned and help you get in touch with plants, wildlife and the great outdoors. Projects will range from a tweeting wildlife camera to a pest-resistant bird feeder. Whether your outdoors is a window box or a wildlife reserve, there will be something for you.
Advertisement
To start off, we are going to enable plants to communicate. My spider plant Marvin is delighted, although he might not look it from the picture.
For this project, you need a soil moisture sensor. It will have two legs with metal strips down the middle. The sensor works by passing a current through the soil between the legs and seeing how much resistance there is to its flow. The more water there is, the lower the resistance. That lets us estimate how wet the soil is.
Using the crocodile clips and jumper wires, attach the sensor’s “gnd” wire to the micro:bit’s ground, its “vcc” to the 3V pin and its “ao” (analogue out) to pin 0. Then, go to the online micro:bit MakeCode editor to create a program. From the “Basic” menu on the left, grab a “show number” block, then put it in “forever”. Next, from the “Pins” menu (under “Advanced”), take an “analogue read pin p0” and clip it in “show number”. Now you have a simple program to display the sensor output. Download it to the micro:bit and attach its battery.
Time for an experiment. Poke your sensor into some dry soil and note the reading, then do the same for freshly watered soil. I got around 1000 for the dry soil and 400 for the wet. Between these extremes, pick a number that you think represents when your plant might be thirsty. I chose 800.
Back in the editor, grab an “if <> then else” from the “Logic” menu and clip it into “forever”. Next, take a “0<0” comparison from the same menu, change the “<” to “>” and clip the comparison over the default “true”. Clip another “analogue read pin p0” over the first 0, then change the second 0 to your threshold.
Find “show icon” in “Basic” and nestle it in the if block, picking the sad face icon from the drop-down list. In the else part, add another “show icon” with a happy face.
And just like that, your plant can pull faces! It will look miserable when thirsty and smile when satisfied. Remember, though, plants’ thresholds can change. A cactus needs to stay dry in winter, for example.
Next week, we will get to know our plants better by improving their communication skills.
To download a printable version of this page click here
New stuff you need
BBC micro:bit starter kit (the same one we used in the first “How to be a maker” series)
Soil moisture sensor
Crocodile clips
Jumper wires
Next in the series
1 Moisture-sensing plant
2 Moisture and temperature-sensing plant
3 Plant auto-waterer
4 Tweeting wildlife cam
5 Pest scarer
6 BBQ thermometer
7 Rain alarm
8 Mini weather station
9 Remote controlled pest-proof bird feeder part 1
10 Remote controlled pest-proof bird feeder part 2