This page describes how you can use a small AVR device and a real-time clock (RTC) to build a hot-pluggable USB real-time clock (I’ve named it just usb-rtc), mainly for usage with ultra-low-cost hardware meant to be used with Linux.
The overall cost for one of those thingies I’m describing here is about 15€-20€, which isn’t really cheap. But I find it a valuable thingy because the result is a hot pluggable RTC, usable by almost any device which has USB. So it’s very likely you will use it for much longer than the device you currently want to build or search it for. In addition you might want to use it as a (hot pluggable) USB-I2C adapter too. The software I’m describing below already supports that.
To give you an impression about how it might look afterwards, here are some pictures of the ones I’ve build (above).
If you are a perfectionist, hardware developer or want to use such a device in some production environment, be warned: everything I’m describing here breaks several rules, so it’s very likely you don’t want it. E.g. the USB solution is bit-banged (implemented by software only) which likely breaks several requirements defined by the USB Implementers Forum. And for the I2C connection I don’t even use (external) pull-up resistors, which normally are necessary.
So everything might have a bad taste for you, but as a homebrewn solution for cheap devices without a RTC, a quick’n dirty device I didn’t want to spend much time for building it, it just works. At least for me and most of the time. 😉
8-6-2021 (August 6, 2021) is the Snakiest day of the year and it’s also this year’s CircuitPython Day! The day highlights all things CircuitPython and Python on Hardware. See you there!
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.