Real-time Clock ICs with Arduino

Introduction

ZZDS1307_Circuito-Integrado-DS1307-CI-RTC-SERIAL-64X8-8-pinos_1Well, this is my very first post on this blog. First of all, let me introduce myself. I’m a Brazilian engineer graduated in mechatronics in a university called USP (or University of São Paulo). I don’t expect for you to know it, but for people that works in academics, it is a well known university, that was ranked 39º best of the world on the year 2009. However, English is not my primary language, because here we speak Portuguese. So expect some spelling mistakes.

On this first post, I’m going to describe some of the RTC modules available on the market, and how to use them. The advantages and disadvantages about each other and also their usage to make one of my projects, that is an arduino based smartwatch, with accelerometers, compass, altitude and pressure sensor. For this purpose, I had to search for the module with the least power consumption possible. For most of this I have to thank Dennis, another member on Instructable that helped me on my first steps with RTCs.

RTCs modules available out there

There are a lot of RTC modules available for purchase. However, finding most of them is not an easy quest, so I’ll stick with the ones anyone can buy on Ebay, because they ship worldwide and also the ones that are available on many different chip sizes, so you can make regular or smd pcbs. Some of the most common packages are:

  • DS1307;
  • DS3231;
  • PCF8583;
  • PCF8563;

DS1307

The DS1307 is certainly the most common RTC module out there. As the most common, it is also the cheapest. You can find it on Ebay here for $0.99 mounted ready for use or here only the IC (50 units for the same price)! For applications you don’t have to worry about power consumption, or precision, it is perfect. It also has a 56-byte RAM memory which you can use to store information. Really useful.

But when one of these variables comes in, this IC can make your project not effective at all. This is because the DS1307 consumes 200uA of current when on standby or 1.5mA (7.5 times more) when communicating through I2C. It’s datasheet is here. Also, its precision is not very good, because it is 14 ppm, that means it misses 14 parts in each million, or 7.35 minutes each year. If this is a clock, we don’t want to miss the time! Also, this is just accurate for 20ºC. Also, this is a 5V IC, so you can’t use with 3V Arduinos, such as some Pro Minis. So no, we wont use this IC for our smartwatch project.

DS3231

This IC has an amazing accuracy of 2 ppm, or 1 minute each year. Its datasheet is here. This is possible because the RTC has a temperature-compensated voltage reference and comparator circuit internally, which means its precision does not fluctuate with temperature. Of course, to supply this circuit, it has to consume energy. A lot. It can be used with 3.6V, but at that voltage, it consumes around 110uA standby plus a 575uA temperature conversion current (equals 685uA) and even more 200uA when communicating. Another problem is that this IC does not have the additional memory as the DS1307. People use this module with a non-volatile memory such as the AT24C32. It can be found on Ebay here for $0.99. The real dealbreaker for this is the high power consumption still. So this wont be our guy.

PCF8583

This is one of my favorites. The PCF8583 is a RTC with around 20ppm. However, you wont achieve this if you don’t use a really precise crystal and the right capacitors. This IC can be used in many different voltages from 1V to 6V (to keep the time) and 2.5V to 6V (to reply the I2C). Also comes with 240-byte RAM. Neat! But oops, its current goes from 10uA to 50uA on standby to 200uA with 100kHz SCL. Much lower than the previous two, but still a lot for a really small sized watch. Its datasheet is here, and its Ebay seller here (5 units for $1.60).

PCF8563

Well, this is it. The one I think is the best option. The PCF8563 is also an easy to find IC. It can be used from 1 to 6V, and its power consumption goes from 500nA (that is 0.5uA, or at least 20 times lower than the PCF8583) to 200uA when with 100kHz on I2C, and around 20 ppm accuracy. The current when the interface is active is not all that important because you wont be using I2C all the time. In fact, for our watch we will be using all the parts on power down most of the time, so the really important current is the standby one. On Ebay here is quoted for $1.38 (5). Its datasheet is here. The only problem is that this chip does not come with memory for other purposes. For that, we can use the AT24C32, which is a non-volatile memory (that means that this module wont forget its bytes stored when it gets its power off) and consumes only tiny 0.5uA on standby mode.

Comparison between them

Untitled

Next I’ll write another post showing how to connect and adjust the PCF8563 for the best usage possible. Of course, all of this is possible to find on its datasheet. Hope you liked this post, and find it useful. Take your time to buy, test and play with these real time clocks. All of them are useful, but it depends on what application you need them for. See you on my next post, please share on Twitter and Google Plus!

Where to go from here

4 thoughts on “Real-time Clock ICs with Arduino

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s