Need to shorten the duration a PIR stays in its HIGH (on) state.

oKors

New Member
I'm working on a project with a 08M, Panasonic/NaPiOn PIR motion sensor, and digital counter. The idea is when the PIR detects motion the 08M sends a HIGH to Pin4 going to the counter. So far I've got the code written and everything works as expected except the PIR stays high longer than I'd like it to.
I only need it to go high and stay high for a second. Instead it stays high for almost a minute before going out. I know this because right now I've got an LED connected in parallel to the contacts for the counter (just for proto purposes). When I pass my hand over the PIR sensor the LED goes high, and the counter increments.

Is there a way to shorten the duration this PIR stays HIGH?
 

Dippy

Moderator
Mmm... that does sound rather a lot.
And you have left it to settle down for a minute before waving it around?

And , please confirm, is this the digital or analogue version you are using?

Trouble is that we don't know the conditions under which you are testing it.
If you have some background heat 'noise' being detected then this will add to your waving hand trigger test.

And we don't know the quality of the power supply to the device either.

Unfortunately, all the gubbins are in the unit.

Naturally, you may wish to wait for replies suggesting tests.
HOWEVER, while you are waiting, I would suggest contacting the retailer and manufacturer. After all, you may have a duff device....?
 

Chavaquiah

Senior Member
Yes: hold very still, don't breath. :p

It's supposed to stay high for as long as movement is detected. My own experience with those sensors seems to show they return to "low" very fast... after movement stops.

Your best bet is to "debounce" the signal. Once "high" is detected, ignore the sensor until it returns to low.
 

oKors

New Member
Mmm... that does sound rather a lot.
And you have left it to settle down for a minute before waving it around?
Yes waited several minutes for the PIR to settle down.

And , please confirm, is this the digital or analogue version you are using?
Digital, spot-type

Trouble is that we don't know the conditions under which you are testing it.
If you have some background heat 'noise' being detected then this will add to your waving hand trigger test.
I tried to 'focus' the sensing area by placing a 4" long tube around the sensor, this helped a little bit and it certainly narrows the detection angle. I have to be right over top of the tube for it to trigger (ultimately this is what I want anyway)

And we don't know the quality of the power supply to the device either.
Right now I'm using the 08M proto board kit and power supply. On the proto board (aside from the chip) I've got the PIR and LED just to test the basic functionality of the circuit and confirm my program works. From there I've jumpered over to a bread board which has the counter and a voltage divider circuit to drop the 5v down to 3v for the counter.
The delay existed prior to adding the counter portion of the circuit.


Unfortunately, all the gubbins are in the unit.


Naturally, you may wish to wait for replies suggesting tests.
HOWEVER, while you are waiting, I would suggest contacting the retailer and manufacturer. After all, you may have a duff device....?
@Chava;
I have a 1.05uF capacitor across the counter inputs. During my initial bench testing of the counter this helped with the debouncing.

Here's the code if that makes any difference.

Code:
symbol PIR = pin1
symbol LED = 4

main:
       b0 = PIR
       if b0 = 0 then 
                 low LED
     
       else
                 high LED
       endif
       goto main
of course as mentioned earlier, the "LED" was just a visual indicator that my circuit, chip and program are functioning. Later on I will replace the chip and just have the counter.
 
Last edited:

Dippy

Moderator
I'm not sure chava's idea of 'debouncing' (e.g. running through an edge-triggered monostable) is such a good idea.
OK, it gives a brief pause, but if the basic system isn't working properly then it's no real step forward.

To test it really you need to put an opaque cover over the sensor , then briefly lift and expose sensor, then replace cover and time that.
If it stays on for a minute then it sounds duff to me.

My experience with those and other similar is that a brief detection should trigger it for a few seconds depending on the strength of the trigger source.
Like I said before: contact retailer/technical section (please tell me not Ebay) and the manufacturer Panasonic isn't it?
They won't bite. Don't be afraid.:) In cyberspace no-one can see you sweat.;)

Now, your postings have confused me:
Post#1
"I know this because right now I've got an LED connected in parallel to the contacts for the counter "
- I thought (incorrectly) this meant you were testing the sensor o/p directly (which was asking a bit much of the device).
Post#4 Code sample
- the LED is on the PICAXE O/P ??

OK, you need to check ABSOLUTELY that the sensor is staying on for a minute and check ABSOLUTELY that it's not your wiring etc. causing your code to do something funny.
I'll leave that with you.
POST your EXACT schematic for others to check....

I assume you don't want to contact the retailer/manufacturer as you are worried it's a user-fault?
 

Chavaquiah

Senior Member
I'm not sure chava's idea of 'debouncing' (e.g. running through an edge-triggered monostable) is such a good idea.
Dippy, I'm such a noob at electronics that I don't even know exactly what that is! :eek:

Actually, what I meant was soft debouncing. But you are, of course, right - if there is something wrong with the sensor, masking the turning off latency will solve nothing.

Anyway, oKors, one thing I can say about those Napion is that they (meaning, the ones I have) are extremely sensitive. With other PIR sensors I can play this silly game of trying to sneak VERY slowly onto the detector withouth triggering a detection. With the Napion, no chance. Just standing close to them and shifting my weight from foot to foot lets them see me. Only way I could test them was to hide behind a wall, at a distance.
 

oKors

New Member
Kay, just a quick update.
I rebuilt my circuit on a breadboard (including the 08M), eliminating the proto test board entirely. For whatever reason it appears this cleaned things up quite a bit. The PIR no longer has a long delay, it says high for only about a second or less. In fact it appears a little neurotic now. I still have the LED connected as an output and when I wave my hand quickly over the PIR the LED will flash twice, if I wave it slowly the LED will blink several times.

I'll get a schematic out soon.

Like I said before: contact retailer/technical section (please tell me not Ebay) and the manufacturer Panasonic isn't it? No I bought it from Newark

Now, your postings have confused me:
Post#1
"I know this because right now I've got an LED connected in parallel to the contacts for the counter "
- I thought (incorrectly) this meant you were testing the sensor o/p directly (which was asking a bit much of the device).
The PIR is connected to PIN 1 as an input, the LED is connected to PIN 4 as an output through a resistor. The counter operates on a closed contact so one lead goes to PIN4 the other to ground (parallel to with the LED and resistor)
Post#4 Code sample
- the LED is on the PICAXE O/P ??
Yes, PIN 4 (leg 3 on the chip)

OK, you need to check ABSOLUTELY that the sensor is staying on for a minute and check ABSOLUTELY that it's not your wiring etc. causing your code to do something funny.
I'll leave that with you.
See post above

POST your EXACT schematic for others to check....

I will do that when I get back from vacation this weekend!
 

Dippy

Moderator
Why not do things in stages?
Always check each section before dealing with the whole.

Just power up the sensor and check it's output.
Got a 'scope. It'll make life easier.
 

John West

Senior Member
Why not do things in stages?
Always check each section before dealing with the whole.

Just power up the sensor and check it's output.
Got a 'scope. It'll make life easier.
Yep. Even a multi-meter and a $20 US logic probe (or a home brew one) will do wonders for much troubleshooting of this nature. After verifying what you can - forget the documentation and computer models. (Although they are the place to start.) "Seeing" what's happening in different parts of the actual circuit is the key to solving most head-scratching electronics problems.
 
Top