The Arduino UNO doesn’t have a little coin-battery-powered ‘Real Time Clock’ (RTC) module, which keeps time even when the power is off, or the battery removed.
So in this project we will show you how to add a RTC Click shield from Mikroelektronika, without the use of iron solder or breadboard.
This is possible using a Click Shield for Arduino UNO ( MIKROE 1581 ) from Mikroelektronika, easily found on RS Components RS SN 823-1883 and one RTC Click shield RS SN 820-9832 . You should own an Arduino UNO ( RS 715-4081 ).
We just need to insert the two Click boards as per below images.
The Mikroe Click shield for Arduino let’s permit to interface not one, but two Click shields.
The RTC Click shield uses a very popular Real Time Clock PCF8583 from NXP (ex Philips)
On the web, there are a lot of open source libraries for Arduino, based on the PCF8583 .I have used the following :
Not sure if it is the best, but it worked well on my test.
You just need to :
- download the library “PCF8583-master” from github
- copy the unzip files on the Arduino “library” directory ( take care – depending your Arduino IDE version , you should remove the “-“ character from the library name “PCF8583-master”. The newest versions don’t accept this char on the library’s name.
- launch the “Arduino” IDE
- upload the example file “ read_write_time.ino” ( from the library “PCF8583master” )
- Compile & upload the sketch
- Open the serial monitor on the Arduino IDE
- On the first time, you could see a wrong date-time
- Write on the top bar the date-time to set on the following form “YYMMddhhmmss;”
- Send to Arduino
- That’s all! – you can now see the correct date-time
- Try switching off the UNO board and then switching on, to see if the date-time has been kept
The system should function also with Arduino Leonardo and Arduino Mega, but I didn’t tested these boards
Let’s me say if you are using it , on your application:-)
See my new posts also on :