PIR as a Switch with timer

Status
Not open for further replies.

peterjohn0000

Newbie level 6
Joined
Aug 29, 2012
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,353
Can somebody help me!
I want to use PIR as a substitute for light switch!

All I want to do is interface the PIR with a timer! When the sensor detect a person the it will send a signal to timer that will make the ligh on! The reason i want a timer is the light will no immediately turn off when the sensor goes low! Please no program is required!

Thanks in advance!
 

initialize two interrupt routine 1, External interrupt 2, Timer interrupt
PIR connect to an interrupt Pin
Device connect to GPIO pin
clear timer register ,stop timer ,deactivate the device

wait for interrupt while(1);

1, when External interrupt occur activate light , clear timer register ,start timer finally exit from External interrupt routine.
2, when timer interrupt occur deactivate the device , stop timer finally exit from timer interrupt routine.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…