SOLVED: DS3231 Not Retaining Time After Reset or Shutdown

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ส.ค. 2020
  • How to make RTC retain current time.
    How to solve DS3231 correct time problem. how to program rtc. rtc and arduino
    Common problems with RTC is not getting the current time when the module is reset or has been shutdown. This video discusses some solution.
    files needed for this project, libraries and sketch
    github.com/myonline88/DS3231_RTC

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

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

    Thanks for this tutorial. It helped a lot with my project

  • @war4tek
    @war4tek 8 หลายเดือนก่อน +1

    Thank you! You helped me with my issue. I appreciate it.

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

    Thanks alot...I knew the issue had to be the code but wasn't sure exactly what. Most answers from stackoverflow and google generally say the battery or the module is the issue so this is really helpful.

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

    Thank you! Fixed my issue 💯

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

    Thanks bro,nice tutorial & perfectly working

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

      You are welcome bro. Happy Arduino programming.

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

    Good job two day i wasted my time God bless you

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

    This was really helpfull! Thanks you are the man!

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

      You're welcome. Thanks for watching my video

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

      If itt loses correct time after you unplugged it, power it again and let it Turned ON for several hours or even a day or more. It will retain its correct time.

    • @Alexander-re8vz
      @Alexander-re8vz 2 ปีที่แล้ว +1

      @@myonline88 Hello, just wanted to know is there any way to solve the same issue with rtc ds1307 module

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

      It could be possible. But I haven't tried it yet. I got busy with work and haven't have time experimenting on other module type.

    • @Alexander-re8vz
      @Alexander-re8vz 2 ปีที่แล้ว

      @@myonline88 Ohk, np.

  • @sanjaykhurana3400
    @sanjaykhurana3400 7 หลายเดือนก่อน

    Laptop. No mobile. Par. Hoga. Kay.

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

    Thankyou so muuuch!!!

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

      You're welcome. Thanks for watching my video.

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

    Hello. my projext is uploading fine but nopt counting up? so the current time gets uplaoded but then serial monitor does not count up. can someone please assist many thanks

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

    added the libraries; however, I get the error code: 'class DS3232RTC' has no member named 'lostPower'?

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

      The Library used in this projects is for DS3231 RTC module. Maybe you used DS3232 rtc module. If so, you need to search the net for ds3232 module and download its library. Also, the codes I have given here may or may not work with your ds3232 rtc module.

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

    I want to use CASE and Switch to make every day's timining unique. Can't seem to get a DAY out of the library (such as SUN, MON, TUE or even Day 1, 2, 3) , looked at and tried the key words but could not get just a DAY to function. Any ideas?

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

      I've been trying to figure that out too for many weeks now. Thank you for watching my video. Please tell me if you found a solution.

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

      @@myonline88 There are so many RTC libraries to choose from, perhaps another might provide the function. I may just try to include the Grove 1307 Library, it has a nice DAY function.

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

      @@myonline88 Day is DOW not day

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

    Hello, what do I add to the code to include a 2nd relay, ive tried const int relay2, pinmode(relay2, output), ive tried changing the If statement Onhour2 to relay2, etc. all kinds of different configurations but it always conflicts somehow, is it not possible to add another output pin? works fine for one relay, but I need more than one.. Im probably just missing something simple.. Thanks

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

      Then add another instance of digitalWrite(relay2, HIGH);
      in the main loop section

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

      @@myonline88 I did that but fir whatever reason one relay will come on and then the other off , then the opposite, I wonder if it has something to do with the Arduino timers conflicting. Ive even tried different pins on different timers, does it need to have "const int relay1=2" can it just be an "int"?

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

      You should use separate digital pins. Yes, you can use int.

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

      You should also use a transistor connected from Dpins to the relay to turn on/off the relay

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

      @@myonline88 I figured it out, it wasnt the coding, I had the 2nd relay set manually to trigger LOW, not sure when I swapped the bridge connector, but it explains why it was turning off when the circuit was going to 5 volts. I did have it on 2 different digital pins. Thanks for respond
      sing though

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

    Does this only works on a Arduino that is going to be connected to a PC to get the time? Im having the same problem but i need to operate my arduino uno with a 5v power supply not a pc.

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

      No. It has it's own Real Time Clock. Once you programmed it, as long as it has battery and is constantly powered ON, it will retain it's time. But when it is turned off for few minutes, it will lose its correct time. You may need to re-program it again.

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

      @@myonline88good video thanks... you are using the coin battery ...then y its not updating the time...I

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

      Allow it powered on for at least 24 hours or more. That way, it may retain it's updated time for a longer period of time. If you only powered it for few minutes and then power if off, it will normally lose its current time.

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

      @@myonline88 i Googled about this function rtc.adjust() function....this function actually takes the value from p.c while compilation ....but you are telling it will retain the time ...so am getting confused

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

      @@myonline88 I have issue retaining the RTC time , do we need to run this module 24 hr or more to retain the time or to remember time

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

    Sir your title is : SOLVED: DS3231 Not Retaining Time After Reset or Shutdown.
    I am using DS1307, it freeze at random time, while running and there is no further increase in time.
    I mean time on display suddenly freeze.
    sometimes if freeze after 8 hour , sometimes after 1 day. Even I switch-off the board and again switch-on. still it is freezed.
    after further investigation. I find out this message "RTC is NOT running!"
    please help.

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

      Check if the battery is good and your connections are correct and reliable.

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

    When I save time in ds1302 don't save in it

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

    Will this code run the device connected everyday for the specific time

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

      Or need to upload everyday

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

      No need to upload everyday. It will run the code as long as the Arduino is permanently powered on. If the circuit is disconnected from power supply for a long period, the time.may not be current. If that happened, check it and re-upload the code if necessary.

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

    My DS3231 increase 2 mints daily. Any one now solution.plz help

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

      Try to update the system date on your pc, then reprogram your DS3231. If it doesn't solve the problem, please try another module. I had some problems in my module too. Trials and errors solved it

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

    you didnt show the connection diagram. its bogus

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

      Whatever you want to say. For others here who watched it and made it work, it's not bogus. Maybe you just didn't know yet how to connect the VCC, GND, SDA, SCL and INT and a single digital pin from Arduino and a few patience in reading the codes specially the pin assignments when it is clearly written in the codes from the github link I have given in the description box.

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

      @@myonline88 Thanks bro. I found this video. I've been looking for a solution for this same problem. It worked. My pet feeder prototype project is working well now.

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

    __DATE__ and __TIME__ are date and time when you compiled and uplaod the sketch on arduino. I'm sorry but you haven't solved the problem.. I solved it by adding the following lines of code after rtc.begin():
    // clear /EOSC bit to ensure that the clock runs on battery power
    Wire.beginTransmission(0x68); // address DS3231
    Wire.write(0x0E); // select register
    Wire.write(0b00011100); // write register bitmap, bit 7 is /EOSC
    Wire.endTransmission();

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

      Hello. my projext is uploading fine but nopt counting up? so the current time gets uplaoded but then serial monitor does not count up. can someone please assist many thanks

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

      Yes it will as long as the coin battery is good and usable.