DIY Arduino Analog Clock

by mircemk in Circuits > Arduino

391 Views, 2 Favorites, 0 Comments

DIY Arduino Analog Clock

APH2.jpg

An interesting nice looking clock, which is also extremely simple to build.

Supplies

  The device consists of several components:

  - Arduino Nano microcontroller

   - ST7920 chip based LCD display with 128x64 dots resolution

   - three buttons

  • Led
  • Switch
  • 9vBattery
  • Resistor470R
  • Resistor220R

Description

DIY Arduino analog clock

  This time I will show you how to make an interesting nice looking clock, which is also extremely simple to build. The exact time time is displayed on a large LCD screen in the form of an elliptical analog clock. The time can also be easily adjusted with the help of three buttons. In this case, for the sake of simplicity, a real-time clock module is not used, so the accuracy is not so high and depends mostly on the crystal within the microcontroller.

Building, Code, and Schematic

Schematic.jpg

  The basic code is downloaded from the blaber.com.pl site by adjusting it to the above-mentioned display which is more accessible and much cheaper than the original. Code is a modification of the digital clock, and although it works, it still requires a lot of work on the graphics. This is a great example of how to use the u8g2 library to draw objects and write text on different types of displays.

  When switching on, the time is 12:00 and we have to manually set the current time. We make it easy with the help of three buttons. The middle button is used to enter the settings mode, and with the first click the Minutes are set, and with the second click the Hours. In settings mode, the arrows are moved with the help of the other two buttons. When it comes to precision, considering that we do not use RTC module the clock is quite accurate. In my case for 24 hours the difference between real time and that of the clock was only a few seconds.

 Finally, the device is built into a suitable box made of PVC material with thicknesses of 3mm and 5mm and coated with self-adhesive colored wallpaper.