Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to delay PIR sensor module output

Status
Not open for further replies.

p_kiran76

Newbie level 2
Newbie level 2
Joined
Aug 8, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,301
Dear Sir,

I have designed a security system using PIR sensor module i have successfully interfaced with micro controller and is working that is as it detects the motion alarm starts ringing for preset time, however I want to delay the sensor module output so that when motion exists for short time ( 1 or 2 minute ) it should be ignored and if motion exists more than 1 or 2 minute then only module will give me output. I have connected jumper to H position. please help i have tried with the help of microcontroller like ring the alarm after 1 minute after motion detection, however it rings alarm if motion for short time exists.

Kindly help !
 

As an alarm system installer :cool: i would suggest built a pulse/time system like almost all alarm systems have.

Assign how many pulses (motion detections) must occur and in what time window.
e.g. if u assign pulses=3 and time=30 seconds, then the PIR must detect 3 motions in 30 seconds, in order to start the siren. If only 2 are detected, after 30 seconds, pulses=0.
Something like:


Code:
unsigned int pulse_counter, timer;

reset{
      pulse_counter=0;
      timer=0;
      }

motion_detect{
                  if (pulse_counter<3 & timer>30){ 
                                                  reset;
                                                  }

                  if (pulse_counter>3 & timer<30){ 
                                                  start_alarm;
                                                  }

                  if (pulse_counter<3 & timer<30){ 
                                                  pulse_counter++;
                                                  delay_ms(1000);
                                                  timer++;
                                                  }
             }

main{
          **if motion detected** goto motion_detect; 

     }

Its a quick code diagram i made to help you.
 

Dear Xbased,

Thanks for your excellent solution, i will definately try the logic, but what about the hardware because in PIR sensor module there is a 3-pin jumper selection for single or continuous trigger output mode. The two positions have labels H and L. When the jumper is at H position, the output remains high when the sensor is re-triggered repeatedly. In position L, the output goes high and low every time the sensor is triggered. So a continuous motion will give repeated high/low pulses in this mode. then should I keep jumper at L mode to implement above logic.
 

You need to get a pulse for every detection from the module.
Also you have to make the MCU determine if there is a real alarm and not trying to delay the module detection.
So the module detects every motion, transfers every motion to the MCU, then the MCU makes the calculations and gives the alarm output or not.

Also i made a mistake with the above diagram, the timer thing is wrong (increases only on every motion, not every second).
You have to use Timer0 or Timer1 for that, start Timer when a detection occur, run the rest of the code until alarm or until Timer interrupt occur(30 sec) which will reset Timer and pulses.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top