Introduction: CLOCK USING ATMEGA 8

About: An Engineer student

ATMEGA 8 is one of the cheapest micro controller ,so i decided to make clock using it.The first thing i came across is displaying time hence most general thing is 7 segment display but i can't display all the text expect few ,so i decided to go with 16X2 LCD .Then i came time keeping where recent most of the micro controller offer internal RTC(Real Time Clock) but ATMEGA 8 we don't have internal RTC so i went with external one.Then i came across power the clock ,atmega can run from 1.8v to 5v so i planned to 1s lipo,it worked pretty let start building

Step 1: Components List

  • Atmega 8 ic
  • 16X2 LCD display
  • DS3231 RTC module
  • 1S lipo battery
  • TP4056 lipo charger module
  • drilled PCB
  • 16MHZ crystall oscillator
  • 22pf capacitor
  • 10K resistor

Step 2: Burning Boot Loader on ATMEGA 8

  • Simplest method is remove the ATMEGA 328 from arduino uno and insert the ATMEGA 8 in it.
  • Connect the SPI pins with another Arduino uno and and burn the boot loader
  • follow this video for better under standing

Step 3: Connecting RTC to Arduino

  • Connect SCL pin of RTC to A5 arduino
  • Connect SDA pin of RTC to A4 arduino
  • Connect VCC pin of RTC to 5v arduino
  • Connect GND pin of RTC to GND arduino

Step 4: Uploading Time to RTC

  • Download the clock program
  • open the code
  • uncomment the following line
  • fix the current time
  • uplode the code
  • now the time is saved to RTC
  • now comment back the lines and upload it again
  • now remove the ATMEGA 8 from the arduino
  • check out this link for more information

Step 5: Building the Circuit

  • Start by soldering the ATMEGA 8 to pcb
  • Then make the oscillator circuit for the ATMEGA 8
  • Refer the atmega 8 pinout
  • Then fix the RTC and LCD module
  • Make the connection according to the circuit diagram
  • Fix the lipo Battery and its charger

Step 6: Creating a Outer Case

  • I don't have 3d printer so i decide to make it using cardboard and covered it using colored duct tape
  • It look shiny and beautiful
  • I will recommend to build a 3d printed case to look more professional

Step 7: Functions of Clock

  • It is in 12hrs format ,so it will display the AM/PM
  • It will display the time with seconds
  • It will show the day and date in every two mins
  • It will show the room temperature in every two mins
  • It has the battery backup ,so even when there is no power it will run on its battery
  • RTC has its own battery ,so even if the battery backup dead the time won't get rest.
  • I hope u will like this project ....!!! Consider subscribing to my YouTube channel !!! Happy Learning.
Clocks Contest

Participated in the
Clocks Contest

1 Person Made This Project!


  • Crayons Challenge

    Crayons Challenge
  • Teach With Tinkercad Contest

    Teach With Tinkercad Contest
  • Halloween Contest

    Halloween Contest



1 year ago

Nice project, I was interested in the simple solution of large numbers using your own characters. I used it in my project with ATmega4808, RTC DS3232M. In addition, it measures two temperatures and allows you to configure what is to be displayed and the brightness of the display. Programmed in AVR studio and C. :-)
AVRtronik - hodiny


A very good Clock project with so many additional features. I like your approach. Expecting more from you and thanks for sharing this project.
Please tell me which line of the code applies lcd.setCursor(xx, x) for the Hour and Minutes digits display.
lcd.setCursor(14, 0);


Question 2 years ago

Nice Project ! can I use Attiny85 and connect this LCD using I2C ? with RTC ?