OldPCGuy
Posts: 83
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Good Low Cost RTC

Wed Mar 08, 2017 11:31 pm

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?

User avatar
scruss
Posts: 2615
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Good Low Cost RTC

Thu Mar 09, 2017 12:04 am

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.

wayne.dolesman
Posts: 64
Joined: Sat Feb 25, 2017 8:10 am

Re: Good Low Cost RTC

Thu Mar 09, 2017 12:57 am

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.

fanoush
Posts: 490
Joined: Mon Feb 27, 2012 2:37 pm

Re: Good Low Cost RTC

Thu Mar 09, 2017 8:40 am

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.

User avatar
scruss
Posts: 2615
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Good Low Cost RTC

Thu Mar 09, 2017 3:44 pm

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.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

wayne.dolesman
Posts: 64
Joined: Sat Feb 25, 2017 8:10 am

Re: Good Low Cost RTC

Thu Mar 09, 2017 4:14 pm

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.

OldPCGuy
Posts: 83
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Re: Good Low Cost RTC

Fri Mar 10, 2017 12:46 am

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.

User avatar
scruss
Posts: 2615
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Good Low Cost RTC

Fri Mar 10, 2017 3:50 am

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.

thegnnu
Posts: 157
Joined: Thu Oct 18, 2012 7:07 pm
Location: Bristol

Re: Good Low Cost RTC

Fri Mar 10, 2017 7:21 pm

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.

User avatar
SlowBro
Posts: 165
Joined: Sat Feb 18, 2017 1:30 am

Re: Good Low Cost RTC

Fri Mar 10, 2017 7:36 pm

This is a good article on making the cheap RTCs found on eBay reliable.
https://www.google.com/amp/s/edwardmall ... -ebay/amp/

OldPCGuy
Posts: 83
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Re: Good Low Cost RTC

Sun Apr 23, 2017 3:38 pm

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?

alphanumeric
Posts: 2138
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Good Low Cost RTC

Sun Apr 23, 2017 7:33 pm

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. ;)

User avatar
SlowBro
Posts: 165
Joined: Sat Feb 18, 2017 1:30 am

Re: Good Low Cost RTC

Tue Apr 25, 2017 3:31 am

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.

OldPCGuy
Posts: 83
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Re: Good Low Cost RTC

Sat Apr 29, 2017 3:18 pm

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?

thegnnu
Posts: 157
Joined: Thu Oct 18, 2012 7:07 pm
Location: Bristol

Re: Good Low Cost RTC

Sat Apr 29, 2017 3:47 pm

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

OldPCGuy
Posts: 83
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Re: Good Low Cost RTC

Sun Apr 30, 2017 3:41 pm

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?

alphanumeric
Posts: 2138
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Good Low Cost RTC

Sun Apr 30, 2017 3:47 pm

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?

thegnnu
Posts: 157
Joined: Thu Oct 18, 2012 7:07 pm
Location: Bristol

Re: Good Low Cost RTC

Sun Apr 30, 2017 4:39 pm

rechargeable lithium batteries are normal in a solder tag package not in a button cell

OldPCGuy
Posts: 83
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Re: Good Low Cost RTC

Sun Apr 30, 2017 4:57 pm

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

alphanumeric
Posts: 2138
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Good Low Cost RTC

Sun Apr 30, 2017 5:04 pm

What are A0, A1, A2 for? My guess is you have to solder in a jumper to enable the charge circuit?

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: Good Low Cost RTC

Sun Apr 30, 2017 5:08 pm

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.

alphanumeric
Posts: 2138
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Good Low Cost RTC

Sun Apr 30, 2017 5:12 pm

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.

OldPCGuy
Posts: 83
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Re: Good Low Cost RTC

Sun Apr 30, 2017 5:33 pm

I have two modules so I guess I'll un-solder R5 on one. That way I have one rechargeable and one non.

Return to “General discussion”