Create Yourself a Clock With Temperature Sensor, Battery Sensor and Alarm
by arick in Circuits > Microcontrollers
2640 Views, 20 Favorites, 0 Comments
Create Yourself a Clock With Temperature Sensor, Battery Sensor and Alarm
![IMG_20131028_104757.jpg](/proxy/?url=https://content.instructables.com/FNY/JVWO/HN82NV06/FNYJVWOHN82NV06.jpg&filename=IMG_20131028_104757.jpg)
Guys,
This weekend I have made myself a clock with battery sensor, temperature sensor and alarm,
I'm using ATMEGA128 for it.
Let's get started
This weekend I have made myself a clock with battery sensor, temperature sensor and alarm,
I'm using ATMEGA128 for it.
Let's get started
The Components I Used
![IMG_20131028_104810.jpg](/proxy/?url=https://content.instructables.com/FKU/4ZVH/HN824D7R/FKU4ZVHHN824D7R.jpg&filename=IMG_20131028_104810.jpg)
![IMG_20131028_104802.jpg](/proxy/?url=https://content.instructables.com/F8O/WQBE/HN824D7S/F8OWQBEHN824D7S.jpg&filename=IMG_20131028_104802.jpg)
![IMG_20131028_104757.jpg](/proxy/?url=https://content.instructables.com/F50/VBMO/HNB0W0KK/F50VBMOHNB0W0KK.jpg&filename=IMG_20131028_104757.jpg)
![IMG_20131028_104750.jpg](/proxy/?url=https://content.instructables.com/F38/VQ9A/HN82NV0K/F38VQ9AHN82NV0K.jpg&filename=IMG_20131028_104750.jpg)
I used this components to build my clock :
1. ATMEGA128
2. LCD 16x2
3. Speaker
4, Some buttons
5. DS1307
6. I made myself a PCB, if you need one just contact me,
I have some spares for creating this project.
Now let's continue on the code....
1. ATMEGA128
2. LCD 16x2
3. Speaker
4, Some buttons
5. DS1307
6. I made myself a PCB, if you need one just contact me,
I have some spares for creating this project.
Now let's continue on the code....
The Code for This Experiment
![the code2.jpg](/proxy/?url=https://content.instructables.com/FMI/IPEJ/HN82NV0X/FMIIPEJHN82NV0X.jpg&filename=the code2.jpg)
![the code1.jpg](/proxy/?url=https://content.instructables.com/FSW/CYPQ/HN81YOIP/FSWCYPQHN81YOIP.jpg&filename=the code1.jpg)
![eeprom.jpg](/proxy/?url=https://content.instructables.com/F6Q/IVPO/HN82NVBB/F6QIVPOHN82NVBB.jpg&filename=eeprom.jpg)
The main code for this experiment is the eeprom,
we need to write and read eeprom on atmega to set the alarm
I give the main idea for it :
case 2:
alarm_minute++;
tone(50);
_delay_ms(50);
tone(0);
if (alarm_minute >= 60)
{
alarm_minute = 0;
}
eeprom_update_byte (&minute_ee, alarm_minute );
state_var = SET_ALARM_MINUTE;
break;
next step, let's watch my experiment .....
we need to write and read eeprom on atmega to set the alarm
I give the main idea for it :
case 2:
alarm_minute++;
tone(50);
_delay_ms(50);
tone(0);
if (alarm_minute >= 60)
{
alarm_minute = 0;
}
eeprom_update_byte (&minute_ee, alarm_minute );
state_var = SET_ALARM_MINUTE;
break;
next step, let's watch my experiment .....
Enjoy the Video Mates !.....
![IMG_20131028_104750.jpg](/proxy/?url=https://content.instructables.com/FAB/PN2J/HN8263TS/FABPN2JHN8263TS.jpg&filename=IMG_20131028_104750.jpg)
![IMG_20131028_104802.jpg](/proxy/?url=https://content.instructables.com/FKY/CGAU/HNB0W0LS/FKYCGAUHNB0W0LS.jpg&filename=IMG_20131028_104802.jpg)
Let's enjoy the video :
I set the alarm to run for 1 minute....
Till the next experiment..
Cheers
I set the alarm to run for 1 minute....
Till the next experiment..
Cheers