Translate

Thursday 14 December 2017

Textual description of firstImageUrl

Automatic door open Close system using AtMega16A and PIR Sensor

PIR Sensor and DC Motor Interfacing with ATMega16A




Instruction
Create new project make Circuit as given figure If you do not find PIR Sensor in in your library download and the extract it and add the library to your C:// >> Labcenter Electronics>>Library
Note that " .hex, .IDX, .LIB" file should be added to library
After that click on you will find the PIR sensor and now you have to browse hex file of PIR sensor into PIR, double-click on PIR Sensor and include it
Now you are ready to browse your hex file of your code to the controller


Before applying this code you must check your delay. that means to calculate the taken time to open and close your door. this is very important. otherwise, It may possible to exceed your motor beyond the door thank you.
 * led.c
 *
 * Created: 12/8/2017 11:21:33 AM
 * Author: Om
 */ 

#ifndef F_CPU
#define F_CPU 8000000UL
#endif
#include <avr/io.h>
#include <util/delay.h>
//#define pir PORTC=0x01

int main(void)
{
DDRA = 0xff;
DDRC = 0x00;
    /* Replace with your application code */
    while (1) 
    {  
if(PINC & (1<<PORTC)){
PORTA = 0x46;//01000110 door opening
_delay_ms(1000);
PORTA = 0x8f;
_delay_ms(200);
PORTA = 0x89;//10001001 door closing
_delay_ms(1000);
PORTA = 0x00;

}
    }

}



If You want further query please comment on comment box or leave message in message box

Thank You.


                                      Give Something to the world and it will never let you down. 
                                                                                           Onkar Dubey 

 

No comments:

Post a Comment