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

I mounted the photocell, but on the serial display it says that it irrigates. I understand that in the cod it was inserted and it should be done even if it is day and it is too dry? :slight_smile:

Thank you for all, I understand you had a difficult day, i already owe you :slight_smile: if you feel tired we can continue another time. As you prefer:)

Do you mean you want it to turn on the pump even during the day if it’s below the target moisture, or should we have a “danger” level that’s used regardless of the light levels so that it always waters the plants if it goes below that?

You’ll notice now that I’ve introduced a minimum moisture level (MIN_MOISTURE_LEVEL). If the moisture level goes below that, it’ll water regardless of the light level.

#define LDR_MAX_LIGHT 800
#define TARGET_MOISTURE_LEVEL 512
#define MIN_MOISTURE_LEVEL 300
#define WATERING_TIME_MS 3000
#define POLL_DELAY_MS 60000

If you change any of these numbers, please tell me what values you used so that I can update the code and you won’t lose your changes when you replace your code with mine from Github.

We should have a danger level :):slightly_smiling_face: In About an hour i will be home from work,and we can continue our project If is not to late for you.Thanks

Now i got home, sorry but the boss kept me over the program …

Of course I saw that you also introduced the minimum moisture level,and i thank you for that.I will not change any of the numbers from the code you wrote.First let’s finish the job and then we’ll see if I need to change something.Thank you again you are the best!!

I have uploaded in the arduino the new code, but still says it does not find the lcd and indeed the lcd will not see anything.It is just illuminated.

You may need too swap which line has the // at the start because different LCDs have different addresses.

#define LCD_ADDRESS 0x3F
//#define LCD_ADDRESS 0x27

You were right as always :slight_smile:

I’ve updated the code so that we won’t have that problem again.

Is there anything else remaining to do in the code, or is it just a case of testing it now?

Hi, i noticed that the values ​​recorded by the soil moisture sensor ,they are higher when the sensor is outside the moisture. And when it is in the moisture the values ​​are lower.IN the earth around 320-350,outside the moisture around 5-600.

If I don’t already ask for too much, I think I would need a humidity sensor too.

And maybe in the future, we can put a bigger lcd on it, chosen by you :slight_smile: I would be happy if the code at the beginning or somewhere would show that it is made by you :slight_smile:

For any eventuality or for a future project I bought a real time clock. I wish you a wonderful day

1 Like

Just now i noticed that u added a new line #define MIN_MOISTURE_LEVEL 300
But i am at work i don t have the arduino to test .I will test it tonight aroun 8 when i will finish my job.

1 Like

How odd, the sensor description for the one in circuito is the other way around. Do you have dry soil you can put it in, measure the reading, add water, then measure again over the course of about 10 minutes to see how it changes?

Not at all, but I’d like to get the basic moisture meter working before we add more sensors.

I’ll have to see what sort of displays are supported.

There’s no need to have my name on it. I’m happy to just help where I can.

Sorry my friend,my boss has a bad habit to keep me over the program…
Now i will make the test as you told me and i will let u know
shortly

iput the sensor in dry soil and
##diagnostic
LDR:0199
Buttons:100
Relay test
Moisture 0635
LDR:0162
Misture: 0635
No need to water at this time
Started
Diagnostics
LDR:0199
Butonns:100
Relay test
Moisture 0563
No need to water

This is on dry soil

I put water over the soil it shows
moisture : 0281
watering

1 Like

i left the sensor in dry soil 15 minutes.It still says that moisture is 0602
no need to water
i put in in wet soil again and
moisture 0374
watering
moisture 0369
watering

1 Like