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
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.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
-
- Posts: 64
- Joined: Sat Feb 25, 2017 8:10 am
Re: Good Low Cost RTC
The Pi can if you tell it to. A kernel module is required to sync the hwclock and the swclock.scruss wrote:The Raspberry Pi doesn't read from the RTC while it's running
viewtopic.php?t=85683
The point about clock skew is valid.
Re: Good Low Cost RTC
I'm using ones like thisOldPCGuy 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.
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
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.wayne.dolesman wrote:The Pi can if you tell it to.scruss wrote:The Raspberry Pi doesn't read from the RTC while it's running
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.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
-
- Posts: 64
- Joined: Sat Feb 25, 2017 8:10 am
Re: Good Low Cost RTC
I am unsure why "it can if you tell it to" was unclear. But since it was let me elaborate.scruss wrote:There's nothing in those links that indicate that the Raspberry Pi is doing any RTC access apart from at boot.wayne.dolesman wrote:The Pi can if you tell it to.scruss wrote:The Raspberry Pi doesn't read from the RTC while it's running
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
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 ?fanoush wrote:I'm using ones like thisOldPCGuy 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.
http://www.ebay.com/itm/DS3231-Precisio ... 2244927302
in several of my Pis and it works. Didn't measure time drifts for longer periods.
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
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.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
Re: Good Low Cost RTC
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
This is a good article on making the cheap RTCs found on eBay reliable.
https://www.google.com/amp/s/edwardmall ... -ebay/amp/
https://www.google.com/amp/s/edwardmall ... -ebay/amp/
Re: Good Low Cost RTC
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?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/
-
- Posts: 2784
- Joined: Tue Jan 19, 2016 2:17 pm
- Location: Sydney, Nova Scotia, Canada
Re: Good Low Cost RTC
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.
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
OldPCGuy wrote: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?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 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?

Re: Good Low Cost RTC
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?
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
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
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
So that charging circuit poses no risk to a non-rechargeable battery?thegnnu wrote:Why are you worrying about a charging circuit on a board that has a normal CR battery.
-
- Posts: 2784
- Joined: Tue Jan 19, 2016 2:17 pm
- Location: Sydney, Nova Scotia, Canada
Re: Good Low Cost RTC
If it shipped with a non rechargeable battery, it should already be disabled?OldPCGuy wrote:So that charging circuit poses no risk to a non-rechargeable battery?thegnnu wrote:Why are you worrying about a charging circuit on a board that has a normal CR battery.
Re: Good Low Cost RTC
rechargeable lithium batteries are normal in a solder tag package not in a button cell
Re: Good Low Cost RTC
One would hope!alphanumeric wrote:If it shipped with a non rechargeable battery, it should already be disabled?OldPCGuy wrote:So that charging circuit poses no risk to a non-rechargeable battery?thegnnu wrote:Why are you worrying about a charging circuit on a board that has a normal CR battery.
The module shipped with a CR2032 3V. But I also see R5 and D2 in place (charge circuit, upper right).

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.

-
- Posts: 2784
- Joined: Tue Jan 19, 2016 2:17 pm
- Location: Sydney, Nova Scotia, Canada
Re: Good Low Cost RTC
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
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 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.
-
- Posts: 2784
- Joined: Tue Jan 19, 2016 2:17 pm
- Location: Sydney, Nova Scotia, Canada
Re: Good Low Cost RTC
For changing the address occurred to me right after I clicked "submit". The A was the tipoff, lol.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.
Re: Good Low Cost RTC
I have two modules so I guess I'll un-solder R5 on one. That way I have one rechargeable and one non.