{"id":153,"date":"2019-02-21T19:02:10","date_gmt":"2019-02-21T19:02:10","guid":{"rendered":"http:\/\/pi.peernix.com\/?p=153"},"modified":"2019-02-21T19:02:10","modified_gmt":"2019-02-21T19:02:10","slug":"timecop-arduino-real-time-clock-with-a-ds3231-and-16x2-display","status":"publish","type":"post","link":"http:\/\/peernix.com\/?p=153","title":{"rendered":"TimeCop &#8211; Arduino Real Time Clock with a DS3231 and 16&#215;2 display"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"> After I finished my last Real Time Clock project, I was relatively happy with the outcome, well, everything except for the accuracy; and what good is a clock without accuracy? I used the DS1302 which I\u2019m sure is a pretty decent RTC(real time clock), if you pair it with a crystal that\u2019s perfectly matched for it.  But for some reason, my 32KHz crystal and DS1302 combo didn\u2019t really do the business. It proved to stray significantly over time, perhaps a minute a month. I had been aware of another, much better RTC chip at the time, from the same manufacturer, the DS3231, but my board was one that I etched, and used all through hole components, with only one exception, and the DS3231 was an SMD package.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, after being fed up with straying time, I decided that it was time to redo the board, and utilize the DS3231. The package is an SOIC-16, and is temperature compensated, and very precise. I can also access the temperature sensor in the chip, so if the output was satisfactory, I could use that for temperature, instead of the DS18b20. I decided I would try to cut down on the total size of the board, and make it the same size as a popular 16\u00d72 display, so it could be mounted to the back of such a display. Because of this, I decided I would use mainly SMD parts, including the QFP version of the Atmega328p.<\/p>\n\n\n\n<a href=\"https:\/\/imgbb.com\/\"><img decoding=\"async\" src=\"https:\/\/i.ibb.co\/QHgy3LK\/Screenshot-2019-02-21-12-37-25.png\" alt=\"Screenshot-2019-02-21-12-37-25\" border=\"0\"><\/a>\n\n\n\n<p class=\"wp-block-paragraph\">Using Kicad, I worked from the previous clocks design, substituting the RTC. Additionally, I added a button to toggle the backlight on and off. I also had acquired some micro USB ports from eBay. Because of their small size, I was slightly weary of using them, so I made a footprint and included it in the board layout, but also included a footprint for a mini USB port, one that I had used before, as a backup, in case something went wrong with the micro port.<\/p>\n\n\n\n<a href=\"https:\/\/imgbb.com\/\"><img decoding=\"async\" src=\"https:\/\/i.ibb.co\/hVJcwDp\/2019-02-21-12-35-59.jpg\" alt=\"2019-02-21-12-35-59\" border=\"0\"><\/a>\n\n\n\n<p class=\"wp-block-paragraph\">When I got the boards back from the board house, I was pretty happy with them, they seemed to have turned out nicely.  There were just a couple minor issues. I tried to hide the silkscreen part numbers under the parts, but because of size limitations, this proved to be unwise; the silkscreen was basically unreadable in certain locations. The mounting holes were also a bit too small. Having gone with a footprint someone else had created for the display to use as a guideline for board size, I had not checked the mounting hole size. Those could be drilled out, so not a real problem. The micro USB port had turned out perfectly, however, and I was satisfied that I could use this small, robust, and very popular connector in my projects.<\/p>\n\n\n\n<a href=\"https:\/\/imgbb.com\/\"><img decoding=\"async\" src=\"https:\/\/i.ibb.co\/FVNnQjW\/2018-01-19-13-08-05.jpg\" alt=\"2018-01-19-13-08-05\" border=\"0\"><\/a>\n\n\n\n<p class=\"wp-block-paragraph\">The DS3231 proved to be a very accurate RTC, and it strays so little I haven\u2019t been bothered to keep track of the rate; seemingly only a second every month or so, if that.  It sits on my desk, and I reference it frequently. I\u2019ve made a stand for it, and the display for my fan controller, and have 3D printed a shroud for the displays.  <\/p>\n\n\n\n<a href=\"https:\/\/imgbb.com\/\"><img decoding=\"async\" src=\"https:\/\/i.ibb.co\/ZM6bJxh\/2018-01-19-12-29-39.jpg\" alt=\"2018-01-19-12-29-39\" border=\"0\"><\/a>\n","protected":false},"excerpt":{"rendered":"<p>After I finished my last Real Time Clock project, I was relatively happy with the outcome, well, everything except for the accuracy; and what good is a clock without accuracy? I used the DS1302 which I\u2019m sure is a pretty decent RTC(real time clock), if you pair it with a crystal that\u2019s perfectly matched for<\/p>\n<div class=\"more-link\"><a href=\"http:\/\/peernix.com\/?p=153\">Read More<\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[10,12,25,38,47],"class_list":["entry","author-datz","post-153","post","type-post","status-publish","format-standard","category-electronics","tag-arduino","tag-atmega328p","tag-ds3231","tag-kicad","tag-pcb"],"_links":{"self":[{"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/peernix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":0,"href":"http:\/\/peernix.com\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"wp:attachment":[{"href":"http:\/\/peernix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/peernix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/peernix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}