Author Topic: Help reusing a PIR sensor  (Read 2515 times)

0 Members and 1 Guest are viewing this topic.

Offline Evangelopoulos PanagiotisTopic starter

  • Contributor
  • Posts: 48
  • Country: gr
Help reusing a PIR sensor
« on: March 10, 2020, 02:13:33 pm »
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.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 7012
  • Country: ro
Re: Help reusing a PIR sensor
« Reply #1 on: March 10, 2020, 02:34:46 pm »
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.
« Last Edit: March 10, 2020, 02:36:52 pm by RoGeorge »
 

Offline Evangelopoulos PanagiotisTopic starter

  • Contributor
  • Posts: 48
  • Country: gr
Re: Help reusing a PIR sensor
« Reply #2 on: March 10, 2020, 02:46:37 pm »
Remove that white plastic support, read the marks printed on the metal case, and find its corresponding datasheet.

There 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.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 7012
  • Country: ro
Re: Help reusing a PIR sensor
« Reply #3 on: March 10, 2020, 03:20:52 pm »
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 PIR https://www.futurlec.com/PIR_D203S.shtml
- sensor + amplifier (looks like yours might be like that, since there are no amplifiers on the PCB)
« Last Edit: March 10, 2020, 03:23:09 pm by RoGeorge »
 

Offline Evangelopoulos PanagiotisTopic starter

  • Contributor
  • Posts: 48
  • Country: gr
Re: Help reusing a PIR sensor
« Reply #4 on: March 10, 2020, 03:34:13 pm »
(looks like yours might be like that, since there are no amplifiers on the PCB)

I 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.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 7012
  • Country: ro
Re: Help reusing a PIR sensor
« Reply #5 on: March 10, 2020, 03:46:13 pm »
Then you can safely use the datasheet and the typical application schematic from the D203S linked above.

Offline Evangelopoulos PanagiotisTopic starter

  • Contributor
  • Posts: 48
  • Country: gr
Re: Help reusing a PIR sensor
« Reply #6 on: March 10, 2020, 03:52:27 pm »
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.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 7012
  • Country: ro
Re: Help reusing a PIR sensor
« Reply #7 on: March 10, 2020, 04:46:09 pm »
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

Offline Evangelopoulos PanagiotisTopic starter

  • Contributor
  • Posts: 48
  • Country: gr
Re: Help reusing a PIR sensor
« Reply #8 on: March 10, 2020, 05:00:54 pm »
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.
 

Online georges80

  • Frequent Contributor
  • **
  • Posts: 930
  • Country: us
Re: Help reusing a PIR sensor
« Reply #9 on: March 10, 2020, 06:48:51 pm »
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.
 
The following users thanked this post: Evangelopoulos Panagiotis

Offline Evangelopoulos PanagiotisTopic starter

  • Contributor
  • Posts: 48
  • Country: gr
Re: Help reusing a PIR sensor
« Reply #10 on: March 10, 2020, 07:17:46 pm »
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)...

If you have a template circuit that I could expand upon that would be much appreciated!

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.

I 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.
 

Online georges80

  • Frequent Contributor
  • **
  • Posts: 930
  • Country: us
Re: Help reusing a PIR sensor
« Reply #11 on: March 10, 2020, 07:28:48 pm »
^ just google search for terms such as:

pir amplifier circuit

and 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.
 

Offline Evangelopoulos PanagiotisTopic starter

  • Contributor
  • Posts: 48
  • Country: gr
Re: Help reusing a PIR sensor
« Reply #12 on: March 10, 2020, 07:42:51 pm »
Thank you for your help    :D
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 7012
  • Country: ro
Re: Help reusing a PIR sensor
« Reply #13 on: March 10, 2020, 07:56:12 pm »
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.
« Last Edit: March 10, 2020, 07:58:50 pm by RoGeorge »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: Help reusing a PIR sensor
« Reply #14 on: March 10, 2020, 08:25:34 pm »
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.
The 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.

 
The following users thanked this post: Evangelopoulos Panagiotis

Offline Evangelopoulos PanagiotisTopic starter

  • Contributor
  • Posts: 48
  • Country: gr
Re: Help reusing a PIR sensor
« Reply #15 on: March 10, 2020, 08:32:54 pm »
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.


The circuit isn't that complicated. Just break it down into several parts.


Awesome! 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.  |O  :palm:

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.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 7012
  • Country: ro
Re: Help reusing a PIR sensor
« Reply #16 on: March 10, 2020, 10:46:19 pm »
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!   :-+

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Help reusing a PIR sensor
« Reply #17 on: March 11, 2020, 12:12:30 pm »
I was in the mood of making a some kind of meter to detect changes of temperature in a room.

The 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.
.  That took much longer than I thought it would.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf