Help with Alarm PIR circuit

Thread Starter

acronce

Joined Aug 20, 2021
2
Experienced software developer but electrical engineering noob here...

I'm interested in replacing a custom automation system from a company that went out of business a long time ago. Part of what I need to do is replace the alarm component that was used to detect wired alarm PIR and door/window opening sensors.

My plan for now is to wire these up to ESP32's, largely the same as an Indestructibles article I found online (but with differences, like lack of a traditional alarm panel and many more inputs). Before wiring up the ESP modules I figured I'd breadboard the detection circuit first with a simple LED indicator.

Once this works, I'll swap out the LED for a 3.3v pull up configured input on the ESP32. Although it might be nice to leave an LED on the board as a display of current activity, so I may try to design that in.

The circuit uses an LM339 (I'll need 4 of these for 16 channels eventually) and a voltage divider to catch when the PIR goes from its untriggered to triggered state.

I measured our existing 12v powered alarm sensors and the output lines go from around 5.9v at rest to 3.9v when triggered, so I picked a voltage divider value of 4.9v in the middle.

It doesn't make sense at this stage to test against the PIRs we have installed on our walls. Instead for the breadboard test I'm using a crappy spare PIR that I bought as a replacement but hated because it was so noisy (loud relay).

The test PIR's voltage characteristics are different with nearly 12v at rest and under a volt when triggered. Since the voltage divider reference of 4.9 should still work with this range, I left that alone.

The following was my first circuit attempt:

Screen Shot 2021-08-20 at 8.05.00 PM.png

Please ignore the PIR part itself. I just picked something close in the EasyEDA parts list. My test PIR uses 12v for power, and 12v for the sensor. I didn't bother with any EOL resistors or anything in order to keep the test simple.

The problem was that when the PIR triggered, the LM339 didn't seemed to sink to ground so the LED didn't turn on.

I probed the circuit with a meter (I didn't have an oscilloscope at the time I was doing this) to check the voltages. What I found was when I measured the (+) input (the output of the PIR) while triggering the PIR it worked and the LED lit. Yes, the presence of the meter affected the result.

Figuring that the resistance of the meter was playing a role in fixing the problem, I added a pull down resistor (R7 below) to the (+) input. I didn't know what the resistor value should be so I guessed 10k (based on other pull up/down values I've seen commonly used).

With this change the circuit works without attaching a meter:

Screen Shot 2021-08-20 at 8.06.08 PM.png

The thing I don't understand is why the pull down is needed in order to fire the comparator. Is it generally needed, or maybe a side effect of the fact that I didn't wire up the other inputs or outputs of the LM339?

Thanks in advance for helping me understand this. Also, I welcome any other suggestions to improve this design.
 

Ian0

Joined Aug 7, 2020
9,844
Most PIRs already have a switched output. Most of them are open collector or relay outputs. They tend to use this BISS001 IC
http://www.ladyada.net/media/sensors/BISS0001.pdf
with the circuit in the application note, so that the output on the SIG pin is either a relay or the collector of the NPN transistor.
Fancy ones have a digital data output.
If you can hear the relay, then you have obviously got on with a relay output! So just try it with the LED (and R2) between SIG and V+

If not, measure the output on SIG and see if it goes from 0 to 5V. If you get nothing, measure between output and V+. If you then get 0V and 12V then you have an open-collector output - try connecting R6 to sig, and the LED to VCC and see what happens.

Or take the cover off and see if you can see either the BISS0001, the transistor or a relay.

I would suspect that the devices you measured that go from 3.9V to 5.9V have a digital output and you are measuring the average voltage of a data-stream with 0V and 6V levels.
 
Last edited:

Thread Starter

acronce

Joined Aug 20, 2021
2
Thanks for getting back to me. I already had the PIR taken apart and can see as well as hear (it's really loud!) that it's got a relay. The voltage on SIG at rest is nearly 12v at rest, and triggered it's near zero. I don't see a BISS001 on the board.

While your suggestions sound interesting, it seems like they're more around understanding the PIR. But I'm just using this PIR as a test.

The real deployment will be with the installed PIR's, which are 5.9v at rest to 3.9v when triggered. That's why I went with a LM339 and reference voltage (via the divider) of 4.9v.

What I'm trying to understand is why I need the pull down resistor to get the circuit to work. Maybe It's because of the relay in the test PIR? That might make sense because the relay effectively could be breaking the circuit when triggered.

I probably should connect one of the real installed PIRs (which definitely do not have a relay) to the breadboard and see if it works as-is without the pull down.
 
Top