micro:bit for Moonhack

Code Club Australia
Code Club Australia
3 min readApr 22, 2020

--

*Don’t forget to register your participation in Moonhack to be counted in our final numbers!*

We all need water to survive, and so do our plants! Build your own moisture sensor to let you know when your houseplant needs some TLC!

This amazing Moonhack project was created with the help of our wonderful Melbourne based Code Club volunteer Justaboutfine!

This is our only project that requires hardware, so check it out early if you want to get your club involved. Local Australian small businesses Small Devices and Core Electronics are great places to buy the few things you need. You only need a micro:bit and a moisture sensor. (The alligator leads are for the optional extra challenge). There’s also an extra, extra challenge at the end of this blog that you’ll need some hardware for too!

Competition Time!

We’re hosting a competition as part of this micro:bit challenge! All you have to do is tag us on social media (@codeclubaus) if you’re planning on completing this project! Our favourite post will win an education pack of micro:bits and moisture sensors for their club, school or library! (Check the Terms and Conditions here)

Getting Started

The micro:bit is a pocket sized computer perfect for beginners to physical computing. It’s got 25 LED lights, two programmable buttons and can be coded using drag and drop blocks or python!

Check out these videos for more info –
National Geographic
BBC Kids

What’s Next?

You’ve completed this project, what next?

- Check out the Code Club MicroBit projects, most don’t require hardware, and build something cool! A Fortune Teller, a timing challenge?

- Teachers, don’t miss out blog post all about Curriculum extensions for the Moonhack projects here. (LINK)

Advanced Challenge:

What do you do when your plants needs watering? Build an automatic pump!
If you’re looking for an extra challenge, the instructions are below –

What you’ll need:

1 x MonkMakes micro:bit relay module
1 x Submersible pump and 30cm of transparent hose
1 x Disposable water bottle, with the top cut off

We can use a pump to add water from a large container when the soil is dry. See the following picture to rewire your micro:bit with a pump and reconnect the sensor to the 3V Pin. The submersible pump can now be powered from the micro:bit’s pin2 — just be sure to have the pump below the top of the plant, so it doesn’t keep flowing when the pump stops (siphon).

Although we’ve powered the pump directly from a pin, it’s useful to know how a relay works — as it will allow us to control devices that use more power than our micro:bit can provide. A relay is just a switch that is operated by an electronic signal. In the diagram below, pin0 is connected ‘IN’ on the relay. Set pin0 to 1 (high) to turn on the pump.

Using what we learned, it is also possible to add a temperature sensor, and have the relay drive a servo motor, to give our plant shade during the day. Be careful to only connect battery-operated devices to your relay. Now that you can read sensors and control other hardware devices from your BBC micro:bit, you’re on your way to solving more real problems using coding and hardware!

Moonhack takes place between May 25–31 in 2020 and it’s open to everyone! Register your class or school to participate at moonhack.com

--

--

Code Club Australia
Code Club Australia

Code Club Australia is a nationwide network of free coding clubs for children aged 8–13. https://codeclubau.org/