Date and time based watering system using an Arduino and a RTC module

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2019
  • In this video I show you how to make an automated watering system based on a real time clock (RTC) module.
    You can expand this project to control anything based on date/time, and you can add more switches, relays, etc.
    For example, you can turn on and off your heater, lights, air purifier at a certain time of the day with this circuit.
    Source code and wiring diagram: curiousscientist.tech/blog/da...
    If the video was useful, please consider subscribing to my channel.
    You can buy the parts and help me at the same time by using my affiliate links: curiousscientist.tech/tools
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 144

  • @TalesTelles
    @TalesTelles 3 ปีที่แล้ว +1

    Hi @Curious Scientist,
    Thank you so much for doing this video, the explanation was sensational! Congratulations.
    Sincerely, Tales.

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Hi Tales! Thank you very much for the kind words! I am glad that you found it helpful!

  • @joshuaoduroadu5376
    @joshuaoduroadu5376 2 ปีที่แล้ว +2

    Thanks very much for such an in-depth explanation & guide to using an RTC to control the watering system using an Arduino. I'm currently working on a similar project and had been looking for a way to do exactly what you have done. You are a life saver!

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว +1

      Glad that my video helped you! Cheers!

  • @sunilkhare7491
    @sunilkhare7491 2 ปีที่แล้ว +2

    An excellent video and useful too. Many people upload the video but they hide key things like software. But you not only showed it in your presentation; you explained it nicely. Many many thanks for a nice video. The time spent on it was fruitful.

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      Thanks! You would enjoy my other videos too then, because I always try to make all details clear and I always explain the software I wrote line by line. Cheers!

  • @Randomd0g
    @Randomd0g 3 ปีที่แล้ว +2

    Thank you so much for making such an in-depth guide and tutorial! I'm a student designer and unfortunately I don't really know my way around electronics, so I'm really thankful that there are kind people like you who make stuff like this. I love the concept of arduino and stuff but I guess I just don't have much of an engineering mindset to learn more than the basics lol. I'm currently working through configuring this to work for a planter I'm making as a school project.
    Just saw a lot of comments only asking for help, so I just wanted to leave one as thanks :)

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Thank you for your nice comment! I am really happy to see that my tutorial is helpful for someone. If you get stuck, just leave a comment or message me. Have a great day!

    • @Randomd0g
      @Randomd0g 3 ปีที่แล้ว

      @@CuriousScientist thank you! I hope you have a great day too :)

    • @WonkOfWonkyness
      @WonkOfWonkyness 2 ปีที่แล้ว

      Me too rn lol.

  • @WonkOfWonkyness
    @WonkOfWonkyness 2 ปีที่แล้ว +1

    Man this is stupidly useful.

  • @ravigrai
    @ravigrai 3 ปีที่แล้ว

    Looks a very good implementation. Better to add the circuit diagram for much more clear understanding

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว +1

      Thanks! How about visiting my website before complaining? I have the circuit schematics there.

    • @ravigrai
      @ravigrai 3 ปีที่แล้ว

      @@CuriousScientist thanks. I will surely view your site. I am sorry if you felt that I am complaining. I just thought of putting it as a suggestion.

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      No worries, you don't need to say sorry. I just have noticed that a lot of people aren't watching my videos carefully enough and they aren't reading the description. And because of this they ask questions or make comments, however all the information they are asking for is already provided.

  • @harishnair2522
    @harishnair2522 ปีที่แล้ว +1

    Great video, had a lot of useful information. Thank you.
    I'm having an issue with the LCD display, for some reason I don't see any information on the screen only the backlight is ON. What could have caused it? Any guess or suggestions to look into the code.
    I understand if you are done answering such stupid questions. Once again thank you for the video.

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว

      Hi and thanks! It's very typical that the contrast is not adjusted properly. Try adjusting it using the potentiometer on the LCD.

  • @seshafarmspalmarosa1267
    @seshafarmspalmarosa1267 9 หลายเดือนก่อน

    Very clear instructions ,, if i want to run the pump for every 10 min from 6 to 6 , every day , what will be change in the code of interval pl let me know thanks ....

    • @CuriousScientist
      @CuriousScientist  9 หลายเดือนก่อน +1

      Thanks! You need to trigger the pump with the desired period. Just modify the code I published. I hope you don't expect me to write the code for you.

    • @seshafarmspalmarosa1267
      @seshafarmspalmarosa1267 9 หลายเดือนก่อน +1

      @@CuriousScientist i will do my trial , if needed i will take help from you... thanks for reply...

  • @yakuza79be
    @yakuza79be 2 ปีที่แล้ว +1

    Hi, thanks for your explanation and code. I’m a beginner and this info is real educational. Only one problem with the screen. Every second on clock makes screen blink. Strange no? Can you imagine what going on?

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      Hi and you're welcome! As you can see it on the video, I don't have this issue. I recommend you to disable all serial communication. You can try removing the section that I highlighted at 14:35.

  • @sijusivanadan1198
    @sijusivanadan1198 5 หลายเดือนก่อน

    Hi, well explained video. Only one doubt, is it possible to put multiple cycle for one day?. And if it could be controlled using a selection switch to alter timing as desired, it would have be very helpful.

    • @CuriousScientist
      @CuriousScientist  5 หลายเดือนก่อน

      Hi! Thanks! Sure, it is possible.

    • @sijusivanadan1198
      @sijusivanadan1198 5 หลายเดือนก่อน +1

      @@CuriousScientist Can you please convey how, I am total fresher in Arduino. A suitable link/ video explaining this would be helpful.

    • @CuriousScientist
      @CuriousScientist  5 หลายเดือนก่อน

      Hi! Just search for similar projects. I am pretty sure that someone already made it and published it somewhere. I don't have any resources as a reference. Also, you can just use my video. You can add more conditions that should trigger an action. But maybe for a total beginner, this is actually a too difficult project. You should start with something simpler.

  • @princessninajanecometa9412
    @princessninajanecometa9412 ปีที่แล้ว

    Very useful video! Thank you. I'm working on a program that will work on our product for our research defense, we didn't hire a programmer since its very expensive for us students to pay them. And currently, I'm having troubles with my program, is it possible that instead of turning the watering system off and on, but I will apply it to an LED that will fade at a specific time? In simple words, scheduling the LED to fade in and out at a specific time using RTC Module. I'm not very much of an expert when it comes to coding, can you recommend me examples that I can study with? I hope you can help me with this. And thank you for this video!

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว +1

      Hi! Sure it is possible, you just have to switch the LED instead of the relay. However, if you want it to fade in and out that's a different story. You then need to drive the LED with PWM. When you want to fade in, you ramp up the PWM, and when you want to fade out, you ramp down the PWM. For resources, the whole internet is there, just use Google.

  • @joaolacueva6827
    @joaolacueva6827 25 วันที่ผ่านมา +1

    Hi! Thank you, but I do have a question, on the 12v power supply.. how many amps? Thank you

    • @CuriousScientist
      @CuriousScientist  25 วันที่ผ่านมา

      Hi! It depends on the pump. Generally, they are 500 mA. So it's a good idea to use a 12 V, 1 A power supply.

  • @aaronsparrow4895
    @aaronsparrow4895 2 ปีที่แล้ว

    hi great tutorial! canthis also be edited easily for day of the week?

  • @TalesTelles
    @TalesTelles 3 ปีที่แล้ว +1

    Hi @Curious Scientist,
    Do you have any idea if it is possible to add a temperature sensor and if the temperature is below 50 fahrenheit, for example, it blocks the water outlet?
    Sincerely, Tales.

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว +1

      Hi! Yes, search for a so called "solenoid valve". You can switch them in the same fashion as you are switching the pump in this project: you put a relay between the microcontroller and the valve and switch the valve using the relay. You can add a simple thermometer such as the DS18B20 (I have videos discussing this particular thermometer, search it on my channel) and just write a single function which reads the thermometer and decides whether it should close the valve or not. It is just a few extra lines of code.

    • @TalesTelles
      @TalesTelles 3 ปีที่แล้ว +1

      @@CuriousScientist
      OK, solenoid valve, I'm going to research this. On the temperature sensor, I have a DHT11, which measures temperature and humidity. I don't have much knowledge in c ++, how would the code look? I thought something like this, but i don't know if this works:
      if (temperature)

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว +1

      @@TalesTelles Hi! The code is almost ok. It is good on the algorithm level, but the if condition has to be inside the parenthesis: if(temperature < 50). I guess, temperature is a variable that you use to store the temperature read by the DHT11. Make sure that you will use the proper units (Celsius, Fahrenheit...etc). Also, put an else after the if(). Why? Because if the temperature temporarily falls below 50, you will be locked in the "watering = false" state forever. So, the code would continue as else{watering = true;}. This will make sure that as long as the temperature is above 50, the watering stays enabled.
      BTW, your English is pretty good, don't worry! Greetings from Sweden!

    • @TalesTelles
      @TalesTelles 3 ปีที่แล้ว +1

      @@CuriousScientist OMG! Thank you so much! I will try this later and keep you updated.

    • @TalesTelles
      @TalesTelles 3 ปีที่แล้ว +1

      @@CuriousScientist I just added the changes to the code, here is a print: prnt.sc/1050tt1
      Unfortunately, I am without the arduino at the moment, so I will not be able to test = /
      - 20 is the temperature in degrees celsius

  • @diegofroesesouza2273
    @diegofroesesouza2273 3 ปีที่แล้ว +1

    Hi, I am creating a code for a irrigation system based on you code, thank u. I see you declared the switch variable "shitchstate" as an int, yet when you use the digital read function it returns high, how come it did'nt crash?

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Hi! Because high is also interpreted as 1, and low as 0. You can use the digitalWrite in the same fashion: either you use 1 or high, both will work.

    • @diegofroesesouza2273
      @diegofroesesouza2273 3 ปีที่แล้ว +1

      @@CuriousScientist Thanks! Very useful tool. It will irrigate a large area of mushroom production.

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      @@diegofroesesouza2273 You are welcome! I wish you a nice yield!

  • @TwinPlanet114
    @TwinPlanet114 ปีที่แล้ว

    Hi Curious Scientist. I have a question. How long can this stay continuously powered without a computer powering it, and how would I go about that? Thank you.

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว

      Hi! I used this exact circuit some years ago in my office to water my chillibplant and it was running from a wall adapter for roughly half a year.

    • @TwinPlanet114
      @TwinPlanet114 ปีที่แล้ว

      Thank you!

  • @ibrahimnabhan2592
    @ibrahimnabhan2592 3 ปีที่แล้ว +1

    what modifications will I need if I'm using a Uno?

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Everything is the same. They are practically the same microcontroller, but with different form factor.

  • @parshvtathed1643
    @parshvtathed1643 ปีที่แล้ว

    Excellent project
    But can watering system will work
    If we want , watering system to run
    after two , three months

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว

      Thanks. Yes, it is possible. My watering system was running for half a year without any issues. I used it to water my chili plant in my office at work.

    • @parshvtathed1643
      @parshvtathed1643 ปีที่แล้ว

      @@CuriousScientist means can I get watering after two month of gap with the help of rtc module

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว

      Sure, you just trigger the pump using the number of months as a condition. Or you keep track of the elapsed days and trigger after every 40 days. The possibilities are endless.

    • @parshvtathed1643
      @parshvtathed1643 ปีที่แล้ว

      @@CuriousScientist Thank you Sir
      Can you please give code of it to me

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว

      Sure, you can hire me for writing the code. But of course not for free.

  • @yudhobaskoro8033
    @yudhobaskoro8033 3 ปีที่แล้ว +1

    can i just use the relay and the RTC ?, cos i really dont wanna mess with the LCD, cos it'll be outside exposed to the elements

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Yes, absolutely! Just comment out the lcd related code.

    • @yudhobaskoro8033
      @yudhobaskoro8033 3 ปีที่แล้ว

      @@CuriousScientist nice will try ur code soon, but i wonder, if i just do a loop for 23 hour, can it work as well as an RTC tho

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      @@yudhobaskoro8033 you can eliminate the RTC entirely and just use the millis() for counting. Keep in mind that the millis() will overflow after a certain value. I don't remember exactly but it's several weeks.

  • @ROHAN-PATIL
    @ROHAN-PATIL 3 ปีที่แล้ว

    Which rtc module you used DS1307 or DS3231? I have DS3231 will the code work with ds3231 rtc module?

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว +1

      Watch the video more carefully...

    • @ROHAN-PATIL
      @ROHAN-PATIL 3 ปีที่แล้ว +1

      @@CuriousScientist thank you so much its working🙏🏻 I am totally new in this field. This electronic field is very much interesting i am trying to learn new thing and c++ language is one of them. Thank😃🙏🏻

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว +1

      Thanks. I guess sometimes it worth, to actually watch the video. In this case, it was just 59 seconds into the video for the answer. ;)
      Arduino is excellent tool for this approach to learn electronics and C/C++ languages to a certain extent by actually having fun. I hope you'll enjoy your journey.

  • @kensee9991
    @kensee9991 2 ปีที่แล้ว

    what RTClib did you use ? can i get the link

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      The default one that you can download in the Arduino IDE. Just search for the name of the module in the library manager.

  • @user-tr6co8mw4j
    @user-tr6co8mw4j 3 ปีที่แล้ว +3

    So the date and time of RTC set automatically from computer date and time?

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว +1

      Yes, when you upload the code to the Arduino, the time of the computer will be transferred to it and the RTC module will use that time.

    • @user-tr6co8mw4j
      @user-tr6co8mw4j 3 ปีที่แล้ว +1

      @@CuriousScientist thank you very much for your fast and kind reply
      I will try it update you with my test.
      Your way of explaining is very great and I will subscribe to your great channel

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Thank you very much! Your subscription is very appreciated! I am glad that my way of explanation helped you to better understand this topic.

  • @ragilagnasabil
    @ragilagnasabil 3 ปีที่แล้ว +1

    can i change the pump with solenoid valve? would it change power needs?

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว +1

      Hi! You can do that, they draw roughly the same current (~300-500 mA). But ultimately, it all depends on the relay you choose and the power you switch with the relay. If you change the input voltage, you might need to reconsider the whole circuit. In this demo I was relying on the power regulator on the Arduino, so I could use the 12 V input to power both the controlling electronics and the motor. I just used a 12 V, 2 A adapter if I remember correctly. However, if you would go above 12 V, this would not work because the maximum allowed input voltage on the VIN pin on the Arduino is 12 V. I noticed that many people try to power the electronics from their Arduino board so I want to emphasize, that the motor is NOT powered via the Arduino. The Arduino only switches a relay which then allows the pump to use the power from the 12 V rail and pump the water.

    • @ragilagnasabil
      @ragilagnasabil 3 ปีที่แล้ว +1

      on arduino code u use rtc_ds1307 but u recomend to buy ds3231 on youtube description
      the question is would it work with the same code that u give in website?
      if i use ds3231

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว +1

      From coding perspective, they are the same. You can use whichever is available for you! :)

    • @ragilagnasabil
      @ragilagnasabil 3 ปีที่แล้ว +1

      thanks for helping bro

  • @Hector.Bosoanca15
    @Hector.Bosoanca15 4 ปีที่แล้ว +2

    Can you post the wiring diagram, please! Thank you!

    • @CuriousScientist
      @CuriousScientist  4 ปีที่แล้ว +2

      Hi! I cannot post a drawing right now, but since you are not the first, I will start including them in my future videos. I thought it is easy to reverse engineer it from the video and the discussion about the code, but seems like it is not always the case.
      So, I write it down:
      Both the LCD and the RTC are I2C devices, so, their pins are shared: VCC and GND is obvious, I think; SDA: A4, SCL: A5.
      The relay's GND and VCC is obvious, the IN is also obvious, it is in the code and it is called 'relaypin' (which is D2). The relay is open by default and it will close the circuit when it is triggered by the Arduino.
      Switch: Also in the code: D3 pin. The D3 pin is directly connected to the GND by a 1k (pull-down) resistor to avoid floating. The other side of the switch goes to +5V.

    • @Hector.Bosoanca15
      @Hector.Bosoanca15 4 ปีที่แล้ว +1

      @@CuriousScientist Thanks a lot!!!

    • @CuriousScientist
      @CuriousScientist  4 ปีที่แล้ว +2

      @@Hector.Bosoanca15 You are welcome, I am glad that I could help!

  • @kensee9991
    @kensee9991 2 ปีที่แล้ว

    ill try your code but, when the pump is after that the lcd goes blank? what should i do?

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      It should not turn off. Maybe you made a mistake somewhere. Do you power the pump with an individual power supply?
      By the way, I am not a free support service, I cannot answer every single questions for free.

  • @TwinPlanet114
    @TwinPlanet114 ปีที่แล้ว

    Hello again Curious Scientist. I have another question. If I want this to water my plant once a week, on Friday, how would I do that? I have minimal C++ coding experience, sorry.

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว

      Hi! The code or the real-time clock is not really aware of the calendar days, but only the date. So, somehow you have to tell the code the day when you upload it to the microcontroller. Then you know the day of uploading and the difference until a Friday. Then you just define a weekly period from the first occurring Friday and trigger the watering every week.

    • @TwinPlanet114
      @TwinPlanet114 ปีที่แล้ว

      @@CuriousScientist Okay… so how would I go about that? I’m sorry, I know very little C++.

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว

      Sorry, but I won't write the code for you for free. I don't have the time and resources just to provide a ready made code.

    • @TwinPlanet114
      @TwinPlanet114 ปีที่แล้ว

      @@CuriousScientist Sorry, but that’s not what I’m asking for. Just a place where I could find information on how to do that.

    • @CuriousScientist
      @CuriousScientist  ปีที่แล้ว +1

      Oh. Google is your friend then. :)

  • @user-tr6co8mw4j
    @user-tr6co8mw4j 3 ปีที่แล้ว +1

    what if I remove the switch and want it start watering in 9 AM for 6 second also each hour will start again for 7 times what is the code please

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      You just have to modify the code that I supplied according to your own requirements. It is relatively simple. I am sorry, but I will not write a code for you for free.

  • @roboscan5238
    @roboscan5238 2 ปีที่แล้ว

    good

  • @kensee9991
    @kensee9991 2 ปีที่แล้ว

    hi can i use 220v pump instead of 12V

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      Hi! Yes, but make sure you choose a suitable relay. But I wouldn't risk using 220 V if it's not necessary.

    • @kensee9991
      @kensee9991 2 ปีที่แล้ว

      @@CuriousScientist what relay module can i use

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      Whichever that fulfills the pump's and the microcontroller's parameters.

  • @ejfreyra6054
    @ejfreyra6054 2 ปีที่แล้ว

    What if i do not use a switch? I just only set thr time when to irrigate. Can u help me about the code?

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว +1

      Nothing should happen if you omit the switch. The switch is only used if you want to have a "forced" irrigation.

    • @ejfreyra6054
      @ejfreyra6054 2 ปีที่แล้ว

      Bro, what library did u used to this code?

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      First of all, I am not your "bro". Second, I shared all the resources in my video and on my website. Take your time, watch the video and read my published material.

  • @IzumiKai18
    @IzumiKai18 3 ปีที่แล้ว

    Hello!! i have so many questions!, please how can i talk to you about in this project. i dont want my project to go on waste. please help me...

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Hi! You can ask it here so others can also learn from the questions and the answers. You can also reach me privately through my website, but keep in mind that I am not a free support service.

    • @IzumiKai18
      @IzumiKai18 3 ปีที่แล้ว

      Hello!! I just want to ask
      What if i used arduino uno ? Same wirings ?
      Can you help me ? This project is the same as mine, but the other feautres is that there is LED LIGHT connected to RTC module
      Sample
      When the time is at 8 am the punp will start and close after a seconds then when the time is at 7 pm the led light will turn on and the pump will turn on
      Purplse of the led light: like you can see at fountains ? To see that tge watering system is activate

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      The wiring depends on you. Just check which are the i2C pins on the Uno. The switch and the relay pin actually depends on you, you can assign any pins.
      Why would put the LED on the RTC? It does not make sense to me. Switch the LED from one of the Arduino's pin.

    • @IzumiKai18
      @IzumiKai18 3 ปีที่แล้ว +1

      @@CuriousScientist no the LED im talking about, it is placed beside or within the sprinklers so that the light from big LED you can see the sprinklers are turn on if its night time

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Ah, sorry I misunderstood it. So something like a floodlight. I recommend to use a separate relay for it, especially if you supply different voltage to it than to the pump. You still switch the relay with the Arduino, but a different one.

  • @giovino7935
    @giovino7935 2 ปีที่แล้ว

    What's the code without the lcd screen?

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      It is the same but without the lcd-relevant parts.

  • @devildevil873
    @devildevil873 2 ปีที่แล้ว

    Sir can u plz . make this type by using nodemcu esp8266 plz .. 🙏🙏🙏🙏🙏

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว +1

      Hi! You can use Arduino IDE for the above mentioned MCU, so this code should be more or less compatible with it.

    • @devildevil873
      @devildevil873 2 ปีที่แล้ว

      @@CuriousScientist yes sir but company told us to use mcu only 😅 can u plz...help me in coding 🙏🙏

    • @devildevil873
      @devildevil873 2 ปีที่แล้ว

      @@CuriousScientist how can I contact u

    • @devildevil873
      @devildevil873 2 ปีที่แล้ว

      @@CuriousScientist actually we have to create smart lighting system which will turn on and off according to time and my 80% project is ready only that timing fiction is remaining plz..help sir 🙏🙏🙏

    • @CuriousScientist
      @CuriousScientist  2 ปีที่แล้ว

      Sorry, but this is not a free technical support service.

  • @Riteshkumar-hb8vl
    @Riteshkumar-hb8vl 3 ปีที่แล้ว +1

    hii @curious scientist
    i installed new battery to my rtc module refreshed the current time when i i power off my project the time reset to when it was complied
    then i even changed my rtc module then too the problem continues
    pls help me

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Hi Kumar! In order to refresh the time in the RTC after you changed the battery, compile a fresh version of your code and upload it to the Arduino. The RTC always keeps the time compared to the time of the most recent upload of the Arduino code. So, just reupload your code and it should work. Check my code, there is a line like "if(!RTC.isrunning())"... Read the comments there how to do everything properly.

    • @Riteshkumar-hb8vl
      @Riteshkumar-hb8vl 3 ปีที่แล้ว +1

      @@CuriousScientist yes I did this and the time refreshed but when I power off and again on my project the time doesn’t save and it starts from the default time

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      If you don't power off the RTC, it shouldn't happen. Are you sure that the battery is good?

    • @Riteshkumar-hb8vl
      @Riteshkumar-hb8vl 3 ปีที่แล้ว

      @@CuriousScientist the I bought yesterday from an electronic shop and I checked the Voltage in multi meter it was 3.11 volt

    • @Riteshkumar-hb8vl
      @Riteshkumar-hb8vl 3 ปีที่แล้ว

      And it’s my 3rd rtc module I bought for this project but the problem didn’t solve

  • @rochelletimosa4060
    @rochelletimosa4060 20 วันที่ผ่านมา

    how to add 2 times watering in a day? like int wateringhour = 9 am and 5 pm??

    • @CuriousScientist
      @CuriousScientist  20 วันที่ผ่านมา

      Hi! You just write two conditions which trigger the pump.

    • @rochelletimosa4060
      @rochelletimosa4060 20 วันที่ผ่านมา

      @@CuriousScientist like int watering = 9; int watering = 10 like this??

    • @rochelletimosa4060
      @rochelletimosa4060 20 วันที่ผ่านมา

      @@CuriousScientist you use ds3231 in actual but in code you use ds1370 rtc?

    • @CuriousScientist
      @CuriousScientist  20 วันที่ผ่านมา

      RTC should not matter too much as long as you get the same information out from it. Regarding the other questions, those are wrong. You declared the same variable twice just with different values.

    • @rochelletimosa4060
      @rochelletimosa4060 20 วันที่ผ่านมา +1

      Thank you

  • @johnrysononez2447
    @johnrysononez2447 3 ปีที่แล้ว

    sir what if I set the code to just trigger the watering system once a week . how do I do it? thank you sir

    • @CuriousScientist
      @CuriousScientist  3 ปีที่แล้ว

      Hi! You run a counter which is increased by 1 every 24 hrs. When its value is 6, you run the watering and reset the counter to 0. Simple!