# Adafruit Bonsai Buckaroo

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/089/202/medium800/sensors_BB_top_angle.jpg?1584035096)

We can’t wait for spring to arrive, and we’re looking forward to caring for some plants! We designed this little add-on for [micro:bit](https://www.adafruit.com/category/1009)or **[CLUE](http://www.adafruit.com/clue)** boards – bolt it on with 5 screws to get a buzzer/beeper, motor driver, and breakouts for connecting a [soil sensor](https://www.adafruit.com/?q=soil%20sensor) (two alligator clips + nails work just fine).&nbsp;Simple, but effective!

![](https://cdn-learn.adafruit.com/assets/assets/000/089/203/medium800/sensors_BB_top_screws.jpg?1584035106)

- **8mm Buzzer/Speaker on pin P0** - have your plant kit beep when it wants watering, or have it sing a song when its nice and happy.
- **3V Motor control (on/off) on pin P2** - connect to a water pump to automatically water dry plants
- **Alligator clip pads for pin P1, 3V and GND** - connect to two alligator clips and nails to measure soil resistance

![](https://cdn-learn.adafruit.com/assets/assets/000/089/204/medium800/sensors_BB_bottom.jpg?1584035125)

Works with micro:bit in Arduino, MicroPython or MakeCode. For CLUE, you can use CircuitPython or Arduino.

![](https://cdn-learn.adafruit.com/assets/assets/000/089/205/medium800/sensors_BB_with_plant.jpg?1584035163)

# Adafruit Bonsai Buckaroo

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/089/224/medium800/sensors_BB_top.jpg?1584045802)

The Bonsai Buckaroo is designed to add a speaker, motor terminal, and pins for connecting a soil sensor to your micro:bit or CLUE board. Let's take a look!

Along the top are the **mount points**. The Bonsai Buckaroo ships with screws for attaching to your micro:bit or CLUE.

![sensors_BB_pinouts_mount_points.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/226/medium640/sensors_BB_pinouts_mount_points.jpg?1584045818)

On the left side is the **speaker**. Use it to have your plant kit beep when it wants watering, or have it sing a song when it's nice and happy.

![sensors_BB_pinouts_speaker.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/227/medium640/sensors_BB_pinouts_speaker.jpg?1584045898)

On the right is the **3V Motor control (on/off) on pin P2**. Connect to a water pump to automatically water dry plants. The 3V connector (typically the red wire) goes into the part of the controller terminal towards the top, and the ground (typically the black wire) goes to the part of the controller terminal towards the bottom (by the 3V MOTOR label). However, for our pumps, it does not really matter which way you put the wires in

![sensors_BB_pinouts_motor_terminal.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/228/medium640/sensors_BB_pinouts_motor_terminal.jpg?1584045919)

In the center are the **Alligator clip pads for pin P1, 3V and GND**. Connect to two alligator clips and nails to measure soil resistance as shown on the next pages

![sensors_BB_pinouts_pins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/229/medium640/sensors_BB_pinouts_pins.jpg?1584045987)

 **Watermelon**

We'll tell you about it later.

![sensors_BB_pinouts_watermelon.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/594/medium640/sensors_BB_pinouts_watermelon.jpg?1584646117)

# Adafruit Bonsai Buckaroo

## CLUE and CircuitPython Usage

![](https://cdn-learn.adafruit.com/assets/assets/000/089/590/medium800/sensors_Bonsai_Buckaroo_CLUE.jpg?1584642255)

It's easy to use the Adafruit Bonsai Buckaroo with CircuitPython. This example uses the [Adafruit CircuitPython CLUE](https://github.com/adafruit/Adafruit_CircuitPython_CLUE) library to display soil moisture level and the status of the pump motor on the CLUE display. Connect your Bonsai Buckaroo to your CLUE, and connect the motor and plant to the Bonsai Buckaroo, and you're on your way to automatic plant care. Let's take a look!

# Wiring up your Bonsai Buckaroo

For this project, you'll need a Bonsai Buckaroo, a CLUE, a water pump, some tubing, alligator clips, and two nails (or something else conductive will work too!). It's super simple to connect them up.

- Mount the **Bonsai Buckaroo** to the **CLUE** using the **included mounting hardware.**
- Connect the **red wire of the water pump** to the **top of the motor controller terminal**.
- Connect the **black wire of the water pump** to the **bottom of the motor controller terminal**.
- Connect **an alligator clip** to the **3V pad on the Bonsai Buckaroo**.
- Connect **an alligator clip** to the **PIN#1 pad of the Bonsai Buckaroo**.
- Connect **the other end of the alligator clip wires** to **nails** stuck into the soil of your plant.
- Connect **the tubing** to **the water pump**
- Place **the other end of the tubing** in **the soil**  **of the plant**.

![sensors_Bonsai_Buckaroo_CLUE_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/583/medium640/sensors_Bonsai_Buckaroo_CLUE_bb.jpg?1584630352)

## Wire the Pump Driver Terminal

The Bonsai Buckaroo terminal connectors are spring-loaded press-fit connectors. Push down on one tab to separate the internal connector a bit and then push in the wire. Release the pressure on the tab and the terminal will grip the wire.

Repeat for the second terminal.

![sensors_bonsaiwiring.gif](https://cdn-learn.adafruit.com/assets/assets/000/093/632/medium640thumb/sensors_bonsaiwiring.jpg?1596150357)

The image at the top of the page shows the CLUE connected to a AA battery pack. If you find that battery pack isn't lasting long enough for your needs, consider using a larger battery, or using a USB cable plugged into the wall to provide longer usage.

# Installing CircuitPython Libraries

The Adafruit CircuitPython CLUE library requires a number of other libraries to work. Please follow the instructions on the [CLUE CircuitPython Libraries](https://learn.adafruit.com/adafruit-clue/clue-circuitpython-libraries) page to ensure you have all the necessary libraries installed.

Before continuing, ensure that your **lib** folder looks like the one in the CLUE guide Libraries page!

# Bonsai Buckaroo Plant Care Helper

Save the following as **code.py** on your **CIRCUITPY** drive.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Bonsai_Buckaroo/code.py

![](https://cdn-learn.adafruit.com/assets/assets/000/089/591/medium800/sensors_Bonsai_Buckaroo_CLUE_display.jpg?1584642270)

Let's take a look at the code.

First we import all the necessary libraries, and turn off the NeoPixel on the back of the board.

Next we set up the motor on Pin 2, and setup Pin 1 as an analog pin.

Then we have a helper function designed to read an analog pin, and take a number of readings over a given period of time.

The last thing we do before the loop is set up to display text on the CLUE display using the CLUE library, with the title "CLUE Plant".

Inside the loop, we first use the helper function to take 100 readings and average them. Then we use that average to calculate a percentage, and display that percentage. We also print the average and percentage to the serial console.

If the percentage is less than 50, we turn on the motor and display "Motor ON" in green, and then pause for 0.5 seconds.

Otherwise, we turn the motor off and display "Motor OFF" in red.

That's all there is to automated plant care using CircuitPython, the Bonsai Buckaroo, and CLUE!

# Adafruit Bonsai Buckaroo

## micro:bit and MakeCode Usage

![](https://cdn-learn.adafruit.com/assets/assets/000/093/630/medium800/sensors_micro-bit_bar_graph2.jpg?1596144671)

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&nbsp;[https://learn.adafruit.com/makecode](https://learn.adafruit.com/makecode "MakeCode Tutorial").

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.

[Open the Bonsai Buckaroo Plant Care program in MakeCode](https://makecode.microbit.org/_Pzv1XjgRu56k)
Your MakeCode screen should have the following MakeCode program loaded.

![](https://cdn-learn.adafruit.com/assets/assets/000/089/562/medium800/sensors_Bonsai_Buckaroo_micro-bit_makecode.png?1584564383)

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!

![](https://cdn-learn.adafruit.com/assets/assets/000/093/631/medium800/sensors_micro-bit_bar_graph3.jpg?1596144862)

# Adafruit Bonsai Buckaroo

## Downloads

## Files

- [Fritzing object in Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20Bonsai%20Buckaroo.fzpz)
- [EagleCAD files on GitHub](https://github.com/adafruit/Adafruit-Bonsai-Buckaroo-PCB)

# Schematic
![](https://cdn-learn.adafruit.com/assets/assets/000/089/592/medium800/sensors_Bonsai_Buckaroo_sch.png?1584643227)

# Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/089/601/medium800/sensors_Bonsai_Buckaroo_fab_print.png?1584715584)


## Primary Products

### Adafruit Bonsai Buckaroo - micro:bit & CLUE Plant Care Helper

[Adafruit Bonsai Buckaroo - micro:bit & CLUE Plant Care Helper](https://www.adafruit.com/product/4534)
We can’t wait for spring to arrive, and we’re looking forward to caring for some plants! We designed this little add-on for [micro:bit](https://www.adafruit.com/category/1009)or **[CLUE](http://www.adafruit.com/clue)** boards – bolt it on...

In Stock
[Buy Now](https://www.adafruit.com/product/4534)
[Related Guides to the Product](https://learn.adafruit.com/products/4534/guides)

## Featured Products

### Small Alligator Clip Test Lead (set of 6)

[Small Alligator Clip Test Lead (set of 6)](https://www.adafruit.com/product/4100)
Connect this to that without soldering using these small&nbsp;alligator clip test leads. 18" long cables with color-coded alligator clips on both ends. You get 6 pieces in 6 unique colors. Strong and grippy, these always come in handy! We often use these in conjunction with a multimeter...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4100)
[Related Guides to the Product](https://learn.adafruit.com/products/4100/guides)
### Adafruit CLUE - nRF52840 Express with Bluetooth® LE

[Adafruit CLUE - nRF52840 Express with Bluetooth® LE](https://www.adafruit.com/product/4500)
Do you feel like you just don't have a CLUE? Well, we can help with that - get a CLUE here at Adafruit by picking up this sensor-packed development board. We wanted to build some projects that have a small screen and a lot of sensors. To make it compatible with existing projects, we made...

In Stock
[Buy Now](https://www.adafruit.com/product/4500)
[Related Guides to the Product](https://learn.adafruit.com/products/4500/guides)
### BBC micro:bit

[BBC micro:bit](https://www.adafruit.com/product/3530)
The British Invasion is here! No, not music...microcontrollers! New to the USA is the newest and _easiest_ way to learn programming and electronics - the **BBC micro:bit**.

Designed specifically for kids and beginners, the&nbsp; **micro:bit** &nbsp;is a...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3530)
[Related Guides to the Product](https://learn.adafruit.com/products/3530/guides)
### Submersible 3V DC Water Pump with 1 Meter Wire - Horizontal Type

[Submersible 3V DC Water Pump with 1 Meter Wire - Horizontal Type](https://www.adafruit.com/product/4546)
Make fountains or plant-watering projects with this submersible water pump. It's great for beginner projects and super easy to use! The pump is basically a DC motor that is powered with 3V and draws 100mA. When powered, the pump sucks water in from the side of the plastic casing and pushes...

In Stock
[Buy Now](https://www.adafruit.com/product/4546)
[Related Guides to the Product](https://learn.adafruit.com/products/4546/guides)
### Submersible 3V DC Water Pump - 1 Meter Vertical Type

[Submersible 3V DC Water Pump - 1 Meter Vertical Type](https://www.adafruit.com/product/4547)
Make fountains or plant-watering projects with this submersible water pump. It's great for beginner projects and super easy to use! The pump is basically a DC motor that is powered with 3V and draws 100mA. When powered, the pump sucks water in from the side of the plastic casing and pushes...

In Stock
[Buy Now](https://www.adafruit.com/product/4547)
[Related Guides to the Product](https://learn.adafruit.com/products/4547/guides)
### Tubing for Submersible Pumps - PVC 6mm ID - 1 Meter Long

[Tubing for Submersible Pumps - PVC 6mm ID - 1 Meter Long](https://www.adafruit.com/product/4545)
This tubing is designed to go with our simple submersible pumps. Great for making water-powered projects. This tubing seems to be made of PVC, it's definitely not food safe, we recommend it for use with plant-watering or fountain projects only. It's super easy to cut and you get a full...

In Stock
[Buy Now](https://www.adafruit.com/product/4545)
[Related Guides to the Product](https://learn.adafruit.com/products/4545/guides)

## Related Guides

- [Introducing Adafruit CLUE](https://learn.adafruit.com/adafruit-clue.md)
- [CLUE Text Telephone Transmitter](https://learn.adafruit.com/clue-teletype-transmitter.md)
- [No-Touch Hand Wash Timer for Circuit Playground Express and CLUE](https://learn.adafruit.com/no-touch-hand-wash-timer-for-cpx-and-clue.md)
- [A colorful CLUE slideshow purse with Bright Wearables](https://learn.adafruit.com/a-colorful-clue-slideshow-purse.md)
- [Yoga Pose Chime](https://learn.adafruit.com/yoga-pose-chime.md)
- [CLUE Vertical Garden Weather Visualizer](https://learn.adafruit.com/clue-vertical-garden-weather-visualizer.md)
- [How to Fuse Motion Sensor Data into AHRS Orientation (Euler/Quaternions)](https://learn.adafruit.com/how-to-fuse-motion-sensor-data-into-ahrs-orientation-euler-quaternions.md)
- [Digital Nose Milk Freshness Checker](https://learn.adafruit.com/digital-nose-gas-sensor-milk-freshness-checker.md)
- [BLE Thermal "Cat" Printer with CircuitPython](https://learn.adafruit.com/ble-thermal-cat-printer-with-circuitpython.md)
- [Frozen-Inspired Animated Pendant with Temperature Sensing](https://learn.adafruit.com/frozen-gizmo-pendant-with-temperature-sensing.md)
- [Chauncey the Flower Care Bot with CLUE and Bonsai Buckaroo](https://learn.adafruit.com/chauncey-flower-watering-bot-clue.md)
- [Welcome to CircuitPython!](https://learn.adafruit.com/welcome-to-circuitpython.md)
- [Clue And MagTag Pep Talk Generator](https://learn.adafruit.com/clue-and-magtag-pep-talk-generator.md)
- [CLUE Sensor Plotter in CircuitPython](https://learn.adafruit.com/clue-sensor-plotter-circuitpython.md)
- [CLUE Light Paint Stick with CircuitPython](https://learn.adafruit.com/clue-light-paintstick.md)
- [AdaBox 015](https://learn.adafruit.com/adabox015.md)
