I need help in creating the program of an automatic irrigation system with lcd

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 :slight_smile:

Thanks for the detailed explanations about how I can change the values ​​according to the need :slight_smile: They will really help

Oh dear. I’ll double check the code tonight to make sure it works as I intended.

1 Like

You discovered a bug in my code, thank you!

I’ve updated the code and tested the logic in another program running through the different sensor values to check that it waters when it should. Please take a fresh copy of the code off Github: https://github.com/bernhard-hofmann/circuito.io-4045/blob/master/AutoWater.ino

1 Like

Thank you a lot my friend!I will make the test now,and let you now what happend :slight_smile:

I made the test and now it works :slight_smile: 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 :slight_smile: .Probably you modify the cod to work like that ,so i think that it will make the job :slight_smile: 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 :slight_smile:
Thank you a lot for everything, you are the best !

1 Like

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 :slight_smile: ?

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.

Thank you very much :slight_smile: you are right as always.

I have a curiosity, the humidity level could be displayed in percentages, 30%, 35% etc
If it is hard to do, it is very good and as it is now :slight_smile:

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 :slight_smile:
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 :slight_smile: 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?

1 Like

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

  1. Menu
  2. Yes
  3. 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:

https://www.circuito.io/app?components=97,97,97,9088,9442,10167,11021,13322,417986,3061987

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?

1 Like

When you get a chance, could you write out how you want the menu to work? For example, given these three buttons:

image

Pressing the Menu button without anything else would cycle through these options:

  • Pause?
  • Water?
  • Test?
  • Restart?

Pressing the Select button selects whichever option is showing on the LCD.

Pressing the Close button closes the menu if it’s open.

Hi, i have a dht11 sensor, it looks like the one in the circuit :slight_smile: 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 :slight_smile:

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 :slight_smile:

I will buy a DHT22 sensor in a few days,I saw on youtube that it is much more efficient than DHT11

I think the relay is at the arduino 5 and the button at the arduino 6, not as on the curcuito diagram
If I do the scheme as in the circuito, the relay does not work.
I read in the code this line:#define RELAYMODULE_PIN_SIGNAL 5,and so I suspected that the relay should be put on the arduino 5.I have also fitted the dht 11(i think is a module DHT11 )that I have, but if it doesn’t work, the days that follow as I said above, I will buy the dht22. Thank you very much my friend, I can’t wait to see the project 100 percent functional:)