Maker Pro
Custom

Automatic BLE Plant Watering with rhT Sensor, BleuIO and CircuitPython

SS
December 01, 2026 by Sheikh Shuhad
Share
banner

In this tutorial a Cytron MOTION 2350 Pro listens to a SondeAir rhT temperature and humidity sensor over Bluetooth Low Energy. When the air is warm and dry, the board runs a small water pump for a few seconds. The board’s RP2350 has no Bluetooth radio of its own, so a BleuIO dongle in its USB-A host port does the listening.

In this tutorial a Cytron MOTION 2350 Pro listens to a SondeAir rhT temperature and humidity sensor over Bluetooth Low Energy. When the air is warm and dry, the board runs a small water pump for a few seconds. The board’s RP2350 has no Bluetooth radio of its own, so a BleuIO dongle in its USB-A host port does the listening. The program is written in CircuitPython and talks to BleuIO with ordinary AT commands.

The sensor is never paired or connected to. It sends its readings in its advertisements, and the board only has to hear them. Once the code is on the board, no computer or Wi-Fi is needed.

This project builds on our earlier tutorial, Scanning HibouAir Sensors with CircuitPython, BleuIO and the Cytron MOTION 2350 Pro. The USB host set-up and the way the program talks to BleuIO are the same, and are only summarised here.

The sensor measures the air, not the soil. Warm, dry air does not prove that a plant needs water. Treat this project as a demonstration to watch, not as an irrigation system to leave alone. A soil moisture sensor is the right input for unattended watering.

Requirements

Hardware

Software

With circup installed on your computer, one command copies both:

circup install asyncio

Everything else the program uses is built into CircuitPython: usb_host, usb.core, pwmio, digitalio, watchdog, microcontroller, supervisor, json, binascii and time. No boot.py is needed.

What Does This Project Do?

1. The board starts BleuIO

As in the earlier tutorial, the program starts the USB-A host port with usb_host.Port on GPIO24 and GPIO25, waits for BleuIO (vendor ID 0x2DCF, product ID 0x6002), and sets DTR and RTS so that the dongle starts to send. It stops any scan left running from an earlier run with Ctrl-C, discards what the dongle still had queued, and then sends:

  • ATE0, which turns echo off
  • ATV1, which turns verbose mode on, so every reply is one line of JSON
  • AT+CENTRAL, which puts the dongle in the central role. Scanning needs it. The standard BleuIO starts as a peripheral and refuses to scan with the error Wrong GAP role or Advertising until it is told. BleuIO Pro accepts the command too. A dongle that is already central answers already done, which the program also takes as success.

The program finds the dongle again before every scan, so a dongle that is unplugged and put back, or swapped for another BleuIO, is picked up within about 15 seconds without a restart.

2. BleuIO scans for the rhT sensor only

AT+FINDSCANDATA=FF5B0707

SondeAir sensors are made by Smart Sensor Devices, the maker of HibouAir, and share its company ID, 0x075B. In an advertisement that appears as FF, the AD type for manufacturer-specific data, followed by 5B 07. The next byte is the beacon type, and the rhT sensor’s is 0x07. So FF5B0707 lets the rhT sensor through and nothing else. HibouAir’s readings use beacon type 0x05, so HibouAir sensors nearby do not get in the way.

3. The board decodes the advertisement

Counting from the company ID, the rhT sensor’s manufacturer data holds:

Take the manufacturer data 5B070702A1A2A3F709133FE801 as an example. The sensor ID is A1A2A3. The temperature bytes F7 09 are 0x09F7, or 2551, which is 25.51 °C. The humidity bytes 13 3F are 19 and 63, which is 19.63 %RH.

A reading must also make sense before it counts: between −40 and 85 °C, and between 0 and 100 %RH. A garbled reading must never start the pump.

4. The board decides whether to water

Once a second the program looks at the latest reading and waters only when all of these hold:

  • The reading is fresh, no older than 30 seconds.
  • The temperature is above 28 °C and the humidity below 40 %RH.
  • Both have held for 10 seconds, over at least three readings, so a single odd reading does not water.
  • The last run started at least 30 minutes ago.
  • There have been fewer than six runs in the last 24 hours.

A run lasts three seconds. The program records the run before the pump starts, so that nothing going wrong after that can skip the cooldown.

5. The pump runs on motor channel M1

The MOTION 2350 Pro has four DC motor drivers, controlled from GP8 to GP15, which CircuitPython names board.M1A to board.M4B. The pump is connected to the M1 terminals. The program drives M1A with PWM and holds M1B low, so the duty cycle sets the average voltage the pump sees. With PUMP_DUTY = 1.0 the pump gets the full motor supply. If the supply is higher than the pump’s rating, lower it: 6 V from a 9 V supply is a duty of 0.66.

Keeping the Pump From Running On

A pump that does not stop floods the floor, so the program has several separate ways to make sure it stops:

  • Off from the first moment. The pump pins are set up and switched off before anything else, before the program waits for BleuIO.
  • A deadline, not a sleep. Each run has an end time, and a short loop switches the pump off when that time comes. Nothing else has to finish first.
  • A watchdog. The same loop feeds the RP2350’s hardware watchdog. If the program hangs, the watchdog restarts the board within eight seconds, and after a restart the pump pins come up off.
  • A record in flash. While the pump runs, the program sets a flag in the board’s non-volatile memory and clears it when the run ends. If the board starts with the flag set, a run was cut short by a restart, and the program waits a full cooldown before it waters again. A fault that restarts the board over and over therefore cannot water on every start.
  • Errors stop the pump. An unexpected error switches the pump off, and the program starts again after five seconds.

Ctrl-C at the console also switches the pump off. When code.py has ended, CircuitPython stops the watchdog itself, so the REPL can be used as usual.

Testing at Your Desk

Indoors in winter the air is often dry but seldom above 28 °C, so the default settings may never water. Two ways to see it work:

  • Change TEMP_ABOVE_C and RH_BELOW_PCT to values your room reaches.
  • Hold a hairdryer near the sensor. It raises the temperature and lowers the humidity at the same time, which meets both conditions. Keep the sensor, the board and the hairdryer well away from the water.

For quick tests, shorten COOLDOWN_S too, and put it back afterwards.

How We Tested It

The tests below were run with a BleuIO Pro. The standard BleuIO was then tested with the same stand-in sensor and watered as expected, and a swap between the two while the program ran was picked up without a restart.

We had no SSD014 on the bench, so a second Bluetooth board sent advertisements with the same manufacturer data, set to 20 °C and 30 %RH, then to 30 °C and 25.5 %RH. The cooldown was shortened to one minute and the daily limit to three runs for the test. A small DC motor was connected between M1A and M1B, and an oscilloscope measured M1A against ground. The board was powered by USB alone.

How to Run the Project

Step 1: Install CircuitPython

Download the CircuitPython UF2 for the Cytron MOTION 2350 Pro and put the board into its UF2 bootloader mode by holding BOOT while pressing RESET. Copy the UF2 to the drive that appears. The board restarts with a drive called CIRCUITPY.

Step 2: Add the libraries

Run circup install asyncio, or copy the asyncio folder and adafruit_ticks.mpy from the library bundle into CIRCUITPY/lib.

Step 3: Copy the program

Save the code at the end of this post as code.py on the CIRCUITPY drive. CircuitPython starts it as soon as the file is saved.

Step 4: Connect BleuIO

Insert BleuIO into the board’s USB-A port.

Step 5: Connect the pump

Connect the pump’s two wires to the M1 motor terminals. Check the motor supply before you do: the pump is rated 3–6 V, and on USB power alone our board’s M1 output reached about 4.8 V. If you give the motor drivers a supply of their own, check its voltage against the pump and against Cytron’s datasheet, and set PUMP_DUTY to match. Never connect the pump to a GPIO pin directly. If water comes out the wrong end, or not at all, swap the wires or set PUMP_REVERSE = True.

Put the pump in the reservoir and run the tube to the plant. Start with a supervised run and measure how much water three seconds actually delivers; it depends on the tubing and on how high the water has to climb.

Step 6: Watch the serial console

Open the board’s serial console at 115200 baud, with Mu, Thonny or the CircuitPython web workflow, or on macOS and Linux:

screen /dev/cu.usbmodem2101 115200

The device name differs from computer to computer.

Settings

The settings are at the top of code.py:

Expected Output

From our test, with the stand-in sensor’s ID, EEEE07. Your sensor’s own ID appears instead.

BleuIO found: BleuIO 4048FDE52F7B 
Starting the SondeAir scan... 
[Sending]: ATE0 
[Sending]: ATV1 
[Sending]: AT+CENTRAL 
[Sending]: AT+FINDSCANDATA=FF5B0707 
[SondeAir EEEE07] 20.00 C 30.00 %RH 
20.0 C, 30.0 %RH: no need to water 
... 
30.0 C, 25.5 %RH: warm and dry; waiting 10 s to be sure 
WATERING for 3.0 s (30.0 C, 25.5 %RH; run 1 in 24 hours) 
Pump off 
Warm and dry, but within 1800 s of the last run

The program prints a line when its decision changes, and the latest reading every 10 seconds.

Ideas for Going Further

  • Add a capacitive soil moisture sensor on one of the analog inputs, and water on that instead of the air.
  • Add a level switch in the reservoir, so the pump never runs dry.
  • Water several plants from the other three motor channels, each with a sensor of its own.

The Code

Source code is available at https://github.com/smart-sensor-devices-ab/bleuio-sondeair-cytron-motion

Related Content

Comments


You May Also Like