Making a clock with a common microcontroller like an Arduino isn’t very difficult. However, if you’ve tried it, you probably discovered that keeping track of wall time is difficult without some external hardware. [Barzok] has a very minimal clock build. It takes a handful of LED arrays with an integrated driver, an Arduino Nano, a real-time clock module, and a voltage regulator.
The software uses a custom 6×9 font and handles addressing the LEDs as one single display. Because the real time clock module is so accurate, there’s no provision for setting the time. [Barzok] says that twice a year he just hooks the Arduino up and reflashes the program with a new start time and that seems to be sufficient.
It wouldn’t be too hard, though, to add a few buttons to allow for setting the time or accepting other user input. Then again, this is a minimal build. It would be a good starter project for someone looking to get into building microcontroller projects.
If you want really minimal, you could go with a 4 LED clock (but you better know the resistor color code). Of course, an ESP8266 can serve as a simple clock and it gets set via NTP which is even better.
It’s about time we had an article like this.
A very good use of a first post, sir. Hat-tip.
It’s always nice to be appreciated! :-)
I’ve been down this road, and it was an eye opening education. In my case, it was the Crazy Clock – a microcontroller lavet stepper motor driver driven by a crystal. To make a long story short, what I learned was that when they talk about crystals having a particular tolerance (like 10 ppm), that doesn’t mean that they’re going to be within 10 ppm of their labeled frequency. It means they’ll be within 10 ppm *of each other*. I had to try several values of loading caps to get close, and even then the result was a batch of boards that averaged 5 ppm fast, ± 10 ppm.
This same thing applies to RTC chips with external crystals, like the DS1307. I’ve taken to using the Pericom PT7C4311WEX, since it has a trimming register.
Use a DS3231 instead.
It costs nearly an order of magnitude more than the PT7C4311WEX.
The DS3231 has a temperature compensated crystal oscillator (TXCO) that is far more accurate then the normal 32.768 kHz crystals.
And often a yearly drift of an additional 5ppm.
If accuracy and stability is required, have a look at mems oscillators.
Or hook up a GPS receiver.
It means they are within +/-10ppm when they have their specified loading capacitance attached. Of course taking into account any pin and stray capacitance. If you need to be more accurate in a small batch you could just use trimmer capacitor. The caps do not have to be exactly equal to work.
thanks win-source.net
No caps on the LM7805 that is powering everything else directly. Is this perfectly fine or asking for trouble?
It can be perfectly fine, if you need a HF transmitter (CW only). :-) One time (20-30yr ago) I had an (east german) 7812 in TO3 case. I did not know about the caps. I connected wires and some voltage and niced a strange behavior of my soldering station: The bar-graph type temperature indication went completely down and the “heat” LED come on. After some seconds when I switched the 7812 off, the indicated temp was about 10-20°C higher than before.
A closer look with the O’scope showed an oscillation of 2-3MHz and several Vpp. This caused RFI and knocked out the temperature measurement.
Putting big caps on the output of linear regulators isn’t always a good thing. ST’s datasheet for their 7805 only recommends 0.1 uF on its output. ST says even that isn’t necessary, though it does improve transient response. Remember that a linear regulator is essentially a high-power op-amp, so capacitance across the output just makes it work harder. As for decoupling, I’m sure the Nano and the RTC board have enough. As for the INPUT to the 7805, that’s a different story. ST recommends 0.33 uF on the input, and that means RIGHT at the input, not at the other end of an inductive feed. In fact, they warn that you must use a capacitor with low impedance at high frequencies on the input to prevent instability.
That was in response to Mike Rogers.
And for a TL431 100nF is the worst you can do. It’s right in the middle of the range of oscillation. You can use some nF or some µF but not 100nF. So it depends and you should read the datasheet.
The age of the Arduino clocks comes to an end, when you can have ESP8266 boards for the same price, that can pull the accurate time from the Internet.
On the wall behind my desk, there’s currently a Wemos D1 mini board with an oled shield and a BME260, that shows the time, temperature, humidity and air pressure.
Why would I mess around with Arduinos and RTC modules anymore?
OK, in case of a Zombie apocalypse, it could be handy to be able to still count the passed months even off the grid.
What if you want to run from a small battery, for example? And besides, building a clock is really about the learning experience given you can pick up a watch or clock for the cost of half a coffee.
link doesn’t seam to work..
Ive got a couple of esp8266 projects Im working on now.
I cant wait to get my hands on the esp32.
Very good project.
You can sync the clock with your own wireless GPS based NTP server, no internet connection needed!
http://www.absolutelyautomation.com/articles/2016/09/15/esp8266-based-wireless-ntp-server-no-internet-connection-needed