Page 1 of 1

Good Low Cost RTC

Posted: Wed Mar 08, 2017 11:31 pm
by OldPCGuy
I'm looking for a couple of low cost, reliable RTC modules for a Pi Zero. I see a bunch on EBay for 99 cents to $1.50 USD.

I'm not looking for atomic precision; I'm recording trends sampling every 30-60 sec.

Are those EBay specials any good?

Re: Good Low Cost RTC

Posted: Thu Mar 09, 2017 12:04 am
by scruss
The Raspberry Pi doesn't read from the RTC while it's running, but only picks up the time on reboot and saves it on shutdown. The cheaper RTCs don't have any temperature compensation, and can drift by up to several minutes a day if the temperature gets really extreme. You'll need a network if you want to keep good time on the Raspberry Pi.

Re: Good Low Cost RTC

Posted: Thu Mar 09, 2017 12:57 am
by wayne.dolesman
scruss wrote:The Raspberry Pi doesn't read from the RTC while it's running
The Pi can if you tell it to. A kernel module is required to sync the hwclock and the swclock.

viewtopic.php?t=85683

The point about clock skew is valid.

Re: Good Low Cost RTC

Posted: Thu Mar 09, 2017 8:40 am
by fanoush
OldPCGuy wrote:I'm looking for a couple of low cost, reliable RTC modules for a Pi Zero. I see a bunch on EBay for 99 cents to $1.50 USD.
I'm using ones like this
http://www.ebay.com/itm/DS3231-Precisio ... 2244927302
in several of my Pis and it works. Didn't measure time drifts for longer periods.

Re: Good Low Cost RTC

Posted: Thu Mar 09, 2017 3:44 pm
by scruss
wayne.dolesman wrote:
scruss wrote:The Raspberry Pi doesn't read from the RTC while it's running
The Pi can if you tell it to.
There's nothing in those links that indicate that the Raspberry Pi is doing any RTC access apart from at boot. Without NTP access, the main clock wanders. Without temperature compensation, the RTC wanders. Also, all of those instructions pre-date systemd in Raspbian, so will likely have gone sideways for current use.

Had a picky client who needed a public display of perfect time in an outdoor Canadian winter location with no network access. We had to resort to GPS.

Re: Good Low Cost RTC

Posted: Thu Mar 09, 2017 4:14 pm
by wayne.dolesman
scruss wrote:
wayne.dolesman wrote:
scruss wrote:The Raspberry Pi doesn't read from the RTC while it's running
The Pi can if you tell it to.
There's nothing in those links that indicate that the Raspberry Pi is doing any RTC access apart from at boot.
I am unsure why "it can if you tell it to" was unclear. But since it was let me elaborate.

hwclock -s "tells it to" but in order for that to work the system has to know how to access the hwclock.


Now it is silly to do that since NTP, if available, is likely more accurate. But it *can* and that is all I was saying.

I dont know why you want to argue over this point, its a silly thing to try to argue over. My statement was accurate despite your remarks to the contrary. With that said I looked up some other activity you have had and this will be my last post to you. I dont want to fight and you seem to want to start them with multiple people on these forums, especially over silly things like this.

Re: Good Low Cost RTC

Posted: Fri Mar 10, 2017 12:46 am
by OldPCGuy
fanoush wrote:
OldPCGuy wrote:I'm looking for a couple of low cost, reliable RTC modules for a Pi Zero. I see a bunch on EBay for 99 cents to $1.50 USD.
I'm using ones like this
http://www.ebay.com/itm/DS3231-Precisio ... 2244927302
in several of my Pis and it works. Didn't measure time drifts for longer periods.
The RTC in that link looks exactly like the ones I was referring to. Do those use a standard coin cell battery or something hard to find and obsolete ?

Expected temperatures are 10-35C For my immediate needs a couple seconds a day; a minute or two a week drift is more than adequate.

Re: Good Low Cost RTC

Posted: Fri Mar 10, 2017 3:50 am
by scruss
You'll likely be okay with those, as they have the DS3231 temperature compensated chip. They have a soldered-in battery that should last for years. At that price, I wouldn't worry about replacing it.

Re: Good Low Cost RTC

Posted: Fri Mar 10, 2017 7:21 pm
by thegnnu
I have used different RTC on the Pi over the years and the DS3231 are the best and easiest to fit and program. I put them on all my camera project so the timestamp is all ways correct if the internet is lost while out in the garden.

Re: Good Low Cost RTC

Posted: Fri Mar 10, 2017 7:36 pm
by SlowBro
This is a good article on making the cheap RTCs found on eBay reliable.
https://www.google.com/amp/s/edwardmall ... -ebay/amp/

Re: Good Low Cost RTC

Posted: Sun Apr 23, 2017 3:38 pm
by OldPCGuy
SlowBro wrote:This is a good article on making the cheap RTCs found on eBay reliable.
https://www.google.com/amp/s/edwardmall ... -ebay/amp/
I have on order the same/clone module noted in the article. Are the empty/open data pins on the opposite end of the board active? Can I add a female header there so the module plugs directly into the GPIO like some of the smaller RTC?

Re: Good Low Cost RTC

Posted: Sun Apr 23, 2017 7:33 pm
by alphanumeric
I have a couple of DS3231 RTC breakout boards in use here. No complaints and as far as I can tell keep very accurate time.
https://www.adafruit.com/product/3013 I followed the tutorial on that site for setup. https://learn.adafruit.com/adding-a-rea ... spberry-pi Mine are wired/soldered to a Proto Hat. More expensive than what was linked to above, but as the saying goes, you get what you pay for. ;)

Re: Good Low Cost RTC

Posted: Tue Apr 25, 2017 3:31 am
by SlowBro
OldPCGuy wrote:
SlowBro wrote:This is a good article on making the cheap RTCs found on eBay reliable.
https://www.google.com/amp/s/edwardmall ... -ebay/amp/
I have on order the same/clone module noted in the article. Are the empty/open data pins on the opposite end of the board active? Can I add a female header there so the module plugs directly into the GPIO like some of the smaller RTC?

I haven't tried it but I suppose you can, as long as the pins line up. I'm sure they're active, unless they're defective. Why not try it and report your results? :-) Be mindful of pull up resistors if needed.

Re: Good Low Cost RTC

Posted: Sat Apr 29, 2017 3:18 pm
by OldPCGuy
I have the RTC configured and running, so far so good. I do have more questions if you don't mind;

I came across this article where the author disabled the charging circuit and pull-up resistors on the RTC

http://www.raspberrypi-spy.co.uk/2015/0 ... pberry-pi/

The RTC shipped with a standard CR coin cell which is what I want. Do I need to disable the charging circuit with non-rechargeable batteries?

What is the purpose of disabling the pull-up resistors?

Re: Good Low Cost RTC

Posted: Sat Apr 29, 2017 3:47 pm
by thegnnu
Why are you worrying about a charging circuit on a board that has a normal CR battery.
The 2 resistors are removed when you want to put more than 1 I2C device on the same Pi.
TerryR

Re: Good Low Cost RTC

Posted: Sun Apr 30, 2017 3:41 pm
by OldPCGuy
thegnnu wrote:Why are you worrying about a charging circuit on a board that has a normal CR battery.
So that charging circuit poses no risk to a non-rechargeable battery?

Re: Good Low Cost RTC

Posted: Sun Apr 30, 2017 3:47 pm
by alphanumeric
OldPCGuy wrote:
thegnnu wrote:Why are you worrying about a charging circuit on a board that has a normal CR battery.
So that charging circuit poses no risk to a non-rechargeable battery?
If it shipped with a non rechargeable battery, it should already be disabled?

Re: Good Low Cost RTC

Posted: Sun Apr 30, 2017 4:39 pm
by thegnnu
rechargeable lithium batteries are normal in a solder tag package not in a button cell

Re: Good Low Cost RTC

Posted: Sun Apr 30, 2017 4:57 pm
by OldPCGuy
alphanumeric wrote:
OldPCGuy wrote:
thegnnu wrote:Why are you worrying about a charging circuit on a board that has a normal CR battery.
So that charging circuit poses no risk to a non-rechargeable battery?
If it shipped with a non rechargeable battery, it should already be disabled?
One would hope!

The module shipped with a CR2032 3V. But I also see R5 and D2 in place (charge circuit, upper right).
Image
I'm powering off the 3.3v VCC so in theory the drop across the diode and resister should mean the battery is at a higher voltage potential and won't charge. I wonder if that's how people are getting by with CR cells. My fear is when the battery goes dead, now it would start charging. :o

Re: Good Low Cost RTC

Posted: Sun Apr 30, 2017 5:04 pm
by alphanumeric
What are A0, A1, A2 for? My guess is you have to solder in a jumper to enable the charge circuit?

Re: Good Low Cost RTC

Posted: Sun Apr 30, 2017 5:08 pm
by gregeric
A0/1/2 are to set the address for the I2C eeprom on board.

For peace of mind, you could easily disable trickle charging by taking the diode out of circuit - crush that glass package. Or, if you have a soldering iron, remove that or the resistor - when hot enough, they will stick to the tip and come off the PCB.

Re: Good Low Cost RTC

Posted: Sun Apr 30, 2017 5:12 pm
by alphanumeric
gregeric wrote:A0/1/2 are to set the address for the I2C eeprom on board.

For peace of mind, you could easily disable trickle charging by taking the diode out of circuit - crush that glass package. Or, if you have a soldering iron, remove that or the resistor - when hot enough, they will stick to the tip and come off the PCB.
For changing the address occurred to me right after I clicked "submit". The A was the tipoff, lol.

Re: Good Low Cost RTC

Posted: Sun Apr 30, 2017 5:33 pm
by OldPCGuy
I have two modules so I guess I'll un-solder R5 on one. That way I have one rechargeable and one non.