Тёмный

How to use Arduino Real Time Clock module with DS1302 chip 

Taste The Code
Подписаться 10 тыс.
Просмотров 29 тыс.
50% 1

In this video, I'm going through the basics of how you can connect and interface a Real-Time Clock (RTC) module based on the DS1302 IC with Arduino.
A Real-Time Clock, or RTC for short, is an integrated circuit that keeps track of time. It uses a backup battery to maintain time in the event that the main power source is removed.
Additionally, I go over the principle of operation of this chip and why it is required in certain types of projects where time tracking is vital.
The code used in this example can be found in the Instructable for the project:
www.instructables.com/Real-Ti...
The library used in the example is Rtc By Makuna
www.arduino.cc/reference/en/l...
Tools and materials used in this video:
NodeMCU Development Board - s.click.aliexpress.com/e/_mOv...
DS1302 RTC Module - s.click.aliexpress.com/e/_9vbjPg
Mini Breadboards - s.click.aliexpress.com/e/_9vg9cK
Jumper Wires - s.click.aliexpress.com/e/_AZwpjC
CR2032 Battery - s.click.aliexpress.com/e/_9fZL2e
Alternate links on Banggood:
NodeMCU Development Board - s.click.aliexpress.com/e/_mOv...
DS1302 RTC Module - www.banggood.com/custlink/KKD...
Mini Breadboards - s.click.aliexpress.com/e/_ol4...
Jumper Wires - www.banggood.com/custlink/KG3...
CR2032 Battery - s.click.aliexpress.com/e/_9fZL2e
Support my work on Patreon so I can continue producing free content and tutorials!
/ taste_the_code
My recording gear:
GT10 Pro 5G Android Phone - s.click.aliexpress.com/e/_oDn...
Dragon Touch 4K Action Camera - s.click.aliexpress.com/e/_mrc...
USB Condenser Microphone - s.click.aliexpress.com/e/_mq5...
Tripod - s.click.aliexpress.com/e/_ooa...
Phone tripod mount - s.click.aliexpress.com/e/_s9WaiJ
How to use Arduino Real Time Clock module with DS1302 chip
#arduino #rtc #realTimeClock #electronics #tastethecode
Main Site and blog: www.tastethecode.com
Facebook: / tastethecode
Instagram: / taste_the_code
Twitter: / taste_the_code
Get exclusive Taste The Code t-shirts and merch at
teespring.com/taste-the-code
Click on the link below to get two months of free premium access to Skillshare and start learning today!
skl.sh/37LnRua
Get $50 off your order on hosting for all of your website needs and learning projects on Dreamhost!
www.dreamhost.com/r.cgi?24057...

Наука

Опубликовано:

 

25 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 45   
@anokhautomation4453
@anokhautomation4453 2 года назад
👍nice useful tutorial. Please create more projects with rtc module. 👌
@TasteTheCode
@TasteTheCode 2 года назад
Thanks! Will do definitely!
@GoodVibesToUsAll
@GoodVibesToUsAll 3 года назад
Great information and nice work. New subscriber
@TasteTheCode
@TasteTheCode 3 года назад
Thanks and welcome 👍👍👍
@AminahAbdi1
@AminahAbdi1 Год назад
this one help me creat a real time clock module using RTC thank you
@TasteTheCode
@TasteTheCode Год назад
👍👍👍
@Equalizer-ZA
@Equalizer-ZA 3 года назад
Hello Bill .....im from South Africa and my sons do online racing I am interested in developing a gearshift device which they can use as a gear shifter on either side of their steering wheels. They currently use ordinary switches but the more complex wheels use Hall Sensors. How can i get more in touch with you to possibly help me to change the switches out for Hall sensors .......
@TasteTheCode
@TasteTheCode 3 года назад
Hey Robert, I don't usually do personal help on projects but my I would suggest that you mount a magnet on the lever of the shifter and then, behind it you can mount the hall effect sensor. You will need one that detects presence of a magnetic field and not the ones that work as on/off switches (detect magnetic polarity). Feel free to contact me through my Facebook page.
@akk5830
@akk5830 3 года назад
Thanks a lot
@TasteTheCode
@TasteTheCode 3 года назад
You are welcomed!
@krisr5497
@krisr5497 6 месяцев назад
This is very well explained, thank you. But I am wondering - you said the battery is being (trickle)charged (0:45). The battery you are using is not rechargeable. Could that be a problem?
@TasteTheCode
@TasteTheCode 6 месяцев назад
These batteries are all based on lithium so I guess some small current does not harm them. So far I haven't had a problem at all.
@dwikiadityairfan6339
@dwikiadityairfan6339 3 года назад
Tambahan program untuk lcdnya bagaimana ya bg?
@TasteTheCode
@TasteTheCode 3 года назад
Check my other videos. I already published one for the LCD.
@m0kcun
@m0kcun Год назад
I hve problem. I first upload the code using cable. Then i unplug it and using battery 9v to it. Btw mine use arduino uno. It doesnt updatind new time. Example i run on 9.00 (10/6/2023) and when i unplug and connect the battery at 10.00 the same day it just show the 9.00am one not the updating
@TasteTheCode
@TasteTheCode Год назад
I had that once happening to me as well but with a low-voltage battery on the module. I replaced it with a new battery and it never happened again.
@m0kcun
@m0kcun Год назад
@@TasteTheCode okay i wil try use new battery. THANKSSSS
@Francesco-bu1hh
@Francesco-bu1hh 2 года назад
Hi, is there a way to get the day of the week?
@TasteTheCode
@TasteTheCode 2 года назад
There is a function on the library called DayOfWeek() that returns 0-6, where 0 is Sunday, 1 is Monday, etc.
@Francesco-bu1hh
@Francesco-bu1hh 2 года назад
@@TasteTheCode Thank you. I have been viewing your channel recently. It is very interesting.
@TasteTheCode
@TasteTheCode 2 года назад
Thank you! I'm glad that you like it!
@agilalfarizal
@agilalfarizal Год назад
Apakah RTC 1302 bisa terhubung dengan esp 32 cam untuk penjadwalan pengambilan photo dan dikirimkan ke telegram jika bisa menggunakan pin yang mana mohon bantuannya
@TasteTheCode
@TasteTheCode Год назад
Yes it can but that is not something that is simply executed.
@jonathanmitchell2070
@jonathanmitchell2070 Год назад
At 10:03, in the serial monitor, a load of junk appears on line 3. What and why is that?
@TasteTheCode
@TasteTheCode Год назад
It happens when the reset button is pressed on the NodeMCU but I'm not really sure why. You can see it happening at 11:02 I guess it has to do with the processor starting up and maybe using different baud rate at start. I've seen this with many microcontrollers but I've never really paid any attention to it.
@jonathanmitchell2070
@jonathanmitchell2070 Год назад
@@TasteTheCode Thank you, I am learning, your reply is appreciated.
@TasteTheCode
@TasteTheCode Год назад
You are welcome!
@Filo-qn8pj
@Filo-qn8pj Год назад
Is there a way to use a battery instead of cable to power source?
@TasteTheCode
@TasteTheCode Год назад
Yes you can. You will either need to provide 5V on the Vin pin or 3.3V regulated on any of the 3V3 pins. I have another project where I'm using power bank ICs to make a project power supply for this purpose. You can check it here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Ze9JscCxLx8.html
@Filo-qn8pj
@Filo-qn8pj Год назад
@@TasteTheCode Thank you, i'm doing this for a school project and they gave me an arduino board and a 9V Battery Snap DC Cable. However, I found your video and ordered the DS1302 and the NodeMCU and I just wanted to ask, does the 9V battery snap work with the NodeMCU?
@TasteTheCode
@TasteTheCode Год назад
Arduinos, work on 5V, and the Uno especially have a mich larger voltage regulator to handle higher voltage range. NodeMCU works on 3.3V, and I think the max you can provide on the Vin pin is 5V. However, if tou have the Arduino, the same code should work on it as it works on the NodeMCU so you can basically just swap them.
@Filo-qn8pj
@Filo-qn8pj Год назад
@@TasteTheCode Could you please send me a link or the name of a battery and/or battery holder that would work on this. Sorry I am completely new to this and I am struggling.
@TasteTheCode
@TasteTheCode Год назад
@@Filo-qn8pj I'm not sure what you need. Arduino Uno will work on a 9V battery and you can still use the RTC module on it in exactly the same way as on the NodeMCU.
@Thebasicmaker
@Thebasicmaker 2 года назад
ci sono siti che danno data ora e minuti
@TasteTheCode
@TasteTheCode 2 года назад
Yes, but this is handy if the project is not connected on the internet.
@Thebasicmaker
@Thebasicmaker 2 года назад
@@TasteTheCode sure but since it has a wi-fi module I thought...
@TasteTheCode
@TasteTheCode 2 года назад
I often use NodeMCUs as just demonstration, basically using them instead of an Arduino Nano or Uno.
@chrisleon7312
@chrisleon7312 4 месяца назад
Complete gibberish!
@TasteTheCode
@TasteTheCode 4 месяца назад
😱😱😱
@Gold007-
@Gold007- 2 года назад
I tried this with my ds 1302. It returns 19/80/2091 44:127:1 + RTC lost confidence in the DateTime! data read (20) = "⸮G Do you know why this happens?
@TasteTheCode
@TasteTheCode 2 года назад
Did you set the time initially? Check that the battery is OK and that it is making a good connection. I had a bad battery making weird issues once.
@Gold007-
@Gold007- 2 года назад
​@@TasteTheCode The compiled time is set. The battery has 3 Volts and I think it has a good connection. I also tried changing the battery. That didn't work either. Could my ds 1302 be broken?
@TasteTheCode
@TasteTheCode 2 года назад
I've never seen one to fail but it's not impossible. Do you have another one to try?
Далее
Arduino Real Time Clock - Using the Tiny RTC
31:29
Просмотров 199 тыс.
Put An Atomic Clock in Your PC - Open Source Time Card
11:57
would you eat this? #shorts
00:36
Просмотров 2,1 млн
Maybe i need to add instructions @popflexactive
00:14
Sensors - which one to use
17:06
Просмотров 1,3 млн
002 DS1307 RTC time keeping registers explanation
20:05
Breadboarding tips
20:16
Просмотров 425 тыс.
Arduino Wood Clock
19:36
Просмотров 17 тыс.
How do I use a Real Time Clock with Arduino?  RTC 1307
10:29
How to use DS3231 RTC module to build OLED clock
15:34
How to Soldering wire in Factory ?
0:10
Просмотров 3,2 млн