LDR_MAX_LIGHT
This should be the LDR (light sensitive resistor) value that indicates it’s night time.
TARGET_MOISTURE_LEVEL
Set to 400 now, but this should be the moisture level you want the system to target/aim for
DANGER_MOISTURE_LEVEL
I’ve set this to 800, but you should set this to the level the moisture meter indicates when you would like it to add water even if it’s day time.
WATERING_TIME_MS
This time (in milliseconds) controls how long to apply water for. It’s how long the relay is kept on for which only you can tell from how much water your pump transfers in the time. It’s 3000ms now (3 seconds).
POLL_DELAY_MS
This time (in milliseconds) controls how long the system sleeps after checking the soil and applying water if needed. I set to 1 minute (60000) for now but it could be much longer really (5 minutes, 15 minutes, etc.).
Note:
I’ve made a change to the code so that the logic will apply correctly for the daytime watering based on the target and danger moisture levels. So if you get a different sensor that reports higher values for more moist soil, you only have to alter the operating parameters.
My friend, i modified the code as you told me …the problem is the same…the sensor indicates too much water in a dry soil and too little water in a wet soil. I am sorry that this become an issue but I really appreciate your help.
And I replaced the MIN with DANGER in the code …as I understood from what you ve told me …
Sorry, just now I noticed that the code was also changed on github. I copied it to the arduino and now it irrigates even if the soil is dry or wet. The values shown are the same, when the sensor is in wet soil; moisture 0353 watering, when it is in dry soil; moisture1006 watering.This with the new sensor.
With old one in wet soil;moisture0338,watering,in dry soil;moisture0572,watering.I prefer the old sensor, i corrodes harder
I made the test and now it works Even if It shows that is dry when is wet and wet when is dry,(i say that because the values are lower when is wet and higher when is dry), but irrigates when in fact it s dry .Probably you modify the cod to work like that ,so i think that it will make the job Thank you a lot. The three buttons are working now,or they will in the future?And how i can use those buttons ,if they are working?If you remember,i need a air humiditi sensor too ,If i didn t ask too much already
Thank you a lot for everything, you are the best !
LDR light works I think backwards, when the light is on it says LDR 0163 (and around this value) and when the light is off, LDR 0040 (and around this value).But i think that if I change the value (800 with 50) it would be the correct modification to make the light resistor work properly ?
That sounds correct to me (less light = lower values) and changing it to 50 would be good. I’ll do the same in the GitHub code so that you don’t lose changes if/when you replace it.
I have an idea, if instead of moisture, lcd displays’ soil dryness lvl , 'dryness lvl, or ‘dry land lvl’, then in fact it will tell you how dry the land is, so the values displayed will be good
Higher values equals more dry land and lower values less dry land
This can replace the lcd percent display, if it is easier to do The percent display would be nice, and will also fit “dryness lvl”, but I don’t want to exaggerate :)I apologize for the many requests, I hope I didn’t upset my friend
I think if i replace in the code where it writes moisture with dryness lvl will work ,ok?
You’re not upsetting me buddy - I was just absolutely exhausted last night.
I would encourage you to try make changes to the code, particularly to text inside quotes. You can always replace it with the code from GitHub and start again.
My plan with the three buttons was to use them as
Menu
Yes
No
And with that you could control some things manually. Imagine:
Press menu -> Water now?
There’s obviously more you can do and that’s down to your/our imagination. But it’s not necessary really so if you want you can remove them from the circuit.
Will the humidity sensor be necessary? I imagine the moisture/dryness of the soil would be enough to determine whether to add water. Will you be able to test this at home for a week or so before installing for your grandmother?
Ok, i think that the three buttons are not really necessary(but i would love to have them😜). About the air humidity, the sensor is necessary because i wanna see the air humidity level so we can install a fan to lower the humidity when necessary. Maybe our display is too small for all these ? And I will test the system before install it to my grandmother.
I’m going to assume you have a DHT22/11 Humidity and Temperature Sensor. Please let me know if you have a different sensor. I’ll add the button menu and humidity readings on the LCD. With the humidity sensor, the circuito circuit looks like this now:
The difference is that I’m assuming you’ll put the DHT sensor on pin 6 to avoid having to rewire all the other components. It might be better if we stick to the diagram in circuito to avoid confusion though. Would you be okay moving the connections to the Arduino to different pins?
Hi, i have a dht11 sensor, it looks like the one in the circuit but it is not identical I think it is dht11, not dht22 / 11. But I think it does the same thing
I will do the circuit, mount the sensor and copy the new code to see if the DHT sensor works and I will tell you what happened. Regarding the menu, I think it’s perfect as you proposed to work
the dht11 sensor I have, only has 3 feet, not 4 as the dht22. Do you think it will work, or should any changes be made in the code
I think i have a module DHT11 sensor
Anyway i will try with him and see what happens