Does anyone want to help me in making my project in the form of: watering the plants using two sensors, a soil moisture sensor and a DS3231 RTC sensor. Where does this tool work by reading two conditions including: when the time shows 08.00 and the soil moisture sensor reads with humidity <= 50 then watering will be done. but when the soil moisture sensor reads soil moisture> = 50 then watering is not done, even though the time schedule is read correctly. for the day of sailing, it is not done because there is no watering schedule, and in the afternoon the watering is carried out according to the way of working in the morning.
First of all I am sorry to say NO ONE HERE WILL WRITE THE CODE FOR YOU.
But we can give ideas or suggest on how to move with the project.
First thing is to find a code for DS3231. Try to turn on and off a LED on specified time(this same thing can be done using Blynk’s RTC widget). If this works well next search for a soil moisture sensor code, make it work.
Now merge both code together add BLYNK to the code. Make sure the loop part is empty, because you will later need to be running only Blynk.run and timer.run in the loop. Rest all the functions will be called by a timer.
Once you have this basic code you can post it here if it doesnt work. So we can help you out.
There are very few scenarios where a hardware RTC is needed when using Blynk.
The Blynk RTC widget will update the Time library with the correct time on a regular basis when there is an internet connection.
If there is no internet connection then the ESP8266’s internal clock gives good accuracy over quite a long period of time.
The only situation where actual time synchronisation can’t be achieved is when the ESP8266 restarts and there is no internet signal to synchronise the time with the Blynk server.
There are a number of excellent plant watering examples on the forum. I’d suggest that you check them out.
I have tried to make this program why pumpstart1 does not turn on when both the time schedule conditions and soil moisture are in accordance with the programming.
There are so many things wrong with this sketch that it’s difficult to know where to begin!
I’d recommend that you do some additional research and find someone who has written a better piece of code to use as your starting point.
If you’re planning to use Blynk then I’d suggest that you start with the Blynk RTC examples in Sketch Builder, then add the hardware RTC Sync in there later.
If you aren’t planning to use Blynk then I think you’ve come to the wrong forum