2cm Height 7 Segments 6 Digits AVR Clock With 4 Digits Thermometer
by arick in Circuits > Microcontrollers
4705 Views, 12 Favorites, 0 Comments
2cm Height 7 Segments 6 Digits AVR Clock With 4 Digits Thermometer
![7 Segments 6 Digits AVR Clock5.jpg](/proxy/?url=https://content.instructables.com/FOP/OCCB/HWII21QX/FOPOCCBHWII21QX.jpg&filename=7 Segments 6 Digits AVR Clock5.jpg)
This project is explaining how to create yourself a 6 digits 7 segments clock with AVR microcontroller
Prepare the Parts for This Project
![7 Segments 6 Digits AVR Clock1.jpg](/proxy/?url=https://content.instructables.com/F5I/G76I/HWII213K/F5IG76IHWII213K.jpg&filename=7 Segments 6 Digits AVR Clock1.jpg)
![7 Segments 6 Digits AVR Clock2.jpg](/proxy/?url=https://content.instructables.com/FUR/P4WG/HWII2145/FURP4WGHWII2145.jpg&filename=7 Segments 6 Digits AVR Clock2.jpg)
![7 Segments 6 Digits AVR Clock3.jpg](/proxy/?url=https://content.instructables.com/FLR/EJM8/HWII214R/FLREJM8HWII214R.jpg&filename=7 Segments 6 Digits AVR Clock3.jpg)
![7 Segments 6 Digits AVR Clock4.jpg](/proxy/?url=https://content.instructables.com/FSS/KLXI/HWII214W/FSSKLXIHWII214W.jpg&filename=7 Segments 6 Digits AVR Clock4.jpg)
We need to prepare a parts for this project,
6x 7 Segments Common Anode
6x PNP transistors for driver, I used 2N3906
6x 1K 1/WW resistors
1x Module ATMEGA128
1x NTC resistor 10K
1x 10K resistor 1/4W
2x Push button for adjusting the hour and minute
1x USB ASP
1x Atmel studio
The Segment Code
![7 Segments 6 Digits AVR Clock4.jpg](/proxy/?url=https://content.instructables.com/FEA/B8IM/HWII2186/FEAB8IMHWII2186.jpg&filename=7 Segments 6 Digits AVR Clock4.jpg)
I have written the segment code for this project,
Please have a look on the picture in this step....
That's how I drive each seven segment with PNP transistor, it's cheap but more than enough for driving 8 segments
The Firmware and MCU Selection
![atmel studio.jpg](/proxy/?url=https://content.instructables.com/F4O/IWRS/HWII21EX/F4OIWRSHWII21EX.jpg&filename=atmel studio.jpg)
You're going to need at least 15 I/O from your MCU for this project,
In my case I used ATMEGA128, but you can use ATTiny2313,ATMEGA8,ATMEGA16 and others family of AVR 8-bits
I'm using interrupt and timer to increase second, you can upgrade to a calendar as well if you one, quite simple and straight forward.
Hex file is included if you want to use ATMEGA128
Here's the setup for my timer and ISR :
ISR(TIMER1_COMPA_vect)
{ seconds++;
if(seconds == 60) {
seconds = 0;
minutes++; }
if(minutes == 60)
{ minutes = 0; hours++; }
if(hours > 23) hours = 0; }
Downloads
The Demo in Video
![7 Segments 6 Digits AVR Clock5.jpg](/proxy/?url=https://content.instructables.com/FEE/ORBD/HWII20R8/FEEORBDHWII20R8.jpg&filename=7 Segments 6 Digits AVR Clock5.jpg)
![7 Segment 6 digits Clock 24 HR with AVR](/proxy/?url=https://content.instructables.com/F2H/MC37/HWJJZ3Q7/F2HMC37HWJJZ3Q7.jpg&filename=7 Segment 6 digits Clock 24 HR with AVR)
![7 Segment 6 digits clock with 4 digits thermometer](/proxy/?url=https://content.instructables.com/FUN/L3L6/HWLD27IF/FUNL3L6HWLD27IF.jpg&filename=7 Segment 6 digits clock with 4 digits thermometer)