mr_bjerre
Posts: 5
Joined: Tue Dec 27, 2016 11:12 am

Automatic watering system for multiple plants with Rpi 3

Tue Feb 06, 2018 1:14 pm

I wish to create a system that automatically waters a bunch of plants using a single Rpi 3 and a single analog converter (to get the analog signal from the moisture sensors).

For each plant I have a soil moisture sensor and a water pump. I am thinking that I should be able to loop over each plant with some kind of module that are connected with each plant as well as the converter and Rpi. My question is; does such a module exist? It could be some kind of a clock/switch I suppose.

Otherwise I'd have to connect each plant to my Rpi directly and the project would be less scalable then. Hope there are some helpful minds out there.

pcmanbob
Posts: 10120
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Automatic watering system for multiple plants with Rpi 3

Tue Feb 06, 2018 2:54 pm

You need to add a multiplexer to your ADC input so that you can switch from one input to another or use an ADC that has multiple analogue inputs, you will still have to wire all the sensors back to the pi. (example of multiplexing (not on a pi) https://internetofhomethings.com/homethings/?p=530)

you still need a way of switching the output for each pump but that will depend how you are driving the pumps, again you will still have to wire all pumps back to the pi.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Automatic watering system for multiple plants with Rpi 3

Tue Feb 06, 2018 3:09 pm

I think I would use the Pi as a server to monitor a distributed systems of ESP8266 devices (super cheap) in each plant pot all talking over WiFi.

You could run those modules from a few AA cells (deep sleep allows it to run for months). Analog in, digital out, deep sleep mode and WiFi seem like a good fit.

The Pi could run a MQTT broker that tracks how much watering has been done, warn of low battery or water level etc

scotty101
Posts: 4100
Joined: Fri Jun 08, 2012 6:03 pm

Re: Automatic watering system for multiple plants with Rpi 3

Tue Feb 06, 2018 3:24 pm

PiGraham wrote:
Tue Feb 06, 2018 3:09 pm
I think I would use the Pi as a server to monitor a distributed systems of ESP8266 devices (super cheap) in each plant pot all talking over WiFi.

You could run those modules from a few AA cells (deep sleep allows it to run for months). Analog in, digital out, deep sleep mode and WiFi seem like a good fit.

The Pi could run a MQTT broker that tracks how much watering has been done, warn of low battery or water level etc
I like this idea.
ESP periodically reports moisture level.
Pi can do the 'smarts' to figure out how much water the plants need and when.
The Pi just commands the ESP modules to turn on their pump for a specified number of seconds.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Automatic watering system for multiple plants with Rpi 3

Tue Feb 06, 2018 6:44 pm

BTW ESP8266 or ESP32 are more powerful than Arduino with plenty of gpio and can be programmed like one from the Aduino IDE.

mr_bjerre
Posts: 5
Joined: Tue Dec 27, 2016 11:12 am

Re: Automatic watering system for multiple plants with Rpi 3

Wed Feb 07, 2018 10:18 am

PiGraham wrote:
Tue Feb 06, 2018 3:09 pm
I think I would use the Pi as a server to monitor a distributed systems of ESP8266 devices (super cheap) in each plant pot all talking over WiFi.

You could run those modules from a few AA cells (deep sleep allows it to run for months). Analog in, digital out, deep sleep mode and WiFi seem like a good fit.

The Pi could run a MQTT broker that tracks how much watering has been done, warn of low battery or water level etc
I really like the this kind of wireless idea. Can the pi ask each ESP about moisture level and make them pump water on demand? Or does the pi just listen and then the ESP contacts the pi about moisture level once every...? Are the ESP only connected to the sensors or do they initiate the pumps as well or are they connected to the pi?

I am not sure that I understand the last bit about MQTT broker. I am admittedly very new to the world of IoT.

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Automatic watering system for multiple plants with Rpi 3

Wed Feb 07, 2018 10:52 am

mr_bjerre wrote:
Wed Feb 07, 2018 10:18 am
PiGraham wrote:
Tue Feb 06, 2018 3:09 pm
I think I would use the Pi as a server to monitor a distributed systems of ESP8266 devices (super cheap) in each plant pot all talking over WiFi.

You could run those modules from a few AA cells (deep sleep allows it to run for months). Analog in, digital out, deep sleep mode and WiFi seem like a good fit.

The Pi could run a MQTT broker that tracks how much watering has been done, warn of low battery or water level etc
I really like the this kind of wireless idea. Can the pi ask each ESP about moisture level and make them pump water on demand? Or does the pi just listen and then the ESP contacts the pi about moisture level once every...? Are the ESP only connected to the sensors or do they initiate the pumps as well or are they connected to the pi?

I am not sure that I understand the last bit about MQTT broker. I am admittedly very new to the world of IoT.
MQTT is a simple way for devices to exchange data over a network. A broker (server) publishes topics that have a name and a value and clients subscribe to topics to set or read the values. ESP can subscribe to, say, a moisture_n topic for plant 'n' and send readings to the broker. It can subscribe to "WaterDose_n" to be notified of when and how much water to pump.

I don't know a lot about MQTT myself but there are some here that are experts.
Check out Andreas Spiess on YouTube for info on ESP, Wi-Fi and low power.

This looks like a good intro to MQTT for Pi and ESP
https://www.baldengineer.com/mqtt-tutorial.html

mr_bjerre
Posts: 5
Joined: Tue Dec 27, 2016 11:12 am

Re: Automatic watering system for multiple plants with Rpi 3

Thu Feb 08, 2018 2:47 pm

PiGraham wrote:
Wed Feb 07, 2018 10:52 am
MQTT is a simple way for devices to exchange data over a network. A broker (server) publishes topics that have a name and a value and clients subscribe to topics to set or read the values. ESP can subscribe to, say, a moisture_n topic for plant 'n' and send readings to the broker. It can subscribe to "WaterDose_n" to be notified of when and how much water to pump.

I don't know a lot about MQTT myself but there are some here that are experts.
Check out Andreas Spiess on YouTube for info on ESP, Wi-Fi and low power.

This looks like a good intro to MQTT for Pi and ESP
https://www.baldengineer.com/mqtt-tutorial.html
Perfect. I am really looking forward to receiving all the hardware now. I guess I don't need the analog/digital converter with the ESP, right? Also I guess I can keep most of the logic in python on my Rpi, while the actual jobs are done using C++ on the ESP when told to. Am I on the right track?

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Automatic watering system for multiple plants with Rpi 3

Thu Feb 08, 2018 3:30 pm

I think that's the right track. You can put some logic in the ESP so watering isn't dependent on mains power or Wi-Fi. Pi / MQTT is ideal to monitor the system overall to make sure no plant is starved of water, detect leaks, alert if an ESP fails, keep batteries fresh. etc


More on low power from CNLOHR
https://www.youtube.com/watch?v=I3lJWcRSlUA

He uses OpenWRT on a typical TPLink router to do network updates from / to ESP8266 in 100ms then go back to deep sleep.
AFAIK you can run OpenWRT on a Pi.

netvectorman
Posts: 1
Joined: Sun Sep 02, 2018 5:49 pm

Re: Automatic watering system for multiple plants with Rpi 3

Sun Sep 02, 2018 5:55 pm

Was this project ever built? I'm intrigued by the proposed design.

How did it go?

rickyh89
Posts: 55
Joined: Mon Jun 18, 2018 11:01 pm

Re: Automatic watering system for multiple plants with Rpi 3

Thu Sep 06, 2018 12:00 am

i am doing something extremely similar, i priced out making moisture sensors with ESP with batteries etc. price was about $17 each.

Another user on here put me onto these :

https://www.aliexpress.com/item/Xiaomi- ... 84205.html

found for about $20 elsewhere and just wait 30days for china lol but use the pi as a broker with MQTT.

sensor sends moisture level to pi and pi used relay and counter via GPIO to turn pump on and count water and shut off when 'x' amount given.

Return to “Automation, sensing and robotics”