CLOCK USING ATMEGA 8

by rengarider in Circuits > Clocks

5519 Views, 16 Favorites, 0 Comments

CLOCK USING ATMEGA 8

CLOCK USING ATMEGA 8

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 well...so let start building

Components List

l (1).jpg
l (2).jpg
l (3).jpg
l (4).jpg
l.jpg
l (5).jpg
l (6).jpg
  • 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

Burning Boot Loader on ATMEGA 8

ATmega8 bootloader, code, Arduino IDE

  • 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

Connecting RTC to Arduino

l (7).jpg
l (8).jpg

  • 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

Uploading Time to RTC

l (9).jpg

  • 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
  • https://drive.google.com/file/d/1yI7EckZE8ESWeCIQO...
  • check out this link for more information

Downloads

Building the Circuit

l (13).jpg
l (10).jpg
l (11).jpg
l (12).jpg
l (15).jpg
l (14).jpg

  • 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

Creating a Outer Case

f.jpg
l (16).jpg

  • 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

Functions of Clock

IMG_4727.JPG
IMG_4728.JPG
  • 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.