arduino clock


. Today we build a real time clock., As you can see in the display. We have here date time and the temperature.. All this is accomplished with the use of only one chip.. This little chip is the DS3231 chip.. This one here.. Let see how it is built. The DS3231 chip. This little chip here is a very low power chip which keeps time with great accuracy. In this building block we bought for Arduino. It comes with a battery a rechargable battery, and so it can keep time for many years.. It is very to use as it uses the I2C interface.. It has an embedded ROM which can store some data and it has a temperature sensor which is quite accurate and is very easy to use.. Let’S connect this little block to Arduino and see how easy it is to operate this little device.. First, we take the Arduino. In this video. We are going to use an Arduino Mega.. You can use any Arduino device, you like., Then we can use an Arduino display like this. In order to In order to display the data in the screen., We plug the display in the Arduino and we are ready to connect the DS3231chip.. Ok. In order to be easier to connect, we can use a small breadboard.. We plug the chip, and now we are ready to connect them. First let’s connect. Of course, the power.. The second pin of the chip is, the Vcc. is going to 5V in Arduino.

The next pin the first pin is the Ground, So we connect it with the Arduino Ground. The third pin is named SDA. and goes to the SDA pin of the Arduino Mega. and lastly, we connect the SCL pin the fourth pin with the SCL pin in the Arduino Mega.. Ok now we are ready to power the device on and see if it is working.. Ok, it works great. As you can see, it keeps the time the date and temperature.. If I unplug Unpower and power on again the device, the time is correct.. It keeps time internally, with the embedded battery. Let’s, see how to program this device and how to set the time. We are in the computer. Now. First of all, we have to download the appropriate library in order to use the DS3231 real time clock with Arduino.. We go to this page. You can find the link in the description of the video below and download the library, the Rodan 3231 library.. There are many libraries out there, but this one is easy to use.. We unzip the library in the desktop, for example, rename it, for example, Real Time Clock and cut it and paste it in the Arduino Libraries folder. Ok here it is quotReal Time Clockquot. Now we open Arduino and we can see the example of the library.. Ok, RTC. Ds3231 – This is an example that gets time from the Arduino.. I now have loaded the final code of the project.

. You can find the full code in the link in the description of the video.. It is a modified version of the code that is provided with library.. The example that we loaded in the beginning. I have modified that code and now it can set time and get time and display it to the display.. First of all, let’s set the time.. When we buy this Real Time Clock. The time is not set.. So we have to manually set it in the first time we use it. In order to do that. The library that we use has a command that it is named parsecmd In this command. We can send commands in the Real Time Clock module, So let’s send the command to set time. In order to set the time we have to make a String like that.. This is a capital quotTquot for time and the time in a String format and the number 16, because this command is 16 bytes long.. So first of all we have to set Year Year is here. 2014.. Then we have to set the month. 10 because we are now in October.. Next we have day., It is 4th of October.. Next we have day of the week.. Today is Saturday, so we can set it as the 6th day of the week.. Then we have Hour, it is 11 in the morning. So we set here 11, then is minutes 29 and we can set the seconds as well.

. Ok, let’s put here 30.. Now we have to compile and run the code only once., The first time that the code is run. The time is set and then we don’t have to care anymore about it. Let’s upload the code.. Now we have to open the Serial, Monitor and see. Ok setting time, OK, Temperature is 24 OK.. Setting of time is done.. Now We comment those lines because we want to set time only once.. Now time is kept internally in the clock for many years as long as the battery of the module has power. Now let’s have a quick look at the code and how it works.. First of all, in the setup we begin the Serial Communication with the computer and the I2C communication. We initialize the LCD screen and clear it.. Then, in the loop function we show time once in a while, once in a second., There is a variable named interval which can be set at any value. We like, I have set it to 1000, ms, in order to show time once every second.. So once a second, we get time we get temperature, we convert it to a String. We clear the LCD screen every second, we set the cursor at the beginning, we print the day of the month and then we print the month itself.. This is a custom function. Let see where it is …. Ok, it is very simple: It has an input of an integer and then it prints in the screen, the appropriate month.

. If the month is the first month of the year, it prints in the screen January very simple.. It is a simple switch case: command. Then we print year. OK.. Then we set the cursor to the second line of the LCD screen. We print hour, and then we print minutes and seconds. That’s, it., Very easy., And then lastly, we print Temperature. That’s it and, of course we check if there is new data in the Serial Communication.. As you can see, this module is a very easy to use module and it can provide time to your Arduino project fow many years because it uses very low power and so it’s embedded battery can last for many years.. It is a very cheap module and you can buy it for around 2 or 3 from the link in the description.. It can also provide temperature because it has an embedded temperature sensor, which is more accurate, that the DHT11 sensor that we used in the previous video.. Thank you very much for watching this video Please subscribe to our channel in order, see our next projects and press like if you liked the video..


arduino clock Video







arduino clock news








arduino clock Social






👋 Want to bring Tony Stark-like gesture control to your projects? Learn how with the BLE-enabled MKR WiFi 1010 and Nano 33 BLE Sense boards using the ArduinoBLE library.
safe image.php?d=AQDyi1ELcW4VGzhx&w=720&h=720& dChOhNMmeF - arduino clock

Arduin-yo ho ho! A fairground favorite, the pirate ship is a fun way to explore the oscillation of a pendulum. How much fun, you ask? Access our Science Kit Physics Lab preview and see for yourself:

🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today:

70537898 550174072395145 8798850142103928832 n.jpg? nc cat=102& nc oc=AQmCfMPwMf1oPpYqFhzbxfnGdbrmsjZXrEEBy1ox5Z8EJtiYMADoFNZ5mnSNRgCCY74& nc ht=scontent - arduino clock
G2jj76Y5 normal - arduino clock
Thu Jan 08 17:44:38 +0000 2015

Thermohygrometer with clock and LCD display on Arduino UNO by @techrmcom:
zLTZGdp9 normal - arduino clock
Tue Nov 21 21:46:33 +0000 2017

#DIY #arduino #Visuino clock ws2812(5)

Meu SmartWatch Diy 1.0 – My Esp8266 SmartWatch prototype Diy

Meu protótipo de Relógio SmartWath Diy- My Esp8266 Nodemcu SmartWatch Diy prototype



Originally posted 2018-03-30 22:06:40.

(Visited 166 times, 4 visits today)

About The Author

You might be interested in

Comment (25)

  1. Αν έχω καταλάβει σωστά, πρέπει να είσαι από την Ελλάδα, χαίρομαι που υπάρχουν Έλληνες που έχουν επεκταθεί και στο εξωτερικό, σε λίγο καιρό θα φτιάξουμε ένα αυτόματο κουδούνι για το σχολείο, αν είναι δυνατόν, θα ήθελα μια μικρή βοήθεια. Ευχαριστώ εκ των προτέρων.

  2. When I look at the example my code does not include the #include “rtc_ds3231.h”…. any idea as to why? Keeps causing me issues not having that.

    1. I would consider starting by looking into:
      – voltage sensing relay
      -voltage regulator
      -solar panel wattage given your location on earth

  3. your video wery sooper am stading this metheed . your speeche ant clas wery naise
    am wery happy to waching this video
    thanks sir

  4. Αδερφεμ πολυ καλά τα βιντεάκια σου , αν μπορούσες να προσθέσεις και ελληνικούς υπότιτλους θα μας βοηθουσες ακόμη περισσότερο, ευχαριστώ.

  5. It is great Explanation. I need a timer that work when I get 5 V inputs on the Arduino. Everytime that I have 5 V inputs the timer will work without reset. When timer get 2200 Hours, timer stop and Arduino will send 5V output. When I reset it I will have 0 V output and timer will work again.

  6. Excelente, acompanhando o canal ! Gostariamos de lhe convidar para conhecer nosso canal, e quem sabe uma futura parceria ! obrigado

  7. Hi, nice video, but I had some problem, could you help-me? I have an error “DS3231_INTCN’ was not declared in this scope”, how to solve this?

  8. Great job and presentation. How do i interface a keypad for setting incubating periods that will be displayed on the LCD. And a reminder with GPS


Your email address will not be published. Required fields are marked *