esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 1:01 am

Im working on a project and wanna add a rtc to the board. The problem im having is the gpio pins for them is being used by another board. I found the one in the pic. It fits the case im using and uses open gpio pins. By the reviews on it the rtc wont last long. Either u recieve a bad one or goes bad in a few months. Does anyone know of a rtc with the same gpio setup but better quality.
Attachments
2217625.jpg
2217625.jpg (5.5 KiB) Viewed 2282 times

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 1:15 am

Forgot to say it goes over gpio pins 1 3 5 7 9.

W. H. Heydt
Posts: 10739
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 1:15 am

It's kind of hard to tell just from that picture, but it looks like the typical design the fits on pin 1, 3, 5, 7, and 9 (the first 5 pins on the side away from the board edge).

I can think of a couple of solutions, both of which would probably work, but neither of which are ideal. The first is an Adafruit unit, their PCF8523 (here: https://www.adafruit.com/product/3386 ). It has a replaceable battery. I don't know how accurate it is (but, then, I don't know how much accuracy you need). It uses the first three pins of both rows (pins 1 to 6). I have one, but I haven't tested it yet. The battery is a Li Ion CR1220, so it should last a while.

The other is from Pi Hut and uses a DS3231 (here: https://thepihut.com/products/mini-rtc- ... =758601217 ). They're out of stock at the moment. It uses a 0.22F supercapacitor to maintain the time when there is no power. It's quite accurate. In a 10 day test it was within one second of correct time, so it's good to within 30 sec. per year. The problem is that the "hold time" for the supercap is only about 2 days without power, so you can't leave it sitting around on an unpowered Pi and expect to come back with the clock still correct. If you are going to use it on a Pi that is supposed to be running 24/7 and just need the RTC to bridge an occasional power outage of a few hours (or less), it would do very well.

W. H. Heydt
Posts: 10739
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 1:17 am

esloudan wrote:Forgot to say it goes over gpio pins 1 3 5 7 9.
Thought so...

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 2:05 am

The pi hit one u have is exactly what i want but trying to find a regular battery kind instead of supercap. I know someone with the adafruit one and he says it held time for well over a week while being turned off and only lost 1 second. The problem is the gpio pin im using to turn it on and off with will be blocked by the rtc. Thats why i like the pi hut one better.

My project is another retropie project. Lot more advanced than the first i made. I wanna add rtc because some games go by system clock and i dont always have it where i can do wifi.

Im not the best at knowing how to change the stuff around. Is there a way where they could share a pin. Its laterally just one pin.

W. H. Heydt
Posts: 10739
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 2:30 am

esloudan wrote:The pi hit one u have is exactly what i want but trying to find a regular battery kind instead of supercap. I know someone with the adafruit one and he says it held time for well over a week while being turned off and only lost 1 second. The problem is the gpio pin im using to turn it on and off with will be blocked by the rtc. Thats why i like the pi hut one better.
I would expect the Adafruit unit using a CR1220 battery would keep running for *years*. The only issue would be drift.

I agree with the goal of finding a DS3231 unit in the exact form factor with a battery holder would be the best overall solution. I've seen others with the form factor. I've seen one tht has a battery holder (so it can be replaced), but not one with both features. The supercap has the advantage that it should be able to sustain a very large number of charge/discharge cycles so it would be serviceable...well, indefinitely.
My project is another retropie project. Lot more advanced than the first i made. I wanna add rtc because some games go by system clock and i dont always have it where i can do wifi.
There is *always* a system clock. It's reasonably accurate. The problem with the fake clock is that--absent an RTC or a network connection--it just picks up time from where it was last shut down. The question comes down to this: Do you need some form of absolute time, or will relative time or time intervals suffice? If the later, you probably don't need an RTC.
Im not the best at knowing how to change the stuff around. Is there a way where they could share a pin. Its laterally just one pin.
Which pin? Bear in mind that the DS3231 RTC units really only use 4 pins. The module spans 5 pins because the 4 it needs are not all right next to each other. Of the 4 it uses, one is for power and another is ground. There are other power and ground pins. As a result, there are only two pins you really have to be concerned with.

I'll let someone else discuss pin sharing as wiring things (other than an RTC module, and that only for a couple of special uses) to Pis isn't something I generally do and I've never done anything in the Retropi realm at all.

geoffr
Posts: 85
Joined: Wed Aug 22, 2012 11:25 am
Location: Melbourne, VIC

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 2:34 am

I guess it depends on the amount of effort you are prepared to go to in order to attach your RTC. All the RTCs I can think of use the I2C bus to attach. That dictates the GPIO pins they use. You could attach one to to I2C bus 0, but that bus is supposed to be reserved for HATs. Another approach is to use a staking header to be able to either stack multiple boards on top of your Pi, or if you are using a Pi Zero, solder a stacking header onto your Pi and plug it into a board that does things like supply power and provide a RTC. This is what I did for my irrigation controller.
The photo shows how I did this for my irrigation controller. The RTC is the small board standing vertically.
Image

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 2:47 am

geoffr wrote:I guess it depends on the amount of effort you are prepared to go to in order to attach your RTC. All the RTCs I can think of use the I2C bus to attach. That dictates the GPIO pins they use. You could attach one to to I2C bus 0, but that bus is supposed to be reserved for HATs. Another approach is to use a staking header to be able to either stack multiple boards on top of your Pi, or if you are using a Pi Zero, solder a stacking header onto your Pi and plug it into a board that does things like supply power and provide a RTC. This is what I did for my irrigation controller.
The photo shows how I did this for my irrigation controller. The RTC is the small board standing vertically.
Image
Nice set up. How accurate has ur clock been?

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 3:06 am

W. H. Heydt wrote:
esloudan wrote:The pi hit one u have is exactly what i want but trying to find a regular battery kind instead of supercap. I know someone with the adafruit one and he says it held time for well over a week while being turned off and only lost 1 second. The problem is the gpio pin im using to turn it on and off with will be blocked by the rtc. Thats why i like the pi hut one better.
I would expect the Adafruit unit using a CR1220 battery would keep running for *years*. The only issue would be drift.

I agree with the goal of finding a DS3231 unit in the exact form factor with a battery holder would be the best overall solution. I've seen others with the form factor. I've seen one tht has a battery holder (so it can be replaced), but not one with both features. The supercap has the advantage that it should be able to sustain a very large number of charge/discharge cycles so it would be serviceable...well, indefinitely.
My project is another retropie project. Lot more advanced than the first i made. I wanna add rtc because some games go by system clock and i dont always have it where i can do wifi.
There is *always* a system clock. It's reasonably accurate. The problem with the fake clock is that--absent an RTC or a network connection--it just picks up time from where it was last shut down. The question comes down to this: Do you need some form of absolute time, or will relative time or time intervals suffice? If the later, you probably don't need an RTC.
Im not the best at knowing how to change the stuff around. Is there a way where they could share a pin. Its laterally just one pin.
Which pin? Bear in mind that the DS3231 RTC units really only use 4 pins. The module spans 5 pins because the 4 it needs are not all right next to each other. Of the 4 it uses, one is for power and another is ground. There are other power and ground pins. As a result, there are only two pins you really have to be concerned with.

I'll let someone else discuss pin sharing as wiring things (other than an RTC module, and that only for a couple of special uses) to Pis isn't something I generally do and I've never done anything in the Retropi realm at all.
The whole reason for the clock is its times has effects in the game. Sometimes when i dont have network it resets the clock and the game wont work. Its pin 5 thats giving the problem. I dont know if i can set it somewhere else on the gpio. If i could find a way to make a battery one work id rather have it. Didnt think bout doing this till after i had the case made so im also under a little area to work lol.

I know this is off subject but do u know anyone who has ever done a carputer? Been looking into it and the info hasnt been very helpful that i found.

geoffr
Posts: 85
Joined: Wed Aug 22, 2012 11:25 am
Location: Melbourne, VIC

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 3:25 am

esloudan wrote:
Nice set up. How accurate has ur clock been?
Thanks. I haven't paid a lot of attention to it, as I am happy if it is vaguely close to the real time. As soon as it gets network connectivity, it will sync to NTP. My main concern is in case it reboots without a network - I don't want it to start watering the garden in the middle of the day.

From the checks I initially did, it seemed to stay within about half a second of the real time.

pcmanbob
Posts: 6619
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 8:13 am

I used a DS3231 like the one shown on a pi that had no internet connection for over a year , When I finally took it out of service I connected it to the net and found less than 0.5 sec error , it had seen several power outages over the year the longest being about 2 hours. so I would recommend a DS3231 for time keeping.

edit.

just realised I still have the pi in question sitting on a shelf un-touched since it was switched off nearly 4 months ago, so powered it up did check of hwclock time against internet time error is about 3 seconds. so I guess running off its own battery/capacitor has caused a small error.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

gordon77
Posts: 4110
Joined: Sun Aug 05, 2012 3:12 pm

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 9:34 am

esloudan wrote:Im working on a project and wanna add a rtc to the board. The problem im having is the gpio pins for them is being used by another board. I found the one in the pic. It fits the case im using and uses open gpio pins. By the reviews on it the rtc wont last long. Either u recieve a bad one or goes bad in a few months. Does anyone know of a rtc with the same gpio setup but better quality.
I've had no problems with this one

http://cpc.farnell.com/4d/rpi-rtc/raspb ... pd-mi-acce

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 11:51 am

pcmanbob wrote:I used a DS3231 like the one shown on a pi that had no internet connection for over a year , When I finally took it out of service I connected it to the net and found less than 0.5 sec error , it had seen several power outages over the year the longest being about 2 hours. so I would recommend a DS3231 for time keeping.

edit.

just realised I still have the pi in question sitting on a shelf un-touched since it was switched off nearly 4 months ago, so powered it up did check of hwclock time against internet time error is about 3 seconds. so I guess running off its own battery/capacitor has caused a small error.
Thats not bad. Mine will be off at most like a week. 3 seconds wouldnt be bad at all.

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 12:34 pm

gordon77 wrote:
esloudan wrote:Im working on a project and wanna add a rtc to the board. The problem im having is the gpio pins for them is being used by another board. I found the one in the pic. It fits the case im using and uses open gpio pins. By the reviews on it the rtc wont last long. Either u recieve a bad one or goes bad in a few months. Does anyone know of a rtc with the same gpio setup but better quality.
I've had no problems with this one

http://cpc.farnell.com/4d/rpi-rtc/raspb ... pd-mi-acce
Im looking into this one and seeing if i can get a work around on it.

W. H. Heydt
Posts: 10739
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 2:44 pm

esloudan wrote: The whole reason for the clock is its times has effects in the game. Sometimes when i dont have network it resets the clock and the game wont work. Its pin 5 thats giving the problem. I dont know if i can set it somewhere else on the gpio. If i could find a way to make a battery one work id rather have it. Didnt think bout doing this till after i had the case made so im also under a little area to work lol.
The first 5 odd numbered pins are (in order) +3.3v, SDA, SCL, #4, Ground. So pin 5 is SCL, which is part of the I2C interface. It would be odd to use SCL and not SDA. The RTCs in question don't use GPIO4 (pin 7).
I know this is off subject but do u know anyone who has ever done a carputer? Been looking into it and the info hasnt been very helpful that i found.
Not personally, but there are plenty of posts of people building them.

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 3:39 pm

The link gordon77 shows looks like what i need. After looking into it i found this model. Would it be possible to use the 5 pin as on/off switch and the rtc? Was thinking they will have conflict.
Attachments
$_1 (1).JPG
$_1 (1).JPG (56.66 KiB) Viewed 2039 times

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

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 3:51 pm

esloudan wrote:Im working on a project and wanna add a rtc to the board. The problem im having is the gpio pins for them is being used by another board. I found the one in the pic. It fits the case im using and uses open gpio pins. By the reviews on it the rtc wont last long. Either u recieve a bad one or goes bad in a few months. Does anyone know of a rtc with the same gpio setup but better quality.
The pcb shown in your picture is the same as mine and it uses a real Lithium Battery CR1020 PCB
soldered to save a battery holder.
You only have 5 components on the pcb 1 battery, 1 DS3231, 2 Resistors, 1 Cap, no charge components
To use the DS3231 on 12c with another board then you can just break the 2 432 resistor in half this or unsolder them this will then let the device share the 12c as it can do.
If you look on the battery just below the welded solder tag you will see 3v and on the end either a C or CR can be seen on mine.
This board does NOT use the super cap as sold by Pi Hut.
TerryR

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 6:10 pm

thegnnu wrote:
esloudan wrote:Im working on a project and wanna add a rtc to the board. The problem im having is the gpio pins for them is being used by another board. I found the one in the pic. It fits the case im using and uses open gpio pins. By the reviews on it the rtc wont last long. Either u recieve a bad one or goes bad in a few months. Does anyone know of a rtc with the same gpio setup but better quality.
The pcb shown in your picture is the same as mine and it uses a real Lithium Battery CR1020 PCB
soldered to save a battery holder.
You only have 5 components on the pcb 1 battery, 1 DS3231, 2 Resistors, 1 Cap, no charge components
To use the DS3231 on 12c with another board then you can just break the 2 432 resistor in half this or unsolder them this will then let the device share the 12c as it can do.
If you look on the battery just below the welded solder tag you will see 3v and on the end either a C or CR can be seen on mine.
This board does NOT use the super cap as sold by Pi Hut.
TerryR
The ad i got it from says its a supercap lol. I never even noticed cause people complain it just stop ls working and i never looked to notice the missing pieces.

esloudan
Posts: 14
Joined: Wed Nov 16, 2016 12:48 am

Re: Real Time Clock (RTC) help in finding one.

Wed Apr 26, 2017 6:51 pm

gordon77 wrote:
esloudan wrote:Im working on a project and wanna add a rtc to the board. The problem im having is the gpio pins for them is being used by another board. I found the one in the pic. It fits the case im using and uses open gpio pins. By the reviews on it the rtc wont last long. Either u recieve a bad one or goes bad in a few months. Does anyone know of a rtc with the same gpio setup but better quality.
I've had no problems with this one

http://cpc.farnell.com/4d/rpi-rtc/raspb ... pd-mi-acce
I looked at the pin out for this model. It has a scl on top. Could i connect this for the rtc and connect my power on/off button to it?

Return to “General discussion”