dkat
Posts: 5
Joined: Sat Mar 09, 2019 6:27 pm
Location: Hastings On Hudson, NY, USA

Advice on plant watering moisture sensors please...

Sat Mar 09, 2019 6:44 pm

I'm starting V2 of my plant watering system.

V1 worked ok, but I used inappropriate moisture sensors for the distance I needed covered. It ran on an Arduino. Since I have to re-do the entire input side of the process for new sensors, it's an opportunity to upgrade to Raspberry Pi and add Internet connectivity to the system for monitoring and control.

The system can run headless, sensing each of six moisture sensors and controlling six water lines - for six plants. With the upgrade to Raspberry Pi, I'd like to be able to read and modify variables in the program on a web page and an Android app.

My question is this: Considering I want to add that network connectivity in this version, now would be the time to carefully consider which OS and which programming language I should use - to avoid regrets later.

Advice, please?

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: Advice, please...

Sun Mar 10, 2019 12:29 am

IMHO Raspbian is the best operating system for this. It's designed for the Pi and you can usually get help and advice here.

I guess whichever language you are most familiar with is best, but if I was doing it I would consider something like this:

Ensure that the area has a good wifi signal, maybe with a professional access point.
Attach one or two sensors to each of a few ESP8266 modules (an ESP8266 is essentially an Arduino with built-in wifi)
Send readings over wifi using MQTT.
Have a Raspberry Pi 3B running an MQTT broker to receive and analyse the readings.
Issue messages again by MQTT to ESPs to control the valves.

I would use Node-Red for the processing on the Pi. It's easy to use and as well as the control code it lets you create a web page dashboard for instrumentation.

Edit - I would program each ESP to send a regular "heartbeat" message too, which the Pi can monitor to identify if one goes out of action.

dkat
Posts: 5
Joined: Sat Mar 09, 2019 6:27 pm
Location: Hastings On Hudson, NY, USA

Re: Advice, please...

Sun Mar 10, 2019 1:29 am

Thanks, jbudd.

Your idea is to have the moisture sensors connected wirelessly to the Pi. Cool. Maybe in V3.

But for V2, since my garden isn't big enough to require wireless connectivity between the Pi and the plants, I think I'll just run one 2-pair speaker wire from a RS-486/USB adapter, connected to the PI, out to the plants. Each plant will have an RS-486 moisture sensor, connected to the bus. Each sensor has a unique ID, so each is individually addressable via the one bus line.

Valve control is also hard-wired from the Pi's GPIO ports to a relay board to power the pumps.

Thanks for your kind reply and for the clarity re OS, programming language, and Node-Red.

Best,
Dkat

PhatFil
Posts: 1685
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Advice, please...

Sun Mar 10, 2019 2:12 am

shame, mqtt is very powerful and very easy to use, for wireless sensors check out cheap($15) bluetooth ble moisture/plant sensors from xiaomi that have been cracked for direct pi coms and run for ages on a coin cell ..
https://github.com/ThomDietrich/miflora-mqtt-daemon
and
https://zsiti.eu/xiaomi-mijia-hygrother ... pberry-pi/
and
https://flows.nodered.org/node/node-red ... xiaomi-ble

in my limited experience with soil moisture sensors both capacitive and conductive types i would say that they are not reliable sensors, put 3 in the same pot and get 3 significantly different readings. so judge each sensors readings against its own earlier readings and not against other sensors, factors such as soil compactness and how snugly inserted the sensor is can play a significant part in what it outputs.

I would suggest watering to a time cycle and using the moisture sensors to gather data you can use to refine the timed cycle, and perhaps use the input to stop overwatering after rain etc rather than using a moisture level to trigger watering as you will probably need to test each sensor for a significant period to derive its optimal moisture trigger level. while its a fairly safe assumption if the sensor reads 80 or 90% its pretty wet and not in need of water ;)

dkat
Posts: 5
Joined: Sat Mar 09, 2019 6:27 pm
Location: Hastings On Hudson, NY, USA

Re: Advice, please...

Sun Mar 10, 2019 3:31 am

Yes, PhatFil. Moisture sensing is evidently something of a black art. In V1, I did apply some water, then delay for absorption time, read again, then apply more water if needed, etc. But the conductive sensors were worthless, especially with the way-too-long cable runs I was trying to use.

I'll give MQTT and your suggested wireless sensors a good look before proceeding.
I did order a couple of these in the meantime. https://www.tindie.com/products/miceuz/ ... -sensor-2/

Thanks for your advice.

Dkat

Return to “General discussion”