Step by Step Home Alarm Using ATMEGA128
by arick in Circuits > Microcontrollers
5422 Views, 20 Favorites, 0 Comments
Step by Step Home Alarm Using ATMEGA128
In this step by step, I wanna share my experiment using ATMEGA128 with LCD and PWM to drive a sirene,
I created at home as alarm, I'll put a sensor on it for activating, but I haven't done it yet,
I don't have the sensor yet so far :)
Let's get started, it's easy and simple
I created at home as alarm, I'll put a sensor on it for activating, but I haven't done it yet,
I don't have the sensor yet so far :)
Let's get started, it's easy and simple
The Next Step Is Preparing the Part
I need these parts for the experiment,
1. Small speaker, you can use any speaker or buzzer.
2. ATMEGA128 itself.
3. USBISP
4. LM386
5. LCD 16x2
6. Trimpot
7. Some female to female wires
8. AVR Studio
1. Small speaker, you can use any speaker or buzzer.
2. ATMEGA128 itself.
3. USBISP
4. LM386
5. LCD 16x2
6. Trimpot
7. Some female to female wires
8. AVR Studio
Connect Them All Together...
The most important think that I must see,
is the connection between LCD and speaker from ATMEGA128 port,
In this project
I used PORTA and PORTD for LCD and PORTB.5 as an output to the speaker
is the connection between LCD and speaker from ATMEGA128 port,
In this project
I used PORTA and PORTD for LCD and PORTB.5 as an output to the speaker
Prepare the Code...
I used AvrStudio for coding this project,
In this tutorial I'll show the main code in C
int main(void)
{
DDRA = 0xFF;
DDRD = 0xFF;
pwm_init();
lcd_init();
while(1)
{
lcd_cmd(0x80);//put the cursor into the first row
_delay_ms (10);
lcd_cmd(0x01);//Clear display
_delay_ms (10);
lcd_string("ALARM ON!");
lcd_cmd(0xC0);//goto second row
lcd_string("Voice...");
_delay_ms(1000);
//next screen
}
}
In this tutorial I'll show the main code in C
int main(void)
{
DDRA = 0xFF;
DDRD = 0xFF;
pwm_init();
lcd_init();
while(1)
{
lcd_cmd(0x80);//put the cursor into the first row
_delay_ms (10);
lcd_cmd(0x01);//Clear display
_delay_ms (10);
lcd_string("ALARM ON!");
lcd_cmd(0xC0);//goto second row
lcd_string("Voice...");
_delay_ms(1000);
//next screen
}
}
Have It a Test and Enjoy Yourself Home Made Alarm...
That's it folks
Have it a test and enjoy yourself home made alarm...
The video of this project :
Thanks for reading
Have it a test and enjoy yourself home made alarm...
The video of this project :
Thanks for reading