G+_Rob Allen Posted September 15, 2017 Share Posted September 15, 2017 Consider avoiding the TinyRTC module and others based upon the antiquated DS1307. Sorry for the lateness of this info, but I only have irregular Internet access and am generally weeks behind. In Know How episodes #327 and #333, Padre lists the TinyRTC AT24C32 and reports that his LED clock base is designed to fit this particular board. He likely chose this board because of its low cost and reasonable size, but there are better, smaller modules available at similar cost as I'll discuss below. The TinyRTC is based upon the DS1307, which is surprisingly inaccurate compared with other solutions. The DS1307 typically drifts seconds per /day/ and I recommend avoiding it for this reason alone. It seems rather bizarre to spend so much time and money on a clock project, yet wind up with a clock that doesn't keep accurate time! I contend that the DS1307's successor, the DS3231, is a better solution. There are some other minor differences, but the main advantage is the boost accuracy provided by its internal oscillator. http://www.switchdoc.com/2014/09/real-time-clock-python-libraries-raspberry-pi/ http://www.switchdoc.com/2014/09/real-time-clock-comparison-results/ The DS3231 also consumes 1/5th as much power from VCC and will operate down to 2.3V, which is better for battery-powered Arduino projects. One way to increase battery life with ATmega328's is to run them at 3.3V instead of 5V (a typical lipo cell is 3.7V), but you simply can't do that with a connected DS1307 RTC, as they require at least 4.5V. The most common DS3231 modules are available on eBay for just over $1, but most don't come with batteries so you may want to look around for options that do or buy your own batteries either locally or online. Packs of batteries are inexpensive on eBay and all claim to be fresh, but I would choose high-volume sellers with consistent (99% or higher) positive feedback to improve my chances. Lithium button cells typically have at least a 7-year shelf life. Without battery: http://ebay.to/2xmWQMG With battery (choose from drop-down menu): http://ebay.to/2weIk9J Extra batteries: http://ebay.to/2xCQ7BK http://ebay.to/2y9Ziq4 Other options also exist. For example, I'm currently using a module often listed on eBay as a "DS3231 module for Raspberry Pi" which can be found for around $1.25 (I've seen them as low as $0.90/ea.): http://ebay.to/2wyPDeP The battery is included with this module, BUT it is soldered to the PCB and is thus non-replaceable. However, the overall package is very small and the female pin header could be removed to make it even smaller. When a battery eventually dies, I'll just replace the whole module. These "Raspberry" modules lack headers for the INT/SQW, 32K, and RST pins, but most projects, including the Know How LED Clock, don't use them. The female header complicates breadboard insertion, but this can be resolved with some male jumpers or 4 short pieces of wire. On the positive side, this module uses the industrial "SN" version of the DS32321, which maintains accuracy in more extreme temperatures (i.e. weather stations in cold climates, etc). A breadboard-compatible option that also uses the SN version of the DS3231 is the "Chronodot v2.1". The genuine boards are expensive in web stores, but Chinese clones are available on eBay for less than $2: http://ebay.to/2izVLxK You do need to install pullup resistors (4.7K or 10K) for the Chronodot's I2C lines, though, which come pre-installed on most other modules. As with most eBay options, these are also usually sold without batteries (CR1632 for v2+ of the PCB, but check the item description). I'd really like to see the DS1307 fall out of favor with Arduino enthusiasts. It's very bad at timekeeping and it costs just as much as better RTC's unless you buy a 50-pack as Padre did ;). I have never found a project where I wanted an /inaccurate/ RTC, so I hope Padre doesn't eventually regret owning a huge bag of bad clocks ;). Link to comment Share on other sites More sharing options...
G+_Fr. Robert Ballecer, SJ Posted September 15, 2017 Share Posted September 15, 2017 Great Info! thanks! Link to comment Share on other sites More sharing options...
G+_Paul Hutchinson Posted September 15, 2017 Share Posted September 15, 2017 Wow what an amazing price on the RTC with the built-in TCXO. The DS3231 IC alone is $7+ in singles and $4 each for a 1000pcs. Although with a price that low I wonder if they are using bootleg ICs to make the modules. Link to comment Share on other sites More sharing options...
G+_Rob Allen Posted September 22, 2017 Author Share Posted September 22, 2017 It's reasonable to suspect that these inexpensive models are built upon a generic DS3231, but my own tests so far indicate that their performance is equal or better than the figures quoted in the Maxim datasheet and every register I've tested has behaved as expected. If they are fakes, they are good ones ;). Coincidentally, I can report that a test of one of my DS3231 modules has just passed the 90-day mark and it lost approximately 2 seconds after 7,776,000 seconds; an accuracy of -0.25ppm. The specification is plus or minus 2ppm, so this unit and the one tested in the previously linked benchmark are both comfortably more accurate than specified. About half of the test duration was at room temperature and the other half was spent monitoring a refrigerator at a range from -19C to 5C. The module remained unpowered and running from battery backup almost the entire period; I only occasionally hooked it to USB in order to log the temperature. Accuracy can be calibrated further using the Aging Offset register to decrease or increase the speed by ~0.1ppm per bit (see DS3231 datasheet for details). However, these RTC's seem to be more than good enough out of the box. Link to comment Share on other sites More sharing options...
Recommended Posts