DS3231 Real Time Clock + Temperature Sensing using Arduino

แชร์
ฝัง

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

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

    Great video. You mention that you will do a video of the 32K memory on this module as well. In case you did, do you have the link to that?

  • @BlackWindowsBW
    @BlackWindowsBW 8 ปีที่แล้ว

    Happy new years man!

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      haha thanks! Happy New Year!

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

    thanks a lot for the well explained video.... helped ! :D

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      +Sakib Ahmed Glad it did! :)

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

    man you are amazing thank you very much

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

    Nice one!
    Could you maybe do a video on outputting the time and date from the RTC to an LCD screen? :)

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

      Sure thing! I have exams early this week but Wednesday or so look out for it! :)

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

      Awesome, I look forward to seeing it! Hope the exams go well! :)

    • @AndreiAldea
      @AndreiAldea  7 ปีที่แล้ว

      Thanks!

  • @gauravshrivastava773
    @gauravshrivastava773 7 ปีที่แล้ว

    nice dude. very nice

  • @faizazlan30
    @faizazlan30 4 ปีที่แล้ว

    Thanks.. It working

  • @bwack
    @bwack 8 ปีที่แล้ว

    lol. I get large packages too from ELFA. Sometimes they send the 11th item in a second package. Two times they've sent 5-10 SMD LEDS later that they didn't have in stock to begin with. So they send 5 smd 0806 size leds in a large box....... Sometimes I wonder if they use a robot to pick and pack. :D That module is quite useful. Do you plan to use it for datalogging? It has a nice EEPROM on it for that. :) Thanks for the video on this module.

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      Haha yeah a lot of companies do that but how do they still make money after shipping costs... and kind of yeah. I'm still working on that open source RC transmitter and I needed a way to store data. going to use this as a backup for SD card saved settings.

  • @Ronshaw100
    @Ronshaw100 4 ปีที่แล้ว

    Hi, Please will you upload the other two small video you mentioned in your DS3231 video, or let me know where i can find them. thanks

    • @AndreiAldea
      @AndreiAldea  4 ปีที่แล้ว

      Hey, I never actually made them. I don't remember what videos I said I'd make. How can I help?

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

    Ultra nice

  • @AntonioJoseAValerio
    @AntonioJoseAValerio 8 ปีที่แล้ว

    Hi, one little question about that battery. That module is supposed to recharge the battery it carries, so if that is a CR2032 it should explode in a few days of use... Shouldn't a LIR2032 Li-Ion 3.6V 40mAh be the right option?

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      hey, the way I understand, on page 9 of the datasheet under the Vbat pin description I believe they state that the chip has a way of telling if a battery is rechargeable or not in order to prevent reverse power. you could use it with a lithium source indeed though, and it would probably be better for most applications since if power is removed you would always have a full backup battery.

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

    Second part of the video?

  • @jamie405
    @jamie405 7 ปีที่แล้ว

    Thanks for the video. When reading the time I get (for instance) 23:36:1 any single digit (depending on the time) doesn't have a leading zero. How do I get a leading zero on H, M, and seconds? The library I'm using is Sodaq_DS3231.h (If that matters). Please help me.

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

      You can do an If statement for example, such as if(now.hour < 10){ Serial.print('0') } Which would add a zero, it just depends where you put it in your code, so make sure the order is correct. Does this make sense? You'd do this for hours, minutes , seconds etc.

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

      Thanks.... Works perfect now. :)

    • @AndreiAldea
      @AndreiAldea  7 ปีที่แล้ว

      Glad to be of help!

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

    what kind of batttery does it use, is it just a regular watch battery?

    • @AndreiAldea
      @AndreiAldea  5 ปีที่แล้ว

      Taran Agnew yeah it's a normal CR32 (I believe off the top of my head)

    • @taranagnew436
      @taranagnew436 5 ปีที่แล้ว

      and its the CR2032 battery, right?

    • @AndreiAldea
      @AndreiAldea  5 ปีที่แล้ว

      Taran Agnew yes

  • @archiecapina3678
    @archiecapina3678 8 ปีที่แล้ว

    ..thank you sir it works

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

      Glad to be of help :)

  • @jjtg27
    @jjtg27 6 ปีที่แล้ว

    i just dont know what is happining but as soon i conect the cables (SCL one) it just turn my # 3 pin on my arduino leonardo, and last time it just make some efect on my lcd screen..... do u have any idea of what i am doing wrong?

    • @AndreiAldea
      @AndreiAldea  6 ปีที่แล้ว

      What do you mean by "turn your #3 pin"? It's worthwhile looking at the code to make sure that the DS3231 doesn't have the same I2C Adress as your LCD screen (that I assume is also i2C?)

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

    By removing a couple of resistors and clipping the vcc leg you can reduce the current draw on these modules from 100uA down to 5uA. This power saving modification is quite useful for data logging applications:
    thecavepearlproject.org/2014/05/21/using-a-cheap-3-ds3231-rtc-at24c32-eeprom-from-ebay/

  • @mitropoulosilias
    @mitropoulosilias 6 ปีที่แล้ว

    where is the lcd?

  • @yusifcelalov2017
    @yusifcelalov2017 8 ปีที่แล้ว

    I have some question. what is old_ts? why u write after if (old_ts == ts || old_ts!=ts), old_ts=ts?

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      +Yusif Celalov TS stands for Time Since, and it's simply used to measure time since UNIX Epoch time. Old_ts is used to count what the last recorded time value of TS was.
      The reason that line of code exists is so that the code doesn't print to the serial console as fast as the processor runs. Because we make sure that we only print if TS isn't the same value as previously, we make sure that we have some delay in between the print.
      So what we do is:
      old_ts = 0 initially
      ts = 512 for example (in reality this is a huge number, as it's counting seconds since 1/1/1970)
      then we check: is old_ts = 0 (uninitialized) OR is old_ts NOT the same value as our current reading?
      This means that if either condition is satisfied, we go ahead and set old_ts to our current value of ts to signify that the data has been read at this time, and we continue to actually print out the rest of the times (see how this part is all nested in the IF statement).
      All of this could easily be done with Arduino's Delay or even Millis functions, but those rely on the internal clock of the Arduino, which is less accurate than a dedicated RTC.
      Let me know if all of this makes sense of not!

    • @yusifcelalov2017
      @yusifcelalov2017 8 ปีที่แล้ว

      +Andrei Aldea thx much

  • @nandinijayasimha6889
    @nandinijayasimha6889 7 ปีที่แล้ว

    I followed all the steps exactly but whenever I disconnect the power the time is resetting to 2000. I am using Arduino uno. What could be the problem?

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

      Nandini Jayasimha are you sure the watch battery is put in the correct way? the real time clock won't hold time if it's not getting power at all times.

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

      Andrei Aldea thanks a lot! It worked once I changed the polarity of the battery.

    • @AndreiAldea
      @AndreiAldea  7 ปีที่แล้ว

      Nandini Jayasimha glad it works! good luck !

  • @fantasticphil3863
    @fantasticphil3863 6 ปีที่แล้ว

    Can you publish your code? I can't find it anywhere!

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

      Phillip Shcherbakov it’s the “now” Example of the library, comes with it by default

    • @fantasticphil3863
      @fantasticphil3863 6 ปีที่แล้ว

      Thanks! I'm trying to use this chip to make an automatic christmas light controller. The idea is to smash this code, some code to control a relay, and some code to read an IR sensor together. It's my second arduino project, so it probably won't go very well.

    • @fantasticphil3863
      @fantasticphil3863 6 ปีที่แล้ว

      It doesn't seem to be working. I've found the library in the Arduino contents, but the 'now' example is a .pde file, which won't open in Arduino. Is there a way to open the 'now' example inside the Arduino application?

    • @AndreiAldea
      @AndreiAldea  6 ปีที่แล้ว

      Phillip Shcherbakov that's rather strange... It doesn't show up under, File -> Examples? I'm away from the computer right now but I'll try to give you a hand when I get back if you still havent figured it out

    • @fantasticphil3863
      @fantasticphil3863 6 ปีที่แล้ว

      Ok, I've found it now. At first I was looking at the files that make up Arduino, but I've searched around the menu bar in the arduino application, and I found it. Great video, by the way!

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

    @0:30 it's DS3231 not 2331 :)

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

      +Stephen Garner Haha yeah I realize, you say it enough times and the numbers rotate in your head :D

  • @MohamedFazilsulaiman
    @MohamedFazilsulaiman 8 ปีที่แล้ว

    Can't it work in 9600 baudrate

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      Yes, you can use whatever baud rate you want. the Serial baud rate is only limited if you're using a serial device. in this case this is i2c, so our baud rate doesn't matter as long as both our computer and arduino sketch have the same value!

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

    Ironically supplying the air inside gives the fire all the oxygen it needs to really get going on the cardboard.

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      +ArcanePath360 Indeed!

    • @yankey4
      @yankey4 8 ปีที่แล้ว

      Ok so I am 100% newbe with Arduino. I know some C++ and get Ac and DC well. What I am looking to do is run a servo to open a small door and close the door at 3 set times a day 365 days a year.
      I know this is asking a lot. Would you be willing to help me with a sketch that would do tho's things I need. I am going to be using the same RTC and a uno to start off with.. I will after gettting it down go to a nano but thats some time out from now.
      What I will do for you is give you a shout out for helping me. I do not have a lot of subs 1200 or so but I know few will come over.
      If you can't that's fine as well thanks for your time. God Bless.

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      Hey Yankey,
      Check this out: gist.github.com/Grippentech/216cc81a54761bf510df21497802843c
      It should do exactly what you want, but if anything is unclear or doesn't work, just comment on the Gist and I'll do my best to help you.
      Cheers!

    • @yankey4
      @yankey4 8 ปีที่แล้ว

      ***** BROTHER THANK YOU!! This looks like it will work. Iwill get back with you n the update soon.

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      +yankey4 sure, no worries man! Glad to help

  • @thepcmrtim
    @thepcmrtim 8 ปีที่แล้ว

    A y y l m a o

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      :D

    • @thepcmrtim
      @thepcmrtim 8 ปีที่แล้ว

      +Andrei Aldea was good homie

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      +madvillain good good. what about you Peter :D

    • @AndreiAldea
      @AndreiAldea  8 ปีที่แล้ว

      +madvillain long time no see haha

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

      +Andrei Aldea writing code in a text editor and eating once a day lmao

  • @RapidBoss08
    @RapidBoss08 4 ปีที่แล้ว

    DS3231* not DS2331

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

    what ever prompted you to check the temperature by shooting the chip ? this is dumb. do you live on the chip ? no, you live in the room. you should have checked the room temperature and then compared it to what the sensor said.

    • @AndreiAldea
      @AndreiAldea  7 ปีที่แล้ว +6

      Well for one thing, what mattered in the test is the accuracy of the temperature-compensated crystal, if it reported 23 degrees but was actually running at 30 that would be a bit of a problem. The chip itself is not percivably hotter compared to room temperature, so it's not completely unreasonable to think it's a good rough estimate of the ambient temperature. Yes I should have also checked ambient temperature, but for the sake of the experiment what I did isn't pointless.
      If we could keep things civil that would be great. :)