OpenSprinkler Forums Hardware Questions Opensprinkler + Soil Moisture Sensor

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #66927

    wateru
    Participant

    Hi,
    I am a novice here. My goal is to create an automated sprinkler system based on soil moisture for my lawn and garden. I spent the better part of today researching. Would a setup like the following work? Need your advice before spending money on this. Thank you so much.

    – Chirp Soil moisture sensor
    – Raspberry Pi Zero W
    – Opensprinkler Pi
    – Solar panel, 9V battery, Car charger (this for later expansion to make the Raspberry Pi power supply automatic)

    Proposed setup:
    Phase I – Replace my Hunter sprinkler panel with Opensprinkler Pi. Insert Chirp soil moisture sensor in my flower bed. Connect Chirp Soil moisture sensor to Raspberry Pi Zero W. Get the Opensprinkler PI and Raspberry Pi on my wifi network. Output from the chirp soil moisture sensor should flow to Raspberry pi, use this output to change waterlevel of the Opensprinkler Pi.
    Phase II – Use solar panel to charge 9V rechargeable battery, transform 9V with car charger to USB power and power the raspberry pi board.

    Please let me know if this sounds like a reasonable setup that can work? Thank you.

    #66948

    Mike
    Participant

    Hi wateru,

    Yes what you’re asking about can definitely be done. I’ve done something very similar and it’s been working for a few years now. A few thoughts about your proposed setup come to mind.

    • I’d suggest a more robust soil moisture sensor. I’ve got a chirp and mine definitely is not designed for outdoor use. I’d suggest considering the VH400. I’ve also got one of these and it is now in its 4th season outdoors in the containers on my deck. I’ve had absolutely zero problems with it. It uses the same method to measure soil moisture as the chirp.
    • If the only thing you’re doing with the Raspberry Pi Zero W is using it to read the value from the chirp and send the data to Opensprinkler over WiFi, you should probably use an ESP8266 or ESP32. It’ll use way less power. That will mean you’ll need a much smaller battery and a smaller solar panel also. Just make sure that whichever version you choose you’ve got an analog to digital converter on it (ADC) if you use the VH400 as it outputs an analog signal.
    • Instead of changing the waterlevel on the Opensprinkler, you could just turn the zone on through an API command. Seems more straightforward to me.

    I’ve mentioned my setup before on the forum. Here’s a link to one of the mentions. https://opensprinkler.com/forums/topic/pi-customisation/ If you have any questions just ask.

    Mike

    #66993

    wateru
    Participant

    Hi Mike,

    Thank you for the detailed explanation. Will take your advice and use the VH400 and ESP8266. Will get the parts ordered and ask questions as I run into them. Really appreciate this supportive environment!! Thank you!

    #67041

    wateru
    Participant

    Hi Mike,

    Can the VH400 and the ESP8266 be powered from the same supply? The VH400 says it takes 3.5V – 20V input. The ESP8266 board I ordered is UBB powered so goes up to 5 Volts. Can I tie the VH400’s VIN & GND to the ESP8266’s VIN and GND to power the VH400?

    The VH400 analog out is 0-3V and the ESP8266 board’s analog A0 input pin range is 0 – 3.3V, so I think, I can connect the VH400’s analog out directly to the A0 pin on my ESP8266 board – can you please confirm?

    Thank you again for all the help.

    #67067

    Ray
    Keymaster

    @wateru: ESP8266’s analog pin accepts voltage range in 0-1V (it’s 5V tolerant, but anything above 1V will all be converted to 1023, the maximum analog value). Just use two resistors to form a voltage divider to lower the value range to 0~1V.

    #67525

    wateru
    Participant

    Hi Mike and others,

    Thank you for your help. I ordered the parts and feel I am so close to finishing Phase I of the project. The following is what I have done so far and have a couple of questions to complete this out. Please help with the questions.

    1. Got OS Pi hooked up in place of our old Hunter controller and it is running my daily program without any issues.
    2. Got ESP8266 NodeMCU board and got it up and running with VH400 moisture sensor.
    3. The NodeMCU is publishing the moisture data to ThingSpeak every hour.

    Remaining steps for Phase I – I need to get OS Pi to use the moisture data and make watering changes. Don’t exactly know how to do this. I have one sensor for the whole house and have placed it at the driest location. I made this the last zone that gets watered so that the safe option is to water.

    Now the questions:
    1. Where should I edit the program to incorporate the VWC data published to ThingSpeak? In OS Sprinkler code – which .py file should I edit after downloading it from GitHub?
    2. I want the logic to be If VWC < dryThreshold, run the regular daily program with no changes; If VWC < mediumThreshold and > dryThreshold, run the daily program at 50% time OR 50% water capacity (either is fine) and IF VWC > wetThreshold, don’t run the daily program.
    3. I want to activate this logic at the same daily time I have set in the OS Pi schedule. In other words, simply add moisture as an additional data point to the program keeping the schedule/zone etc. the same. How do I achieve this?

    I saw the examples link the forums you pointed me to. In that example I see that the manual program is called if sensor reading is < threshold. This is slightly different that what I want to achieve.

    4. Also, in the example it appears the manual sprinkler program call is made in the uController code after writing data to ThingSpeak. What is the point of writing the data to ThingSpeak if the uController is going to act on current data it just read.

    Thank you so much for all your help and getting me to this point.

    Really appreciate it!!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions Opensprinkler + Soil Moisture Sensor