Help reusing a PIR sensor - Page 1
Forum section: electronics / projects

author: Evangelopoulos Panagiotis
author_rank: Contributor
timestamp: March 10, 2020, 02:13:33 pm
content: Greetings,I found in my junk box an old security motion sensor that uses one of those Passive IR (PIR) sensors. I was in the mood of making a some kind of meter to detect changes of temperature in a room.The whole sensor circuit switches it's output high or low to if it detected movement. But what I want is a more analog output that will swing a small volt meter or a digital one made with an LM3914.So i pulled the sensor bit out of the board and wired it up to a 5V supply and my scope. The output of the sensor goes to about 1V 1.5V and then swings around that value if it senses any change in IR.I measured the swing to be from as low as a couple of mV all the way up to a few hundred mV.I noticed that the sensor seems to be doing some sort of self calibration procedure. When you power it up it is trying to match 1 or 1.5V to the ambient room IR and when you move your hand near it the voltage swings down. But if you hold your hand near it then it will eventually reach the 1 or 1.5V value again.A note here, the swing is really slow so I don't know if a DC blocking cap can work here to isolate the swing.My question is:Can a simple circuit be designed to take that few mV input and turn it into an output that swings from 0V to 5V?My guess is that a differential amplifier can be used here and It will probably need an accurate voltage reference but I don't know how to design that.An other note, I found a 10k thermistor in the enclosure. Was it used to subtract the ambient temperature from the PIR sensor?I know micro controllers seem easy and it's tempting to use a 10bit ADC but I'd like to keep this a complete analog design if possible.Thank you all in advance,E.P.

author: RoGeorge
author_rank: Super Contributor
timestamp: March 10, 2020, 02:34:46 pm
content: Some PIR sensors are digital, some are analog.Remove that white plastic support, read the marks printed on the metal case, and find its corresponding datasheet.

author: Evangelopoulos Panagiotis
author_rank: Contributor
timestamp: March 10, 2020, 02:46:37 pm
content: Quote from: RoGeorge on March 10, 2020, 02:34:46 pmThere are no markings anywhere on the sensor.It's just a metal can with a window and three pins just like the photo. It's response seems analog to me.

author: RoGeorge
author_rank: Super Contributor
timestamp: March 10, 2020, 03:20:52 pm
content: AFAIK there are 2 major categories:- sensor only (with only a JFET inside), i.e. D203S, datasheet good to see what to expect from a 3-pins sensor only PIRhttps://www.futurlec.com/PIR_D203S.shtml- sensor + amplifier (looks like yours might be like that, since there are no amplifiers on the PCB)

author: Evangelopoulos Panagiotis
author_rank: Contributor
timestamp: March 10, 2020, 03:34:13 pm
content: Quote from: RoGeorge on March 10, 2020, 03:20:52 pmI forgot to take a picture of the board from the underside. There are two ICs which I can't see their markings (8pin and 14pin packages) and one 78L05A regulator. I'm sure one of them must be some sort of op-amp.

author: RoGeorge
author_rank: Super Contributor
timestamp: March 10, 2020, 03:46:13 pm
content: Then you can safely use the datasheet and the typical application schematic from the D203S linked above.

author: Evangelopoulos Panagiotis
author_rank: Contributor
timestamp: March 10, 2020, 03:52:27 pm
content: Thank you for the help. I'll give the datasheet a read and try something out. But still I'm in the lookout of a circuit that will amplify that tiny signal correctly.

author: RoGeorge
author_rank: Super Contributor
timestamp: March 10, 2020, 04:46:09 pm
content: Open the datasheet and read it. The circuit you are looking for is there, page 4 of the D203S datasheet linked above:https://www.futurlec.com/PIR_D203S.shtml

author: Evangelopoulos Panagiotis
author_rank: Contributor
timestamp: March 10, 2020, 05:00:54 pm
content: I know there is a circuit there but there is no explanation of it whatsoever and I'm not that experienced to know how this works and if it does what I want. Since it switches a relay then it's final output is binary. Either on or off. I need an output that gives off values between 0 and 5 volts. Since I don't know which stages do what and what to cut off I'll refrain from building it. If though no one else has a better solution to my problem I'll have to build it bit by bit and probe everything till I figure stuff out.

author: georges80
author_rank: Frequent Contributor
timestamp: March 10, 2020, 06:48:51 pm
content: There's a lot of 'similar' analog (dumb) PIR sensors out there. The circuit you are looking out is likely 2 amplifiers with MANY X amplification. The signal coming out of an analog PIR can be quite small so lots of amplification is needed. There'll be some filtering in the amp circuit to stop from amplifying everything (RF etc)...PIR sensors NEED a lens to create the differential IR signal hitting the sensor. Most sensors have 2 elements that both see IR, the lens (Fresnel) is designed to illuminate one element and not the other - to generate the differential signal. Lens design is an art in itself to provide the coverage/range that is required.cheers,george.

author: Evangelopoulos Panagiotis
author_rank: Contributor
timestamp: March 10, 2020, 07:17:46 pm
content: Quote from: georges80 on March 10, 2020, 06:48:51 pmIf you have a template circuit that I could expand upon that would be much appreciated!Quote from: georges80 on March 10, 2020, 06:48:51 pmI mistakenly thought that this sensor didn't have a lens in it since the plastic is smooth from the outside and i didn't bother opening it up to check that there actually is a lens there. So thank you for that. I'll do some measurements with the plastic lens to see if I get a bigger voltage swing.

author: georges80
author_rank: Frequent Contributor
timestamp: March 10, 2020, 07:28:48 pm
content: ^ just google search for terms such as:pir amplifier circuitand you'll find various circuits.The PIR lens has the fresnel pattern on the inside surface and the outside will be smooth. It is also a special plastic that is IR transparent (long IR that is heat versus remote control RF).cheers,george.

author: Evangelopoulos Panagiotis
author_rank: Contributor
timestamp: March 10, 2020, 07:42:51 pm
content: Thank you for your help

author: RoGeorge
author_rank: Super Contributor
timestamp: March 10, 2020, 07:56:12 pm
content: In the example from the datasheet, the analog signal you want can be found at pin 7 of the second LM324 op-amp. Everithing on that schematic on the right handside is just to trigger the relay. Chances are you already have that exact schematic already made on the backside on the PCB.Put a picture of the backside, should be easy to identify the chips, starting from the power and GND connections of each chip.A PIR analog output can also be found right after C5, just that it will be much smaller.

author: Zero999
author_rank: Super Contributor
timestamp: March 10, 2020, 08:25:34 pm
content: Quote from: EvangelopoulosPanagiotis on March 10, 2020, 05:00:54 pmThe circuit isn't that complicated. Just break it down into several parts.C9 to C14 and R8 to R10 form a power supply filter.ZD1 regulates the voltage to the PIR and all of the biasing circuitry. U1's power supply isn't shown, but I believe it's connected straight to +12V, as the zener regulator won't provide power for it.U1-A is a non-inverting amplifier, with some filtering. Its gain is determined by R3 & R4 and the passband by C3 to C4.U1-B is an inverting amplifier, again with some filtering. Its gain is set by R11 and R5 and the passband by C8 & C5.U1-C, U-D, D1 & D2 form a window comparator, with the voltage thresholds set by R12 to R13. As mentioned above it's required to activate the relay.If you just want an analogue signal, then take the output from U1-B. The circuit can be simplified by using the LM358, which is the same as the LM324, but with only two op-amps.Search for op-amp inverting/non-inverting amplifier and window comparator, for more information.

author: Evangelopoulos Panagiotis
author_rank: Contributor
timestamp: March 10, 2020, 08:32:54 pm
content: Quote from: RoGeorge on March 10, 2020, 07:56:12 pmQuote from: Zero999 on March 10, 2020, 08:25:34 pmAwesome! Thank you very much both of you!I would try to probe the PCB and tap on the analog out with a wire but stupid me took the lazy way around and removed the PIR sensor with a blob of solder to heat all pins concurrently which destroyed the PCB.Plus I believe I somehow damaged my PIR sensor.... Anyway, I shall pause my experimentation here and continue once I get a new sensor on my hands.If and when I get it going I'll post a few pictures here.Thank you for your time and effort,Have a nice evening,E.P.

author: RoGeorge
author_rank: Super Contributor
timestamp: March 10, 2020, 10:46:19 pm
content: PIR sensors are very easy to damage during soldering. They are very, very sensitive to overheating, even more sensitive than electret microphones. Usually it is mentioned in the datasheet, too.However, the one you have might not be completely dead, maybe it's still working but with a lower sensibility.Good luck anyway!

author: StillTrying
author_rank: Super Contributor
timestamp: March 11, 2020, 12:12:30 pm
content: Quote from: EvangelopoulosPanagiotis on March 10, 2020, 02:13:33 pmThe sensor part is in two halves and detects a change between the two halves such as a person walking past it, but it rejects temperature changes that effect both halves, so I don't think you could use it to do that.