Choosing an RTC Chip - Page 1
Forum section: electronics / beginners

author: JohnSL
author_rank: Regular Contributor
timestamp: August 05, 2014, 02:01:04 am
content: For a project I'm about to start working on, I need a surface-mounted real-time clock chip. Looking on Mouser, I get 25 pages of chips, ranging in price from $0.70 in single quantities all the way up to over $60. I don't need much accuracy--this is for an automatic cat feeder. Can you give me an idea of how I would choose one chip over another?For example, SparkFun uses a DS1307, which is about $3 in single quantities. So what is the difference between a DS1307 and the Microchip MCP7940MT (which is $0.70).Thanks,-- John

author: Mr.B
author_rank: Unknown
timestamp: August 05, 2014, 03:57:46 am
content: Depends upon how you want to communicate with it.Both the devices you have mentioned are I2C.The MCP7940MT looks like a pretty capable chip for the price, although it does not support coin cell battery backup like the DS1307 and DS3231M do.Personally I have only used DS1307, and more recently the DS3231M.The advantage of the DS3231M is that it has a built in 32.768k crystal so it is one less component to purchase/solder.The DS3231M also has temperature data which can be handy in some applications.

author: JohnSL
author_rank: Regular Contributor
timestamp: August 05, 2014, 04:40:04 am
content: Quote from: Mr.B on August 05, 2014, 03:57:46 amThanks! I missed that it didn't support a battery.I refined my search to include battery backup and I found an RTC chip for $0.89 in single quantities: the Microchip MCP7940N. I've been staring at the data sheet for the MCP7940N compared with the DS1307, and I'm having a hard time figuring out the difference between the two that explains the price difference. There must be a difference, I just can't find it. Can someone shed light on what the DS1307 provides over the MCP7940N?

author: miguelvp
author_rank: Super Contributor
timestamp: August 05, 2014, 04:44:46 am
content: There are a lot of other factors, how accurate it is, how temperature affects them, rate of aging and does it have adjustments for aging. Goes on...You just have to read the datasheets and figure out what your needs are first then find a matching chip that meets or exceeds without breaking the bank.

author: Mr.B
author_rank: Unknown
timestamp: August 05, 2014, 04:52:37 am
content: With a quick glance at the MCP7940N datasheet there is not anything obvious to justify the price differential.Asmiguelvpsays, you will need to weigh up your requirements against the price you are willing to pay.As your project is a cat feeder, I would not have thought that a little bit of thermal drift would have made much difference.I know my cats would not complain if their food was 0.5 seconds later each night, as long as I corrected it every year or so...Edit: Being a cat feeder, you will have to buy your components from Mouser, regardless of the RTC you choose...

author: miguelvp
author_rank: Super Contributor
timestamp: August 05, 2014, 05:01:01 am
content: Quote from: Mr.B on August 05, 2014, 04:52:37 am

author: JohnSL
author_rank: Regular Contributor
timestamp: August 05, 2014, 05:02:27 am
content: Quote from: Mr.B on August 05, 2014, 04:52:37 amOh, that's very good:Anyway, thanks for the other information. I think I'll try this chip and see how it goes.

author: kolbep
author_rank: Frequent Contributor
timestamp: August 05, 2014, 06:08:10 am
content: Quote from: Mr.B on August 05, 2014, 04:52:37 amThat work out to a drift of 3 Minutes over the year. As it is a gentle change each night, they will not notice. But then when you come along after that year, and reset it, then all of a sudden they will be getting fed 3 Minutes earlier! If they are like some cats I know, they will not be impressed with you changing it back.... :-)If the cat feeder is outside, or near a window, put a Phototransistor on it, and get it to work out its feeding based on the light levels (say feed 30 minutes after nightfall). That way when winter comes, the cats will come home earlier. And it will also be self calibrating to the sun. Just throwing it out there for some thought / debate....

author: Mr.B
author_rank: Unknown
timestamp: August 05, 2014, 07:44:14 am
content: @kolbeb - Thats a very good idea!

author: sunnyhighway
author_rank: Frequent Contributor
timestamp: August 05, 2014, 08:19:12 am
content: Quote from: kolbep on August 05, 2014, 06:08:10 amI guess that method will take a lot of calibration to compensate for various ambient light sources. Think about the effects of moonlight, street-, porch- and car-lights. And severe thunderstorms and dust-storms can blacken the sky too (which arguably could be a good thing).Personally I would be more leaning toward a mcu based solution, equipped with a table to predict sundown based on the latitude.

author: Kjelt
author_rank: Super Contributor
timestamp: August 05, 2014, 09:03:32 am
content: Quote from: kolbep on August 05, 2014, 06:08:10 amIf they are like some cats I know, they will hack the system in a way noone ever had thought about to get the food out when they want itQuoteThat is one of those things a cat will eventually figure out and manipulate, hey I just have to lay on this spot for 30 minutes and I got the next meal

author: eneuro
author_rank: Super Contributor
timestamp: August 05, 2014, 03:48:05 pm
content: Quote from: sunnyhighway on August 05, 2014, 08:19:12 amIf you have RTC clock than it is possible calculate sun position on the sky with quite high precision if you know latitude & longtitude position many years aheadJust porting to AVR MCU software I wrote and tested under Linux to predict sun azimuth and elevation for my thermal concentrated solar system.I was able setup my sattelite dish using its output and HotBird 13*E azimuth just using... clock, with such accuracy that I'v got Eurosport signal with the first try without any sattelite finders, etc-just small adjustments in elevation only while dish converter shaddow at computed time exactly showed this satelite position on the skyThis is current output from this software:QuoteIf sun elevation is close to zero it means animals might want to eat something while it is sunset or sunrise