Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15217

Automated Watering System

$
0
0

Hello there,

I have a project idea to create an automatic watering system for my uncle's garden. The place doesn't have WiFi so that's not an option. He also doesn't want any sensors and just wants a time automation. I have bought an ESP32 and an external RTC - DS3231. Everything to here is fine, I already assembled all the parts and just need help with the code part.

My question is, how would be better to aproach it?

I have two ways in mind. The first one is using Interval Hours and this formula int hoursSinceLastActivation = (now - lastActivationTime).hours() and by adding another time criteria. For example setting the Interval Hours to 72 and the time criteria to 02:00 - 05:00 the ESP will need to meet two criterias before activating - the first one being 72 hours after activating it and the second one will be the time. I have a problem with this method because I don't know how the Last Activation Time works and how does it deal with power losses. If I power it on now lets say 13 May the Last Activation time becomes 13 May and it starts counting 72 hours, but in case of a power loss on 14 May, does the last activation hour becomes 14 May or does it stay on 13 May.

The second method is just using simple schedule aproach. Setting a time schedule from Monday to Sunday and the ESP will see if it is time to power on. This method doesn't have any problems in my opinion.

Can you guide me on what method would you use if you were in my place and why

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 15217

Trending Articles