Page 1 of 1

Testing and Playing with PIR sensors (motion sensor)

Testing and Playing with PIR sensors (motion sensor)
   65

In one of my current projects, I’d like to use a few motion or proximity sensors, also known as PIR sensors.

PIR sensors, or Passive Infra Red sensors, can be great for Arduino and Raspberry Pi projects, and can be bought really cheap – I only paid about a dollar per sensors in bundle of 10 PIR sensors from eBay, but you can get them really cheap at places like Amazon or AliExpress as well.

In this short article we will see how we these sensors work, how the can be used, how we can test them, and possible fine tine them a little bit.

No Arduino, Raspberry Pi or anything like that is needed. Just a PIR, a LED, a battery and a resistor.




What is a PIR sensor?

A PIR sensor is an electronic sensor that measures infrared light radiating from objects in its field of view. Normally this type of sensor would be used as a motion or proximity sensor.

Quite often they are referred to as:

  • PIR Sensor
  • Motion Sensor
  • Proximity Sensor
  • Infrared (motion) Sensor
  • Pyroelectric sensor

 

Cheap PIR - Top view

Cheap PIR – Top view

Cheap PIR - Sensor Exposed

Cheap PIR – Sensor Exposed

Cheap PIR - Bottom view

Cheap PIR – Bottom view

The short and simple explanation on how these sensors work

The sensor in the PIR detects or “reads” infrared radiation “emitted” from objects all around us.
Each object with a temperature above absolute zero ( -273.15° Celsius, -459.67° Fahrenheit, or 0 Kelvin) will radiate infrared, even us humans, and even though we mere humans cannot see this.

With special Thermal Infrared Camera’s however, this can be made visible to the human eye.
Note that the PIR just uses a relatively simple sensor – it is most definitely not a camera!

Example of InfraRed radiation

Example of InfraRed radiation

PIRs are called “passive” since they are not assisted by any “helpers” that for example would send some form or shape of “radiation” or “light” to help detect. It’s purely based on what the sensor can pick up out of the environment, what’s being emitted by objects.

PIR’s actually only look at the “difference” between two sensor “halves”. If the difference is too high then it will trigger – it detects “motion”. This is done in a smart way, to avoid false positives caused for example by a brief flash or an increase in room temperature.

A chip and some discrete electronics handles all this for you.

PIR Lens “Dome”

As you can see in the pictures above, the PIR has some funny dome-like bubble, which is a collection of lenses covering the sensor.

If you look closer, you’ll see that the “dome” is build out of little segments – each being a small plastic Fresnel Lens. These tiny lenses help the sensor to look “around” in one swoop, which would have been impossible with just the flat sensor (see figure 2).

PIR PCB

A few points on the PCB of the PIR are of importance to us:

PIR PCB

PIR PCB

The most important pins are of course Power supply (Vcc 3 to 5 Volts – it is said that this can even be up to 12V) and GND (Ground).
The OUTPUT pin is the switching pin.

The two potentiometers (orange) allow you to tune Delay time (Tx) and Sensitivity (Sx).

Testing your PIR

If you’d like to experiment a little with your PIR, or test how well it works, then you actually do not even need an Arduino or Raspberry Pi.

All you need is either a power source, a resistor and a LED.

The power can be drawn from either batteries or a power supply – 3 to 9 Volts will work – I used a 5V USB charger.

For the LED, we need to pay attention, since it’s important that we connect the pins right. The longest pin of the LED (Anode, or “plus”) should be connected to the resistor, see the LED drawing below.

The resistor should be 470 Ohms, the colors are Yellow, Violet, and Brown (see also the Tweaking4All resistor calculator).

LED Pinout

LED Pinout

Summarized:

Connect the PIR Vcc pin to the + of your power source.
Connect the PIR Output pin to one end of the resistor.
Connect the other end of the resistor to the long leg (Anode) of the LED.
Connect the short leg of the LED (Cathode) to the  of your power source.
Connect the PIR GND to the  of your power source.

And that’s all … you should have something like this now:

Testing your PIR with a Battery, LED and a Resistor

Testing your PIR with a Battery, LED and a Resistor

p.s. I made this drawing with Fritzing, a great tool to make electronic design!

Playing with the “settings”

Now that we have a test setup, time to do some playing.
When the LED goes on, motion is detected.

In the beginning you might notice some seemingly erratic behavior – this is perfectly normal. We need to understand a few things before we can tweak the settings.

When connecting the battery, the sensor will take up to 30 to 60 seconds to stabilize (warm up).
Place your setup in such a way that there will be no motion and wait until the LED remains OFF.

Once the LED remains OFF, you can move your hand or anything for that matter, in front of the little dome, and see the LED go ON and OFF.

Depending on what is moving around, the detectable range should be up to 20 feet or about 6 meters.

Also keep in mind that the sensor will remain “ON” for a little bit after it detects motion. At a later time you can tune the timing with the “Delay Time” potentiometer.

Delay Time

The “Delay Time”, determines how long the PIR will keep the Output “High” (ON) after detecting motion.

For example, when motion has been detected, you could set this somewhere between a few seconds (mine has an approximately minimum delay time of 2 seconds) up to a few minutes (specifications of mine claim about 200 seconds).

When assembling the basic test setup (above) and the LED seems to stay on forever, turn this dial down – the delay might be too long. The lowest setting, when facing the philips screw of the potentiometer, is all the way to left.

 When doing your first tests, turn it as low as possible … until you notice there is a need for a time delay.

Sensitivity

With this potentiometer you can determine set the “range” you have in mind.
I have the impression that it regulates how much motion it takes to be “seen”, or maybe more technical terms: how much difference between the two “halves” of the sensor need to see before it’s considered motion.

You’ll have to play a little with this to see what is the appropriate setting for your purposes.

An increased sensitivity can be beneficial for when using a PIR for long range, say up to 20 feet (6 meters) or more. This can however also cause false positives in smaller spaces – i.e. the PIR might trigger when it should not.

A decreased sensitivity is good for a short range, say half of the maximum range or up to 10 feet (3 meters). Which in turn could miss movement at a longer range. Objects further away may need more motion to be detected.

To illustrate this, a little test …
First I did set the sensitivity to it’s lowest and walked 14 feet (app. 4 meters) away from the sensor. I had to wave both arms to get detection.

 

After that I did set sensitivity to it’s maximum setting and walked again 14 feet away from the sensor. No I pretty much only needed to move a finger to be detected.

Up to you to find what works best for your application of the PIR – with the test setup it’s easy to play and tune.

The Retrigger Jumper

On some PIR’s, they conveniently did not install the jumper (like in the ones I have) – this does not mean that they do not work. Just setting them is a little bit more cumbersome.

If your PIR does not have jumpers for this, and just soldering pads, then look closely and you might see that it’s default set to “H”. It took me a while to even see that mine was shorted to “H”.

The “L” setting seems to behave a little erratic – when you move in front of the PIR, you will see that it occasionally switches the LED ON and then OFF again. This is called “non-retriggering” – this setting does not or just barely retrigger.

When using the “H” (default) setting, you will see that the LED remains ON when moving in front of the PIR. This is what is called “retriggering” and it seems that this would be the most used setting as this seems to behave the nicest.

Additional Information Sources

Donation options


Donations are very much appreciated, but not required. Donations will be used for web-hosting expenses, project hardware or a motivational boost (a drink or snack). Thank you very much for those have donated already! It's truly AwEsOmE to see that folks like our articles and small applications.

Comments


There are 65 comments. You can read them below.
You can post your own comments by using the form below, or reply to existing comments by using the "Reply" button.

  • Aug 21, 2015 - 11:06 PM - Hung Comment Link

    Hi,

    What type of sensor is suitable for hands detection directly over the sensor? I would like to create a 5-notes musicial keyboard with 5 sensors, however I’m not experienced enough to know which sensor is suitable for this project.

    Reply

    Hung

    • Aug 22, 2015 - 4:34 AM - hans - Author: Comment Link

      Hi Hung,

      The PIR would detect the finger, but if used for several “keys” then the other PIR’s would detect that finger or your hand as well – probably not something you’d want.

      For your purposes you could consider a touch sensor (Capacitive touch).
      I found this article at Instructables, which gives you and intro how to build those and work with those on an Arduino.

      Hope this helps 

      Reply

      hans

      • Aug 22, 2015 - 6:12 AM - Hung Comment Link

        Good to hear from you Han!

        If I separate the 5 sensors 5-8cm apart so that it will just detect my whole hand to trigger the sound, it is still wise to use a PIR sensor or motion sensor? (Sorry new to sensors) Can I adjust the angle of detection for motion sensors? (since I just want the detection to be valid directly on top of the sensor)

         As I want to show the “WOW factor” by making musical sounds without physically touching anything, hence I will not go into using touch sensor. 

        Need some guidance on this, thank you.

        Reply

        Hung

      • Aug 22, 2015 - 7:45 AM - hans - Author: Comment Link

        Hi Hung!

        If you want to keep things “touchless” then I’d start experimenting with PIR’s of which you limited the “view”.
        For example, by placing a short tube or pipe over the PIR so the view to the sides are limited (just an idea).

        Standard the PIR will have quite a view angle, which you’d like to minimize and this trick might work.
        it will take a little experimenting, but as you can see above: creating a test setup is easy and dirt cheap. 

        You could even try the sensor by removing the little dome and possibly combine it with a short piece of tube or pipe.

        Please let us know how your project is moving forward – it most certainly sounds interesting.

        Reply

        hans

        • Aug 22, 2015 - 8:19 AM - Hung Comment Link

          Hi Hans,

          One more thing, how many sensors can I plug into an Arduino uno? Are there enough to put 5 sensors and 2 speakers and 5 LED light strips?

          Reply

          Hung

        • Aug 23, 2015 - 3:59 AM - hans - Author: Comment Link

          Hi Hung,

          that’s quite a lot, but I’m guessing the Arduino can do this …

          5 sensors and 5 LED strips can be done with the digital I/O, the 2 speakers with the Analog I/O …

          However … you might want to look at a larger Arduino, since the code needed to control all this might be too much for the limited memory of an Uno. So maybe look for an Arduino Mega or something like that.

          Here a PDF describing the Arduino Uno pinout

          Reply

          hans

  • Aug 26, 2015 - 6:32 AM - Hung Comment Link

    Hi Hans,

    As I’m going to paste a LED strip onto a rotating “mini londen eye”, the wires connecting the LED strip to the arduino will be tangled up at some point of time. I cannot mount the arduino onto the “mini londen eye” because the arduino is also connected to the sensors. Please advise. 

    Reply

    Hung

    • Aug 27, 2015 - 8:21 AM - hans - Author: Comment Link

      Hi Hung,

      I can see that to be an interesting challenge …

      Option 1)

      Wireless. Power the Arduino in the “London Eye” with batteries and connect to a computer or another Arduino using Wifi, Bluetooth, InfraRed or RF module. 

      Option 2)

      Since the LEDs only use 4 wires, somehow make copper strips and contacts that slide over the strips while the wheel is turning.

      Just the first 2 ideas that came to mind … I haven’t tried either.

      Reply

      hans

  • Aug 27, 2015 - 8:56 AM - Hung Comment Link

    Hi, I have found a solution. By using a slip ring http://www.adafruit.com/product/736

    Reply

    Hung

    • Aug 27, 2015 - 10:33 AM - hans - Author: Comment Link

      Awesome! Didn’t know AdaFruit sells these … ready made and good to go!

      Thank you very much for sharing! 

      Any chance you can share your project when it’s done? I’m really curious about what you’re building. 

      Reply

      hans

  • Aug 28, 2015 - 9:48 PM - Hung Comment Link

    Sure Hans. How can I contact you privately? 

    Reply

    Hung

  • Aug 30, 2015 - 10:13 PM - Hung Comment Link

    Hello Hans,  does every PIR have approximately minimum delay time of 2 seconds to trigger? If that is the case, I’m not able to mimic a “music keyboard” as I need immediate response from the sensors. I have not bought any sensors yet, hence i’m still doing research on what type of sensors is most suitable.

    Reply

    Hung

    • Aug 31, 2015 - 4:00 AM - hans - Author: Comment Link

      Oh my goodness, I did not think about that … 

      A photo sensitive transistor/diode or and LDR might work better, or at least faster. Both options are cheap too.
      But you’d need to assume that there is light coming on those sensors, unless a hand or finger is positioned above the sensor and light is being reduced.

      So at startup you’d need to gage the initial value (which might not be 100% stable with an LDR), and respond when you see it change more than a certain percentage.

      Photosensitive transistors/diodes might be a little trickier to implement though because the simply are ON or OFF.

      An ultrasonic sensor might work very good as well – I found this article discussing a few options, including an option I did not think about. But they might not work as you’d like them to work.

      There are quite a lot of different sensors out there, I did see this Arduino Forum topic discussing a short distance sensor. 

      Mouser, a well known component distribution company, has quite the list of components that could help.

      A sensor like the Leap Motion Sensor would be pretty impressive and cool to use – however, I doubt it’s usable with Arduino and it might take a lot of time on your end to get to to do what you’d want. You’d need only one sensor, but it doesn’t come cheap ($80).

      Reply

      hans

      • Aug 31, 2015 - 4:40 AM - Hung Comment Link

        Thank you for the links. I could not use photo sensitive transistor/diode/LDR as my project consist of LED lights strips that might affects them. And I will switch off my rooms lights and play with sensors, so it’s like a very dim dark room.

        I read the links you gave and found a Sharp GP2Y0A21YK IR Proximity Sensor. They said that this Sharp Sensors has capability up to 150cm range detection, which is really nice. Will the lights from my LED light strips affects the IR sensor readings? Will those sensors work after i switch off my room lights?

        Reply

        Hung

      • Aug 31, 2015 - 5:01 AM - hans - Author: Comment Link

        I read about that one too. I am however not quite sure how “far” away you’d like hands or fingers to move.
        The reason why I’m asking is that if the area to move in is too narrow, then sensors might overlap each other. I have not tested these sensors but I can imagine that a longer distances it’s “beam” would widen, like in a V shape.

        I honestly have no idea if regular LEDs would interfere, but I would guess not.

        Did you look at the components at Mouser – they seem to have some pretty interesting ones.

        Reply

        hans

  • Oct 29, 2015 - 11:27 AM - Bob Comment Link

    @ Hung … Removing the fresnel lens may work for a musical instrument as it reduces the detection angle considerably (check the PIR spec sheets) and you could always go with the smaller PIR’s too
    Just search ebay for mini pir

    Reply

    Bob

  • Feb 5, 2016 - 7:42 AM - sam Comment Link

    can a PIR sensor detect the motion of a object moving  before 2-10 centimeters?…if not what is the minimum distance it starts working from? 

    Reply

    sam

    • Feb 5, 2016 - 8:04 AM - hans - Author: Comment Link

      Hi Sam,

      I would think it does detect that yes. I suppose it also depends on the object (size and type of material).
      The specs of some say “up to 20 feet” and do not state any minimum.

      Reply

      hans

  • Feb 19, 2016 - 3:08 PM - Rara Jeon Comment Link

    Whom it may concern,

    I am Rara who is working for company which provide golf swing motion sensor.

    We outsourced creating motion sensor, but often time occurred errors, so I am looking for company or people who is capable of analyzing our motion sensors, find out problems, and fix the errors.

    Thanks,

    Rara

    Reply

    Rara Jeon

    • Feb 20, 2016 - 4:11 AM - hans - Author: Comment Link

      Hi Rara,

      Even though this is not the place to post such a request (the forum would have been better), if anyone feels an expert to help, then please feel free to post a reply here.

      Reply

      hans

  • Apr 1, 2016 - 2:53 AM - Patrick Comment Link

    Hi,

    Great article! i’m very new to this electronic stuff and this got me started real good.

    I have now succesfully build a little alarm with a 433mhz remote control to switch it on and off

    One question, do you know a way to prevent the pir from triggering at startup? I’m not using any IC’s just plain components.

    Regards patrick

    Reply

    Patrick

    • Apr 1, 2016 - 3:16 AM - hans - Author: Comment Link

      Hi Patrick,

      Thank you for the compliment  

      Well, without making it too complicated, you could add a delay of a couple seconds when “arming” your alarm or powering on the Arduino (in setup()).
      I do recall a PIR taking a few seconds to “calibrate” when you fire it up (ie. power the Arduino).
      So a “delay(3000);” (3 second delay) in setup() could do the trick.

      Reply

      hans

      • Apr 1, 2016 - 3:50 AM - Patrick Comment Link

        Hi Hans, 

        Thanks for your quick reply. The challenge for this project was to use only simple components, so there is no arduino or pi involved. Was hoping maybe there was some sort of trick to prevent the trigger. I will see if i can find a schematic for a delay. 

        Thanks anyway!

        Reply

        Patrick

      • Apr 1, 2016 - 4:02 AM - hans - Author: Comment Link

        Oh sorry, missed that point, doh!
        Lesson learned; never try to answer a question when you just woke up and have not had coffee yet .

        I think the challenge would be that if you add a delay, the delay might be over the PIR, causing it to always delay. Probably not what you’d want.
        Maybe you’d need something like this, just the reverse version, so instead of make, a break contact, which disconnects your alarm indicator for the first 10-60 seconds after powering on your device.

        Please post your solution of you found one though!
        Others might find this helpful as well! 

        Reply

        hans

        • Apr 1, 2016 - 4:19 AM - Patrick Comment Link

           There are better ways to start a day… but i really do appreciate your respons!

          you are right about delaying the pir itself, that’s what bugged me indeed. That link might be just what i need. I will first try to wrap my head around it 

          I’ll keep you posted on the progress…

          Reply

          Patrick

        • Apr 1, 2016 - 7:38 AM - hans - Author: Comment Link

          Awesome! It would be interesting to see what you come up with! 

          Does the alarm have something like an LED lighting up or Siren going off?
          You could think of “disabling” that for the first minute, even when the PIR signals there is motion, prevent the light or alarm from going off. 

          Reply

          hans

          • Apr 8, 2016 - 1:54 AM - patrick Comment Link

            Hi Hans,

            That was a good idea to disable the buzzer…!

            I’ve found this circuit, and after fidling around with the values I have put this in front of the buzzer, delaying it for 40sec before it is able to react to the PIR’s signal.
            works like a charm!

            https://www.youtube.com/watch?v=GeveeSTyvGs

            Soldering the lot on a little board, and on to the next project!! thanks!!

            patrick

          • Apr 8, 2016 - 4:57 AM - hans - Author: Comment Link

            Awesome! 

            I tried finding the schematics, so I could post it here, but the screenshot of the video is kind-a hard to read.
            If you do have a drawn schematic, please let me know, so I can post it here  (no problem if you do not have one).

            hans

          • Apr 14, 2016 - 2:49 AM - hans - Author: Comment Link

            from Patrick:

            Took some time, but here is the schematic, (kinda… I drew it myself). I have placed this in front of the buzzer so the transistor ( a BC547) acts like a switch for the buzzer.

            Once the capacitor is saturated, after approx. 45sec it will make the transistor conductive, allowing the PIR to sound the buzzer.

            So now I have your PIR test circuit with a transistor sounding the buzzer. The PIR is powered through a latching circuit based on a 555. The latching circuit is triggered by a 433mHz receiver, using the linear output, supplying a pulse to trigger the latch. 

            It is my first circuit, and I’m pretty proud too..!!

            Thanks again for your kickstarting this.

            Delay Circuit PIR

            hans

          • Apr 14, 2016 - 2:52 AM - hans - Author: Comment Link

            Awesome Patrick!

            And … thanks for sharing your solution – it’s the kind of solution I had in mind as well, just didn’t know the details of the schematic yet haha … nice! 

            hans

  • Apr 1, 2016 - 10:37 PM - David Comment Link

    Great article! One question… how do I know what resistor is suitable for the PIR if it does not state anywhere what is the expected current. My PIR looks exactly like yours. Do I even need to put a resistor? Thanks!

    Reply

    David

    • Apr 2, 2016 - 4:19 AM - hans - Author: Comment Link

      Hi David!

      Thank you for the compliment! That’s always appreciated! 

      As for the resistor; it’s only included to protect the LED. Most LEDs these days seem to be able to survive without a resistor, but it’s probably better to include it anyway. 470 Ω is a common value for it.

      Reply

      hans

  • May 27, 2016 - 1:51 AM - Jim.Gong Comment Link

    Dear Hans

    I’m so glad to read your this article , 

    I’m confused about how to test PIR’s exact range , for example : The detect degree range of  horizontal and vertical direction. I know we can get the a rough results by body moving . However we need a very exact test reults for different distances(eg: 1,3,5,7 meters) . Do you have any good ideas to help me implement a good solution for get exact test results ?

    Thank you very mych 

    Reply

    Jim.Gong

    • May 29, 2016 - 9:54 AM - hans - Author: Comment Link

      Hi Jim,

      I agree that the range (directions/distance) are a little “soft” and definitely difficult to tune if needed.
      The only way I know to properly determine the coverage range of a PIR is by simply testing one setting at a time (which is hard with the potentiometer on the PIR). It’s kind-a the same issue one would have with PIR’s that come with conventional alarm systems as well. It takes a bit to tweak it to the right sensitivity.

      So, sorry that I do not have a cookie cut solution or answer to your question … 

      Reply

      hans

  • Jun 6, 2016 - 6:27 AM - Mohak Comment Link

    hiii. i got the delay in the operation of PIR On & Off. Actually i dont attached any delay in programme still the led is not change its position for around 4 seconds of operation. can u suggest me some solution for it?
    thanks in advance…regards,Mohak shah

    Reply

    Mohak

    • Jun 7, 2016 - 1:24 AM - hans - Author: Comment Link

      If you mean that at startup, the PIR takes about 4 seconds to “warm up” then I would not know a work around for that.
      The PIR has to adjust to it’s environment when powered on, which takes a few seconds. 

      Reply

      hans

  • Jul 18, 2016 - 9:55 AM - Ashish Comment Link

    Dear Hans, My name is Ashish and I am doing some research on Intrusion Alarm Systems, a typical kit includes Smoke sensor, PIR motion sensor, Door sensor, siren and host panel. 

    There are companies who sell such systems for 300$ and then there are who are providing it for 30$!! I understand that a lot of factors come into play; however given that the technology have been around since quite sometime and there so much one can do to improve the results, why such price variation? 

    I can procure PIR sensors from China at 2 $ a piece price , the same PIR sensor from Honeywell will cost me about 20$ !! Is there really a huge difference? or any difference at all (except the battery life may be! ) 

    The reason I am asking these questions is because I am getting a complete product KIT customised from a Chinese company to offer the security solution in service based model. 

    If possible and if you have some spare time, can you provide me your email address? I would like to explain more about the kind of customisation I am getting done and technical challenges I am facing and would like to have your expert opinion.  

    Regards

    Ashish

     

    Reply

    Ashish

    • Jul 19, 2016 - 4:05 AM - hans - Author: Comment Link

      Hi Ashish,

      I woud assume that there might be a difference in quality, but it might also depend on wether or not there is a case around it.
      I’ve played with $1 PIRs and they work just fine for me. I also tried a more expensive ($150) PIR, the difference being that the expensive one had a nice case around it.

      You might have to test a few to see if there is a significant difference. I couldn’t see a difference between the 2 I tested (the $150 went back to the store hahah).

      Reply

      hans

      • Jul 19, 2016 - 5:40 AM - Ashish Comment Link

        Thanks Hans for taking time and answering my question. This is really helpful, cause I know that we can take a chance with cheaper PIR sensors (yes we have to test them properly! )…  Really appreciated. 

        Do you also get involved in Alarm panel to CMS communications area.. there are many ways and many protocols, and I am quite confused with all that… and wondering if you can help me there as well? 

        Reply

        Ashish

        • Jul 20, 2016 - 10:03 AM - hans - Author: Comment Link

          You’re most welcome Ashish 

          As for Alarm panel to CMS communication; I’m considering starting a project like that but I will have to do a lot of reading up before I can answer any in depth questions … sorry … 

          Reply

          hans

          • Jul 21, 2016 - 6:06 AM - Ashish Comment Link

            Thanks Hans, its good to hear that you want to start a project in this area. If you need any help to understand the available technologies, methods, pro-cons etc… let me know, I have done a lot of research …although i am still confused with some of the protocols. 

            Regards

            Ashish 

            Ashish

          • Jul 21, 2016 - 6:19 AM - hans - Author: Comment Link

            Thanks! 

            I’m in the middle of a move (to the US), so it might take a bit before I get to it … 

            hans

  • Jul 28, 2016 - 8:59 AM - edward Comment Link

    I have a 230 volt PIR. I use the trigger line to operate a relay. My problem is that the trigger circuit is not at zero volts when the pir is not detecting an intruder. The voltage on the trigger wire varies over time and this in turn triggers the relay randomly. How can I prevent this? (12 volt PIRs overcome this problem but cost some £65)

    Reply

    edward

    • Jul 29, 2016 - 3:15 AM - hans - Author: Comment Link

      Hi Edward,

      I have no experience with 230V PIR’s, and I’m not the best guy in electronics either
      First of all, the PIR’s I use costs $1 at eBay or AliExpress, when I bought 10 at a time. Worth looking into?
      Second thing to think about might be something like a capacitor … I’m not an expert, so I’m not sure if such a filter will do what you want.
      Now as far as the signal goes; if you’re using something like an Arduino, you might be able to catch this in code as well.

      I am however wondering how your PIR would normally be used … 

      Reply

      hans

    • Jul 29, 2016 - 3:18 AM - hans - Author: Comment Link

      This article on bypass capacitors might be helpful …

      Reply

      hans

  • Sep 9, 2016 - 6:24 AM - ABHISHEK GUPTA Comment Link

    Hi

    Can a PIR sensor can be adjusted to sense humans maximum at a distance of 10 – 15cm?

    If not are there any sensors to do so?

    Also are there any sensors (PIR or any other) which has a straight constant width detection range and not increasing for the detection of humans?

    Reply

    ABHISHEK GUPTA

    • Sep 9, 2016 - 7:38 AM - hans - Author: Comment Link

      Hi Abhishek,

      I’m (of the top of my head) not aware of any PIR sensors that meet your specific demands.
      What you could try however, is remove the plastic “dome” around the sensor. It will narrow down the width.

      Reply

      hans

      • Sep 10, 2016 - 6:29 AM - ABHISHEK GUPTA Comment Link

        Thanks for your answer,

        Are there any other sensors which meet my demands?

        Reply

        ABHISHEK GUPTA

        • Sep 10, 2016 - 7:37 AM - hans - Author: Comment Link

          There probably are, but honestly; I have no idea which types/models … sorry 

          But: please post here if you find any! I’m sure others might be looking for that as well. I just had not had the time or need for it.

          Reply

          hans

  • Sep 28, 2016 - 1:27 AM Comment Link
    PingBack: danamartensmfadt.wordpress.com

    […] and timing potentiometers marked on the back, so I had to look at a whole bunch of other models/examples and kind of fiddle until they worked. I also included an LED that would let me know when the camera […]

  • Nov 16, 2016 - 1:25 PM - saeid Comment Link

    When there is a motion LED is on. but when there is no motion, it turns the LED for about 5 seconds and after about the same time it turns it off. This happens always and periodically when there is no motion? what is wrong?

    Reply

    saeid

    • Nov 17, 2016 - 8:12 AM - hans - Author: Comment Link

      Hi Saeid,

      Either your sensor is faulty, or it is set to an oversensitive setting, or … something in it’s line of view is actually moving … 

      Reply

      hans

      • Nov 17, 2016 - 10:55 AM - saeid Comment Link

        Thank you. But I checked with 3 sensors all have the same problem. I checked with different sensitivity but still have the problem.  I am using Adafruit Huzzah. any suggestion?

        Reply

        saeid

      • Nov 18, 2016 - 7:55 AM - hans - Author: Comment Link

        I have never used the Huzzah, but it sure looks interesting! 

        I don’t think this conflicts with using a PIR though, but to make sure you could make a simple setup (as shown here) to see if the bad behavior of the sensor still occurs … this way we would eliminate influence(s) from the Huzzah.

        Reply

        hans

  • Nov 17, 2016 - 3:09 PM - Ashish Comment Link

    Hans, Have you ever heard / knew if domestic lizards may trigger the PIR sensor?? Domestic lizards can walk at any surface and I won’t rule out the possibility of them walking over the sensor itself. 

    If that is indeed the case, how can we avoid that? 

    Reply

    Ashish

    • Nov 18, 2016 - 7:47 AM - hans - Author: Comment Link

      Hi Ashish …

      Hahah well, that’s an interesting problem indeed 

      You could build a cage around the sensor from, for example, chicken wire or something like that.
      Enough holes in it to detect motion, and since the chicken wire cage is not moving, the sensor will not “see” it.
      Hopefully that keeps the lizard out … 

      Reply

      hans

      • Nov 18, 2016 - 10:30 AM - Ashish Comment Link

        :) :) :) That’s indeed  good idea, I will consider it if I face this issue in real life :). 

        Thanks 

        Ashish

        Reply

        Ashish

  • Jan 21, 2017 - 10:53 PM - Dilip Poudel Comment Link

    Hello Hans,

    I am in serious trouble here, I tried to use PIR with raspberry pi for a project to detect motion and the sensor is detecting the motion but the problem is that it also triggers without any moment when faced towards wall with some distance. It keeps triggering two times in each minutes like in 6th second and 51th second in each minute continuously. And the problem is I don’t have other pir sensor to test with and the cheaper one comes with around 10$ for each with minimum of 2 day of delivery . So I want help as I am absolute beginner for these sensors. Please help here.

    Reply

    Dilip Poudel

    • Jan 23, 2017 - 8:48 AM - hans - Author: Comment Link

      Hi Dilip,

      You could try changing the sensitivity, and see if it improves the situation.
      Additionally, either the PIR is defective (which I have not encountered yet!), or there actually is something triggering the PIR. Keep in mind that heat sources and critters can trigger the PIR as well.

      Another reason that might trigger the PIR is a not so stable power supply (effectively resetting the PIR).

      Also note: if you buy a 10-pack, for example this one at Amazon, then the price of a single PIR drops well below $2. 

      Reply

      hans

      • Jan 23, 2017 - 10:28 AM - Dilip Poudel Comment Link

        Thanks Hans,

        I got it okay now , Once I changed from PI 3B to PI 2B it worked just fluently and I came to conclusion that the PI 3B with a PI NOir camera with IR lamp attached to it can’t provide enough power to pir sensor as it is more power hungry. So if any one have come across such problem it is not on your sensor its the problem with PI 3B which takes too much power source and the normal adapter can’t deal with the PI 3B. And sorry Hans but the Amazon can’t deliver in my country (Nepal) and yes I think we have to pay double the amount for these machines for atleast few more years. 10$ for sensor 68$ for pi and around 52$ for sainsmart 5mp camera but still pi is pi just amazing to explore. 

        Reply

        Dilip Poudel

        • Jan 24, 2017 - 11:16 AM - hans - Author: Comment Link

          Hi Dilip!

          I’m happy to hear you’ve got the issue resolved. Nice! And thank you for posting it here as well! 

          As for thing being expensive in Nepal: Oh my, and I though I had it rough when I was living in Holland (expensive shipping, and Dutch customs charging an arm and a leg on import and sales taxes). I’m sorry to hear that – maybe countries should look a little closer to the rules they dictate when it comes to electronics like this. It’s preventing others from developing innovative things …

          Reply

          hans



Your Comment …

Friendly request to not post large files here (like source codes, log files or config files). Please use the Forum for that purpose.

Please share:
*
*
Notify me about new comments (email).
       You can also use your RSS reader to track comments.


Tweaking4All uses the free Gravatar service for Avatar display.
Tweaking4All will never share your email address with others.