Pages: [1] 2   Go Down
Author Topic: DS1307 reading time  (Read 1343 times)
0 Members and 1 Guest are viewing this topic.
Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I am having issues making a clock.  Mainly the clock part.  I was wondering if anybody has an reccomendations for a 1307 RTC library.  there are so many and I don't know which to use.

I just want to be like, this is the time in the void setup and then in the loop just read the time and display it on a 7 segment using other code. 
Logged

Accelerate to 88 miles per hour.

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I use this https://github.com/davidhbrown/RealTimeClockDS1307 library and am very happy with it, though I'm not so happy with the accuracy of the DS1307 (mine looses 7.6 seconds per day but have found a clunk way to improve it).
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Offline Offline
Edison Member
*
Karma: 31
Posts: 1417
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
reccomendations for a 1307 RTC library.  there are so many and I don't know which to use

Have you actually tried any of them?
Experiment.

Pete
Logged

Where are the Nick Gammons of yesteryear?

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


I use this https://github.com/davidhbrown/RealTimeClockDS1307 library and am very happy with it, though I'm not so happy with the accuracy of the DS1307 (mine looses 7.6 seconds per day but have found a clunk way to improve it).

Unhappy with it? Is there a better RTC? I thought that in order for it to be called a RTC, it had to be accurate.
do you use a seperate chip?
Logged

Accelerate to 88 miles per hour.

Offline Offline
Edison Member
*
Karma: 31
Posts: 1417
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The DS1307 does not contain a crystal to provide the clock pulses. Its accuracy is entirely dependent upon the accuracy of the external 32.768kHz crystal that is used to generate the clock signal.
If you want more accuracy you could try the DS3234 (SPI) or DS3231 (I2C) which use an internal temperature controlled crystal oscillator. They are specified as being within two parts per million which is a bit less than plus or minus three seconds per month.

Pete
Logged

Where are the Nick Gammons of yesteryear?

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay thank you!
Logged

Accelerate to 88 miles per hour.

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As el_supremo says the DS3231 is a very accurate RTC I have six of them now and am very happy with them. Compared to the DS1307 the DS3231 does not have the few bytes of memory but it does have temperature and 2x definable alarms.
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2808
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

By the time you buy that hardware and get the code to set/reset it it is cheaper to do a GPS... the time signal only needs 1 or 2 sats... works for me...

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

By the time you buy that hardware and get the code to set/reset it it is cheaper to do a GPS... the time signal only needs 1 or 2 sats... works for me...
I would love to have GPS accuracy in my clocks but they don't pick-up a signal in the house. I even have a problem picking up MSF radio time signal in some places.
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2808
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bad Luck Mine will get basic time almost anywhere, what about a radio kink to  a place where the GPS does?... might even have other things to use a "time Code"... as a matter of fact that might well solve a ports issue i have with my Uno... Offload the gps functions and use a nordic radio to "Broadcast" a time code to whatever needed it, I have 2 clock displays now one scrolling and one for my console.Sure would leave me a lot more time for managing the other stuff If I did it that way, I bought a couple of Mini-pro's for $10.00 ea last week. Perfect idea... better I think than trying to get it all working on a Mega as I had intended.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Offline Offline
Newbie
*
Karma: 3
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I use this https://github.com/davidhbrown/RealTimeClockDS1307 library and am very happy with it, though I'm not so happy with the accuracy of the DS1307 (mine looses 7.6 seconds per day but have found a clunk way to improve it).

Yeah, I've mucked around with a bunch of them, and that's the one I eventually settled on as well.  The DS1307 library that Adafruit uses (forked from JeeLabs) is a decent start, but I seem to remember running into limitations fairly quickly.  IIRC the time setting code was weird?  It's been a while.

The DS3231 is nice and relatively straightforward plugin replacement for the 1307, but depending on your budget, the 1307 and supporting crystal/battery/etc can be had for under $2.  If you're designing a new PCB, swapping a TH 1307 for a SMD 3231 is no big deal, but if you need to adapt it to protoboard and have to buy a $15 Chronodot or similar, the price differential starts to add up.  The 1307 is accurate enough for most applications.  Within reason.
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm, good to know.  I'm looking at making a watch so it kinda needs to be pretty accurate
Logged

Accelerate to 88 miles per hour.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 58
Posts: 3996
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

By the time you buy that hardware and get the code to set/reset it it is cheaper to do a GPS... the time signal only needs 1 or 2 sats... works for me...
I would love to have GPS accuracy in my clocks but they don't pick-up a signal in the house. I even have a problem picking up MSF radio time signal in some places.

If you have electric service inside the house then you have a bedrock-solid pulse source that a Hall sensor should be able to pick up.
Logged

Examples can be found in your IDE.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've never done anything with hall effect sensors. I don't understand them.  What do they do?
Logged

Accelerate to 88 miles per hour.

Offline Offline
Edison Member
*
Karma: 17
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've never done anything with hall effect sensors. I don't understand them.  What do they do?

Sense magnets. You supply power and ground, they provide a signal. Some of them are just high/low when they see any magnetic field, some are pole specific, others are one pole on until it sees the other pole.
Logged

Pages: [1] 2   Go Up
Jump to: