Alarm Clock, Calendar and Temperature Meter With AVR ATmega8A

Electronics and Programming tutorials and projects

Alarm Clock, Calendar and Temperature Meter With AVR ATmega8A

alarm clock calendar

ATmega8A is an AVR 8 bit microcontroller which has 28 pins. The “Alarm Clock And Calendar with AVR ATmega8a” project uses this microcontroller as its main processor and a standard 16×2 Character LCD without using any additional module.

There’s a source code folder in this project which contains the CodeVision program files (C) and pre-compiled HEX file. To re-compile or check out the source code, open “ClockCalendar.prj” with codeVision AVR software.

The calendar can be toggled between Gregorian calendar and Persian calendar. It shows hour, minute, second, temperature, year, month, day and the day of week.
The tested compiler revision is CodeVisionAVR 3.12

alarm clock calendar avr atmega8a

Here’s the fuse setting:

alarm clock calendar avr atmega8a fuse
 
The microcontroller uses an external crystal 8.000000MHz oscillator. Also the BOD is enable to check the voltage if it is not under 2.9v.
The 16×2 character LCD pins already has been set in the program (According to the schematic).

Alarm Clock Project Compilation

Before compiling the project, go to “headers.h” file and Search for “#define SIM”. In case you are going to test the program with “Proteus Software”, it should not be logged.
But if you’re going to upload the program into the microcontroller, log it with two slashes:
//#define SIM
Furthermore you can compile the project with ctrl+F9.

The Schematic
Here’s the schematic plan which is compatible with the project.
 alarm clock calendar avr atmega8a schematic
In the power sector, there’s an input for 3-4 volt battery, for when the circuit is unplugged from the main 5v power source, to saving the time data.
There are 3 push buttons to set the clock, alarms and calendar. There is a temperature sensor which connects to the PC4. RT is a 10K Ohm NTC resistor and R4 is a 20K ohm pull up resistor.
The microcontroller doesn’t generate audio frequency, just it pulls up and down T1 and causes the Buzzer’s beep.

Proteus Simulation File

Also in this project there is a Proteus simulation file inside of “sim” folder. Open it with Proteus Schematic and set the project .COFF file by double click on the microcontroller, then run the simulation.

Clock and Calendar Settings:
There are 3 push buttons, SET, UP and DOWN. By pressing SET, the minute will blink and can be set with UP and DOWN.
By pressing again the hour will blink, then year, month and day.
The day of week will be set automatically.
Also By pressing DOWN (in the calendar state), the calendar will toggle between Gregorian calendar and Persian calendar.
Furthermore By pressing UP in the calendar state, Alarm 1 can be set and ON or OFF will blink:
 
Then if you press SET again, the alarm hour and minute will blink and the Alarm 2 and etc.

calendar avr atmega8a set

The source code of the project is available in the following:

 

One Response

  1. Eng. says:

    Hi there it’s me, I am also visiting this web page on a regular basis, this site is really pleasant and the viewers are genuinely sharing good thoughts.

Leave a Reply

Your email address will not be published. Required fields are marked *

6 − one =