Making Moisture Threshold to Open Water Valve

Hello Everyone,

I wanted to make a water valve open if moisture levels fall under a certain threshold. Not too familiar with coding on the Arduino IDE and just needed push in the general direction. I'm looking at the FAQs and syntax list.

Start by using example code for the moisture sensor and learn how to master it.
Then go for managing the water valve what ever that is.
Apply the logic You want.
Reading and using the topic: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum will give You more useful tips.

You start with choosing a moisture sensor, on the inexpensive simple approach you can start with a sensor like this. Keep in mind sensors like this need frequent cleaning as corrosion builds up. Next a consideration is once soil moisture content is known and drops to where you turn your pump on you need hysteresis or as soon as your pump turns on the moisture content will rocket up and the pump turns off so you need to sort of meter your flow and include hysteresis. Hypothetical numbers here but if you tell your pump turn on at 50 you want the pump to turn off at maybe 75. You do not want a pump cycling on / off over and over again.

You may want to look at if statements.

Give this a read paying attention to the code. It's a good read and get a handle on what the code is doing and why.

Edit: Well I was a few min slow in posting this. :slight_smile:

Ron

How are you going to measure "moisture"? Are you talking about soil moisture or ...?

Thank you! I'll be sure to play with the code more!

Thanks for the help Ron! I think the solution I'd make is to put on a timer for when the valve opens so that it doesn't turn off as soon as it gets wet. I'll be sure to read the material sent out!

Do so. That's a good way to become a programmer, not a help seeker.

1 Like

That should work. You will have a feel for dry so timed watering should work out well. :slight_smile:
Ron

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.