Pico planter

Summary

In this project, I use a pi pico w to turn a simple self hydrating pot into a "smart" pot, featuring:

  1. Lots of sensors:
    • Temperature
    • Humidity
    • Light
    • Soil moisture
    • Water tank level
  2. Water pump
  3. Water tank level alarm
  4. Local data logging
  5. Cloud data logging

The reason quotes were used for "smart" is that this was mostly a way to learn new things. All of these sensors and logging is not necessary to automate watering plants. The pump alone operating on a timer is sufficient. Also, for some plants, the amount of moisture naturally escaping to the soil can be enough, especially if the plants have developed a deep enough root system.

This planter managed to keep my plants alive during almost an entire summer month. In this page there is info and files about building this planter.

pplanter_done.jpg

Pot used

The pot used for this project was a Lidl purchase. A parkway brand orthogonal pot with a water tank on its bottom and a floater for indicating the tank's water level.

parkside_pot.jpg

The dimensions of the pot are roughly 80x20x16 cm in length x width x height. The water tank has a capacity of approximately 3 liters which was enough to keep the plants fresh for about a month in Swedish summer.

Sensors

Light

An LDR was used with a 10KOhm pull down resistor. The pi pico w's ADC can read the voltage of the divider and the result can be translated to a light reading.

LDR.jpg

Temperature/humidity

A DHT11 was used for temperature and humidity monitoring. This sensor is widely available and circuitpython has a library for communicating with it.

DHT11_temp_humid.jpg

Soil moisture

I used capacitive sensors for monitoring the soil moisture. Unfortunately, although there was an attempt on sealing them from water, the sensors stopped working due to water damage after about 2 months of service. I used hot glue over the electronics but water managed to sip through between the glue and the circuitboard. Better ways to insulate this sensor could be a plastic wrap like a ballon or a glue that is intended for water tight sealing, like the silicone glues used in plumbing.

moist_sensor.jpg

Water tank level

For monitoring the level of the tank, a DIY sensor was used. A switch was made out of plain wires and some thin sheet metal. The switch was embedded onto the existing floater indicator in such a way that it would close if the water in the tank gets too low:

water_tank_level_sensor.jpg

Of course, this type of sensor has a very bad response or signal. In order to detect it, countio was used. countio is a circuitpython library that uses interrupts to read pulses and it is able to detect fast signal inputs.

Once the water of the tank is refilled, the alarm can be deactivated with a pushbutton input.

Pump

The only actuator used is a small 5V pump. The pump was combined with two transistors in Darlington configuration. This enabled the pump to be directly connected to the 5V supply and pi pico and used directly.

pump.jpg

Plastic tubing was used along with a 3D printed T part that split the water supply to both ends of the pot. An STL for the T part can be downloaded in the "downloads" section bellow.

Data logging

The sensor data as well as the state of the pump are saved locally on an SD card. An SD card reader is used to read and write data to the card with SPI bus.

sd_reader.jpg

The data is uploaded to influxDB periodically. InfluxDB is a time series database with a decent free plan. Finally, a dashboard was created with grafana to visuaize the data.

architecture.png grafana.jpg

Code

The code for the pi pico w was written in python using circuitpython. Circuitpython has come a long way and nowadays it is probably the easiest, fastest language to use for prototyping. It offers ready to use classes and libraries for using the board's feateures or commonly used external sensors and peripherals.

The circuitpython code for the pico can be downloaded here.

Results

The main program does crush some times but this is countered by using the watchdog timer to reset on 8 seconds since last feed. Otehr than that the pot worked great and helped me preserve my plants almost for the entire month of August while I was away. Here is a comparison before August:

pplanter_early.jpg

And after August:

pplanter_done.jpg

Great success! This basil variety was especially tasty in red pasta sauces. The leaves are impressively large, making it stand out. Try sipping water from one of the leaves—surprisingly refreshing and flavorful!