This example uses the Bonsai Buckaroo, the micro:bit, and Microsoft MakeCode to create an automatic plant care system.

If you are new to Microsoft MakeCode, Adafruit has an excellent getting started tutorial at https://learn.adafruit.com/makecode.

This project requires:

  • Bonsai Buckaroo
  • micro:bit
  • water pump
  • two alligator clips and two nails (or other conductive materials work as well).

Wire up the parts the same way as the previous page, substituting the micro:bit for the CLUE.

The following is a short program. It reads the value from Pin 1, plots a graph on the micro:bit, and displays the soil moisture value when pressing button A. If the moisture level drops below 50%, it turns on the motor for 0.5 seconds, and then turns it off.

Your MakeCode screen should have the following MakeCode program loaded.

The program starts off with a little song. Then it begins checking the analog reading on Pin 1, and plots a bar graph on the LED array of the values. If you press button A, the LED array shows the actual reading.

If the reading drops below 500 (50%), it plays a tone, turns on the motor for 0.5 seconds, and turns it off. This repeats until the reading rises above 500.

That's all there is to plant care with Bonsai Buckaroo, micro:bit and MakeCode!

This guide was first published on Mar 19, 2020. It was last updated on Mar 19, 2020.

This page (micro:bit and MakeCode Usage) was last updated on Nov 06, 2020.