The video didn't really explain *how* they work. It's a single pixel sensor. The white plastic IR lens is absolutely critical; the bee's eye pattern creates sensitive hot spots (and dead zones) across the overall field of view. As the target moves across the overall field of view, it naturally enters and leaves the hot spots, or even wiggles in and out of a single hot spot. The built-in detection circuit looks for this alternating signal and it expects a certain timing (a broad frequency range) that corresponds to natural human movement across the overall field of view. Clearly there's an opportunity for many design choices in terms of the lens design and filtering employed. By way of example: assuming that the filtering is designed to minimize false triggers, then a very very very slow movement by the target across the overall field of view would presumably not trigger an output signal. Cheers.
which is why these are best used for objects moving across its FOV rather that away/towards it directly. So placement plays a big role in effectiveness.
To provide an alternative viewpoint, I would say that I really appreciate videos that concentrate on the application of sensors, rather than the theory of how they work (I am interested in that as well, but I have already watched a number of videos about that, there are so many). More interesting to me is to see the different sensors and compare the features and applications, which is what I think Andreas does so extremely well with his scientific approach. Mind you, your description was good and definitely worth reading.
I have a PIR sensor with 2 pixels wired in opposite, wich means that if a target passes in front of the sensor it will produce a positive then negative voltage wave.
Super review, Andreas. Recently I used a 501 detector to trigger an EL-wire baseboard night-light so that I wouldn't step on the cat in the middle of the night. That wakes up the entire household. To keep the light from triggering during the day, I wired a photo cell and a resistor right on to the 501 PCB. I used the pads marked RL. I think the RL pads are for night only filter, and the RT pads are for day only filter.
Perfect. Excellent video and testing of most common and not so common (Panasonic PaPIR) . Incidentally, I had also tested range/sensitivity/false triggering exclusively for Panasonic PIR. I too have exactly the same view on trigger-and-on time and retrigger time, I also prefer all logic of pattern detection be on microcontroller and for that in the basic tests I only used oscilloscope for sensors' output. Of course, I did not test other than Panasonic for the above reasons. I guess low cost PIR modules which trigger and hold output might be good for simpler projects like driving the relay/bell etc. For better control over the signal processing Panasonic PIR (I tested digital but they have analog version too) is my choice. Overall, a great and informative video, each frame and audio is useful and can not be missed for a proper understanding, I can appreciate as I had been through this process myself and here I got the relative comparison as well.
Excellent! To shorten the distance or to avoid detection in some zones, try replacing the fresnel dome with a cilinder in front of the sensor. In my case, wanted to detect in a short range of 5-10 centimeters.
The HC-SR501 can actually be used as a analog instantaneous input w/o delays. Have a look at the circuit in the datasheet and trace out R7 on your board. Solder a wire there and you get an analog signal straight from the sensitivity calibration circuit. I'm not sure anymore from which end of R7 I took the signal, but it worked and is already in the 0..3.3V range.
I love you! I have just started making a special "reactive stair" light, and tested different sensors for each step on the staircase. I started with many ultrasonic distance sensors, very good but since they emit ultrasound which can sometimes cause interference with speakers and light dimmer switches, I decided to use small PIRs on each step. I have designed a 3D printable tube that can restrict the field of view, so that each sensor only sees the foot on that step. I calculated through a 3D model that the tube needs to be 32mm long to restrict the field of view of a 50 degree sensor (AM312) to the height of about 200mm along the width of the stair (1m). (I didn't need to do this with a 3D model, I could have done with simple trigonometry, but it was useful in other ways.) Only yesterday I received an Aliexpress order of these new 12V PIRs very small with round enclosures that can be inserted into an 18mm hole. I haven't tested any of this yet, but just at the idea stage. So your video was PERFECT TIMING! Thank you!
One sensor for every step? Do you often stop at one point of the stairs and thus just turning the all lights on or as a timed standing clock chain doesnt work?
Leo Curious I don’t know yet, it’s a big staircase with multiple runs though and I wanted a way to support tracking movement, in case someone enters from top and bottom at the same time. It’s over the top, but we are building a home so can wire everything from new, and I like a good project...
It is very important to note that the output signal of the HC_SR501 is a 3.3V logic signal, which is safe for most modern electronics, while it can be powered by anywhere between 4.5V to 20V. This gives is a wide range of uses.
As always an excellent video, I would definitely use this information when ordering detectors for my auto off light project, thanks Andreas. And I hope your finger is healing good. /Ole
Thank you , Andreas . Hope your hand gets better . I noticed spanish subtitles when I press the subtitle button . I used to get the normal english ones auto generated by Google . Now I have to check spanish >english for getting the english ones ( I like subtitles in case I don't hear something correctly , especially when there is noise in the room where I see the videos )
Your videos are so educational and involve extensive research, yet you keep it simple! Great job and great channel; have subscribed. I wonder how I never stumbled on the channel until now. Please keep up educated.
tip from experience, i replaced all my SR501's with the smaller 3.3v AM312's however the range was not as good as the 501's. I decided to try the lens from the 501 on the 312 and found i got considerably better range. I 3d printed adapters so the 3.3v am312 sensor would fit in the middle of the 501 lens correctly and am happy with the power usage and performance now.
The HC-SR501 is the sensor to get if you want millions of false alarms. I got a bunch of these to use for my ESPHome projects around the house, and all of them fail miserably, with false positives. Every few seconds with some of the sensors, to every few minutes for the better ones. If you search for this sensor, people complain about how useless they are, and the frustrations and waste of money. No amount of pull-up or pull-down resistors, added capacitors are going to fix it. I found a place they suggested to use the Panasonic EKMB or EKMC series PIR's, which are the two Panasonics shown in this video. You can buy these from DigiKey or Mouser. They are a little more. I got some of them, and they work perfectly. The one I got said the data pin would be VIN minus half a volt. So for my ESP32, I powered it with 3.3 volts so I wouldn't overpower the data line to my ESP32.
Thank you for your video. I pretty much have concluded to the same findings. It would be very interesting to see a false alarms area comparison between all those sensors. When I used SR-HC501 or SR-HC505 sensors with esp8266 boards I had a lot of false alarms. But that was to be expected as those two don’t work at 3.3 volts. Perhaps those hiccups could be eliminated with a voltage shifter board, but I never tried it. I went for the tiny AM-312 Sensor and I’m happy with it. Many thanks !
Very useful information! Looking forward to trying one of these sensors in combination with a relay to turn on/off the lights whenever my kids enter or leave their play area in our basement.
Thank you for your last two videos. I'm in the process of creating a battery powered PIR Sensor with the AM312, so this fits perfectly. My Tip for one of your next videos: How to create a low powered PIR Sensor using deep sleep and wakup by the PIR.
@@AndreasSpiess I thought so too. I haven't started yet with this but i read the following: "The problem is that to wake the ESP8266, you have to send a single rising edge to the Reset pin. When using a switch or the signal of a PIR detector, the signal sent is not correct and it causes a multitude of restarts of the module. The peak power consumption is at the start of the module. If we want to avoid waste and save the battery from unnecessary energy costs, we must solve this problem." diyprojects.io/esp8266-deep-sleep-mode-test-wake-pir-motion-detector/
Being able to adjust HIGH output duration (after a trigger), can be useful if you want to keep a microcontroller powered during that time through a load switch made with mosfets. I use the HC-SR501 for that purpose.
I strongly recommend the Panasonic EKMB series with 1uA supply current for low power applications. I built many PIR Lora Sensors which are battery powered, using an atmega 328 as a microcontroller in low power mode. This gives me a total of 2 uA sleep current and on 2 AAA cells a lifetime of up to 5 years and a million Lora transmissions. With two AA cells you can reach 10 years. (Energizer lithium). Sleep current is less than the battery self discharge. The PIR sensors are about 10 EUR at digikey but there is no alternative for such application. Sensitivity is great and no false alarms.
I used the hc-sr505 in Arduino mkr 1010 wifi without modifying it. I connected the the sensor VCC pin to mkr 5V pin and, ground to ground and signal from sensor to a digital pin on mkr. It worked pretty well, the out from sensor is regulated to 3.3 V so it did no damaged the mkr.
Thanks Andreas, I've been looking for some more reliable pir sensors, the am312's if used very close to a wemos d1 mini, seem to trigger randomly, I'm assuming that's due to the rf, if I move them away by 4-5 cm, they seem to work, but it means the small footprint project boxes for sensor nodes can't be achieved..... I will order some of the panasonics, see if they fair better... Many thanks,
Even if you put some Aluminium foil in between and solider it to grnd (minus) of the supply? Create a shield around the pir PCB juzst the eye thgat points away is uncovered shoulkd work!
SR-HC501 and SR-HC505 seem to use, according to schematics I found, the very same power supply circuit (based on 7133-1 LDO regulator and some not described protective diode).
The problem with this is that range, size of object, and angle are interlinked.so results are always very special unless you make hundreds of different tests :-(
I pair an HC-SR501 PIR module with a cheap RCWL-0516 microwave motion sensor. Together, they provide reliable motion sensing, but motion alone is not useful in an area where deer and turkeys are common visitors. So, spacing of sensor pairs can be used to establish a "confidence value" variable. If one HC-SR501 detects motion, a confidence level variable is increased by 0.1, or by 0.15 if both the HC-SR501 and RCWL-0516 were triggered. If another sensor pair that's 20 meters away is triggered, the confidence value is raised in inverse proportion to the time between the triggers. If the confidence variable exceeds a trip value, I get a notification, and since confidence level is decremented a small amount in each loop, false triggers (usually turkeys) are ignored. You can sneak past these sensors by moving very slowly, but YOU WILL BE LOGGED! (And your picture will be saved for 45 days)
Sounds you have a sophisticated installation! Pattern recognition probably will also help in the future to distinguish between animals and humans. But usually at a higher price.
The RUclips algorithm hid this one for me, weird. Thanks for the comparison! My practical application for the AMG8833 grideye is to detect presence where no movement is possible, for example on the sofa, behind a desk or at the dinner table. I use it in combination with a PIR that detects the initial moment and then the AMG8833 makes regular checks to see if the presence is still there. I've written some software that analyses the grid for that. It's been running for half a year now without a single mistake and is linked to (among others) room lights, so the light in the specific rooms stay on even if you sit dead still on a chair or sofa. I'm curious to see how it will hold up in the summer when temperature differences might be more subtle. For rooms where presence is always linked to movement (hallways etc.) I only use PIRs (HC-SR501) but am really struggling with false positives. Tried remedies like wrapping an outer case with aluminum foil to prevent interference but don't have a fail proof solution yet. I will definitely try out the Panasonic sensors you mention!
can you share the code you use to analyze the data coming from the amg8833? I have found relying on just the raw data to not be reliable, it seems some kind of algorithm or further processing is required.
Thanks for another great video, you often are looking into the stuff i am considering to experiment with, very helpful. I hope you’ll do some more research on the Panasonic sensor they are promising for combination with (low power) esp-01 projects
I've got a project to use the AMG8833 as a person detector. It takes a lot of processing to make it reliable, you have to do background estimation from the onboard temperature sensor and Kalman filtering on the pixel values to smooth noise. I got a prototype working on the bench and it worked really well at identifying people against background, but I still haven't had a chance to port the code to a microcontroller.
@@AndreasSpiess It's on my to do list, but I was still missing one crucial piece to really get it working and it's all really half baked. I'll share if I ever have a chance to get it into a state that someone else can do something with it!
The HC-SR501 and HC-SR505 are not using the AM312. The AM312 is a complete digital sensor, while the HC-xxx use an analog sensor and analog IC next to it. I want through a similar testing phase a while ago for home automation, included ready made thing as well, like Ikea lamps. In the end the AM312 sensors are the best because of low size and low power consumption. Good video!
@@AndreasSpiess Pretty generic stuff, it behaves like a transistor with more or less current flowing depending on amount of IR. Then it is processed by a chip, the BISS001 is common in many products and found on the HC-SR501. The '505 uses some similar version, but with more passive components inside.
to get long range out of any single pixel sensor use a tube about 4cm long that fits over it snugly with a 2mm pin placed vertacally true it at about the middle of the tube. it wil have an smal FOW but very long range
I have found out that acorrding to Schematics of HC-SR501 and HC-SR505 uses same LDO! The Holtek HT7133-1 which converts 24Volts Max to 3.3Volts so I removed it and made a Bridge with VIN and VOUT and removed the Zener Diode in series with the VIN of HC-SR-501 and and Bridged the connection and Yess It Works with 3.3Volts now. It is the same as HC-SR-505 but you dont have to remove any Zener Diode cause simply there is none on HC-SR-505. This is my happy IoT gift to everyone. Enjoy and keep Making things!
I have a pair SR505's on my bench, with a 18650. want to light some LED's like a simple room light. I have a string of those micro LED's that run on 3 AA batteries but they work fine direct on one 18650. looking to remove the voltage regulator. watching now to see your trick at the end. ---------------------- The SR505 has a HT7133 voltage regulator, since it can take up to 26v that seems to be a good choice. I was thinking of just removing it for my use. I need to run a string of white LED's, no more than 10. For initial testing, I will simply use a phone charger for 5v and a 1N4148 to drop the voltage. My current is not very high (5 LED's for testing) so this should work. The project is under cabinet lighting so duration is not very important and longer is better. if all goes well, then a micro to fade up and down the LED's will be a future upgrade.
@@AndreasSpiess : it is almost 4:00 AM here in the States... I do plan on trying your trick. I watched this video within 13 minutes of your post and my thumbs up was #63. now, a few minutes later it is almost 300 !
What a superb pleasant vid to watch (even though i'm not so electrician guy). Please do review sometimes with BS612, or is it too unreliable? can't see clear from spec sheet. maybe you could help me what this chip is in par with? or just the worst of them all, cheers
Thank you Andreas. 2 Questions I'm looking for an answer: 1) how to overcome sporadic/false alarms ? 2) sensor which are 3.3v, can't we use a 5v pin as most MCU's have ?
You always have to consult the datasheet before you connect a sensor. But most of them can go with 5 volts. False alarms can be triggered by unstable poweer as mentioned and also if you have an ESP close to it because it emits RF energy
Regarding the false alarms. What about deploying a bunch of sensors and let the majority decide? As Andreas mentioned, they are extremely cheap and when you have enough sensors spreaded across an area you could feed a neuronal network to learn a persons exact location.
I have a few HC-SR501s and they randomly trigger themselves. Even when inside a drawer! Girlfriend was not impressed when the front door light goes on and off all night. Gonna buy a more expensive one, like the Panasonic one from your video.
@@AndreasSpiess It's being powered by a RPi4. It's about 3cm away from the board, but located at the opposite end from the antenna. RPi is running Motion Eye. When in the drawer, it was much further and still randomly triggering. Could've been a bad batch.
Regarding HC-SR501: - Many 3.3V boards have a 5V power supply, like ESP8266 boards. This sensor can be powered with 5V but still has 3.3V output, i.e. fully compatible - Most versions have a jumper to select single or continuous triggering, i.e. if motion is constant, the output stays constant in the continuous mode - I've hade some problems with false triggering but have found that this is completely removed if the sensor is not too near the ESP and a 1000uF capacitor is added between 5V and GND at the sensor side. - And regarding false triggering, in some projects I'm using 2 or 3 sensors of this type. I then get a better coverage of a certain area and I can add logic to e.g. require at least 2 triggered sensors to further avoid false alarms.
Of course, you can use 5 volts for mains operated projects. For battery-operated projects, I do not use 5 volts to save a lot of energy. Unfortunately, the "continuous mode does not resolve the minimal trigger time of 8 seconds. And you are of course right. Do not place sensitive devices too close to an RF source. Adding more than one sensor is a good idea to prevent false alarms, also a radar sensor that detects different signals can help.
@@AndreasSpiess Most modules state 0.3s to 5 minutes, depending on the adjustment. I can adjust my modules to less than 1s at least but there is some variation. For alarm purposes this is sufficent.
Nice video, I can confirm that hc-sr501 can Work on 3,3v by removing the regulator. I have used it to turn on the light in my bathroom, but I droppede it because of false trigs. I think its the flor heating that fools the module. I have replaced it by an Ikea motion sensor, this sensor is working perfekt, not sure which sensor onside.
suggestion, offer some 'lock-down' projects. I am working on under cabinet lights from a cheap white, LED string that uses 3AA batteries. future project is to make stair lighting with a PIR at the top and the bottom of the stairs. I have an old coffee pot with heater and was thinking of making a Sous-Vide maker for one. I am also trying to get node-red/mosquitto/esp8266 to work on an Ubuntu machine for use with my outdoor garden soil and rain sensors.
Thanks for all your good work. This is one of my favorite channels; I learn a lot. Any opinion on the Joulescope vs. the Otii? Is there a clear winner?
Excellent video. One possibility, from my ancient history of PIR sensors is that in order to reset the sensor that initialize with extended reset delay, is to program restart of sensor (initiate sensor power on/off sequence), with timestamp, forcing a log file to be created. "New" active detection time is reduced to 750 ms delay. But I have not tried this trick with Arduino or Raspberry or ESP boards because I have not investigated how the sensor library is compiled. Voltage interrupt programming sequences are not something I've worked on for over 10 years. In the past, we used simple switch relays. I do not know enough how Arduino handles sensor signal errors.
Andreas I know nothing about electronics, but you obviously do. 😀 I’ve put up an outdoor battery powered night PIR motion sensor LED light that was purchase new around 18 months ago. I tested it first and was impressed by it. It’s solar powered and all seems great performance. It solar charges and uses 2 sealed 18650 batteries connected to a small board with a round plastic sensor as you show, that ‘looks like’ an EKMC1603111. Installed it and tested and works great. However it false triggers 30 times each evening. I completely covered the sensor and tested it would not detect, however it still false triggers even covered, so it’s faulty. Which is a shame because otherwise it’s an impressive light for being solar powered, and I hate to just bin in. The board and sensor doesn’t seem to have any adjustments at all. Is there anything I can ‘simply’ and cheaply do to fix it? I know you haven’t seen it or even know what it is at all, but is it simply pushing in a replacement sensor and which to use and where to get one? Any advice would be much appreciated. Thank you! 🙂
It would need a lot of analysis to first find the fault and then try to correct it. Just a remark (I do not know where you live): PIR sensors detect heat differences. This is why they do not work in hot environments.
@@AndreasSpiess Thanks Andreas for getting back. Manchester, England, UK. I know it's stupid to ask as I cannot show it or I even tell what it is. I completely covered and enclosed the sensor so it could not be triggered and it still false triggers, and has been doing since installed about 2 months ago. Possibly some internal electronic noise is setting it off. But could that be fixed by replacing the sensor, or board, or both and everything? The LED light is great and so too the batteries and it appears to charge ok, so a shame to throw it if it can be simply and cheaply fixed. Just I have no idea, but I have got a basic soldering iron. Haha 😆
@@AndreasSpiess This light has only a basic motion sensor, it doesn't have WiFi or any adjustments inside or out. It only 'looks like' similar to the sensor you showed. It's outside, but I and all the neighbours have indoor wifi as everybody does. I wanted to know if you have experience in fixing false triggering battery powered outdoor sensors, and if so what's the fix - in easy simply terminology.
Hi Andreas, I watched your video and I learned some more about PIR sensors. I have a question and hope you can give me an answer.I have a solar lamp with a passive motion sensor. Could I remove it to make it only a solar lamp? if yes, Do I have to connect on the circuit board on the place I removed the PIR a cable from the ground to the neutral to make it work when the sun goes down? Greetings from Mexico and thank you in advance.
I do not know the wiring of your device. You probably have to do some measurements with a Multimeter before you remove it. Maybe you have to shorten the two wires to get your effect, maybe not.
Hi. Great video. How did you connect the panasonic PIR to the ESP? Did you connect cables directly from the pins of the PIR to the ESP? I have a panasonic EKMC1603111, but it does not seem to talk to the d1 mini board. Do I need a circuit board connected, like the am312 have? I have good experience with am312 sensors, but the range of theese sensors is too low.
Great info as always! Thanks for the detailed review! Really interesting devices and makes me wondering about using for Terahertz spectroscopy and imaging with a few and some fancy software logic. Looks like not quite there in range however, with only the ~8 to 12um... if that usable response. I haven't used in so many years... I forget what frequency range was being used for the density measurements.
@@AndreasSpiess That's OK! We all learn somehow. I used in the pharma industry to understand name brand extended release products design. en.wikipedia.org/wiki/TeraView To me, seems like might be more common in the future if systems application use volume increases to bring down price point for more main stream consumer potential apps. For now, plenty of NIR, Vis, UV sensors... including for spectroscopy and imaging for example when the hot lens is removed.
I came across this video in search of a way to fix the false positives with the AM312 motion detectors. Put the 2 capacitors in place and it works perfectly now. What happens if I want to add multiple AM312 to my MCU? Do I need multiple 10uF? Or can all of the AM312 work off of the same capacitor? I believe that I would need a 1uF capacitor for each AM312 output..
@@AndreasSpiess thank you for the reply! I guess I was not concerned about the costs here but more around keeping the circuit simple and minimizing the number of components.
Hey Andreas, you already have few videos about PIR sensor but seems you never reviewed SR602, which is present on AliExpress as well and performs very well with my ESP 8266 projects, don't remember I had any false alarms with them for example. I'm not sure if they are based on AM312 or it is different sensor inside, I couldn't find such information. Did you ever try to compare AM312 with SR602?
Hi Andreas, how did you hook up the panasonic one? you hook it up directly to a gpio or did you used some opamp or a pir chip? if you hook it up directly, you used the analog or digital gpio? Edit:now i've checked the the datasheet and it seems those pirs are digital ones so i guess no amp it's needed
have a problem in tasmota configration and i need help plz... i have sonoff basic r2 changed it to tasmota and i attach physical switch to RX (gpio03) and PIR sensor to Gpio14 and i defiend pir sensor as switch put i want pir didnt control the relay direct... so i apply command setoption114 .. that detach all switches from relay but it detach also my switch (gpio03 RX) and that make problem that when sonoff didnt connect to HA i cant controlr relay from the physical switch any way to make switch automatic control realy and only detach pir and expose its signal to HA so i can make automation from it.....
Unfortunately, I am no Tasmota specialist. I do my complex automation in Node-Red or HA and use Tasmota only as a sensor or actuator (as you mention at the end of your comment). Since I use HA, I anyway completely changed to ESPHome...
I live in both Florida and Viet Nam. The high temp. often cause false triggers. What else could I use? I looked into the lasers used on automatic garage door openers but there expensive. (but no false triggers) I will be testing the ultra sonic next. I want it for use with an Alarm/pizo horn for intruder. And to trigger cameras to start recording. The PIR is a big failure for these applications. Even a cloud passing by on a sunny day will cause the PIR to trigger.\ Any Ideas on what you might think would work better?
Andreas, thanks for posting a great video. I not an electronic engineer, but got inspired to try the panasonic pir (EKMC1603112 ) with nodemcu esp8266 (Amica) chip. But the sensor is always returning high status on output. Checking online it seems I need to add a pulldown resistor to the output of the pir. I am no idea to figure out which which resistor to put in.. Some people say 10k and some 100k.. Could you help me with this? From the datasheet of panasonic pir "Please select an output resistor (pull-down concept) in accordance with VOUT so that the output current is maximum 100μA." I plan to power using 3.3v from nodemcu, Average current consumption of the sensor is (I-w) 170μA, Max Output Current (I-out) is 100μA, Min Output voltage is 3.3v-0.5v=2.8v. Thank you!
PIR sensors do not like heat and sun. Many viewers, particularly in warmer countries complained about them for outdoors usage. I do not know how they behave in heavy rain, too. Radars sould work in both situation. But you have to try.
Hello! I got a question about PIR sensors. Can they detect a person sitting a desk only moving his hands by typing on a keyboard or moving his computer mouse? What i mean is normal behaviour of a person sitting by a desk. Very still and small movements. Range would be like up to 5 meters. Thanks in advance! (even if this was released 3 years ago)
Temperature compensation is key in the 90-95f range, and dual pirs sensor elements may be wired as opposite inputs to a differential amplifier. This is done in alarm grade, do these have these features?
I do not know, and I am not sure if they publish everything in their datasheets. They write something about temperature compensation. Here where I live, for the next few years they still run ;-)
Thanks for this video Andreas, it came really handy, I've been looking for good PIR sensors, did you know about the Murata IRA-S210ST01? Also your circuit to reduce the false alarms, what are recomended values for the coils? Thanks!
Thank you for the comparison 👍 It would be interesting to have a pir sensor which could be triggered by humans and not by cats, but the temperature difference is very small between them. Cat's operating temperature seems to be about a few degrees higher than human 😉 Otherwise pir switched lights like in the carport or hall makes no sense for me.
Detection depends on beam WIDTH and length . Unless your cat is over 1m in height then it is only a matter of placement, orientation and selecting beam length/sensitivity.
I have a perimeter alert system that uses wireless motion sensors. The motion sensors have failed one by one over time and new ones not available. How Can I make another motion sensor become compatible with my system?
Hi Andreas, I tried the Panasonic EKMC1603111 Sensor but I could not get it to work with a WEMOS D1 Mini and Tasmota. As requested by Panasonic I tried a pull-down resistor around 100k between ground and the output on different pins, I tried D8 Pin which should have a pull-down onboard but everytime I connect a PaPir to a WEMOS, the WEMOS gets practically unusable. How did you connect it to the Arduino and get it to work? Greetings
@@AndreasSpiess No, I haven't tried the Sensor without the D1. I bought 4 of them just to make sure to have a working one because I am cursed with ghost triggers of the HC-SR501 Sensors. So you say I should give the PaPir a 5v source and measure the voltage of the output pin or is there another method?
I tried to wire two am312 sensors together to increase the viewing angle. I had both sensors share the vin, gnd, and out but it did not work. I am assuming they can't share the out. I tried to use diodes to stop the out from going into the other sensor but that didn't work either. Why can they not share the out? Is there an easy way to make them share the out pin? Thanks. P.S. I have them connected to and esp32 sharing pin 4 for the out and using the vin and gnd on the esp32. I monitor the results in home assistant.
The easiest way would be to connect them to two pins. Otherwise you have to create the right logic. I do not remember if they are low or high active. You can google how this is done.
@@AndreasSpiess Thanks for the quick reply. I believe they pull high. But I think I will take your advice and just run two pins at least this way I will know which direction the movement is coming from.
Take those bare sensor ones that made bad thermal cameras and use one of them to make an IR spectrometer or temperature, with the aid of some form of collimation or lensing.
Can you show us how you connected the panasonic sensors with the microcontroller because when I connected it with esp32 it doesn't respond at all, so do I have connect some additional devices like capacitor, or resistor or or I can directly connect it with the microcontroller, but when directly connect the vcc ,gnd and out pin mine is not responding so please help me with this
Maybe you do your measurements to decide where the problem is. First: Sensor alone. Second: Connected to the ESP32. Third read by your sketch. And always read the datasheet for your particular sensor.
Hello Thanks for the Video. I used the HC-SR501 with ESPhome and an ESP32 but it keeps triggering false. detects motion when theres no motion. tried two of them and even tried with a d1 mini. i got the same result. false triggers. Any idea what the issue might be?
Maybe they are influenced by the Wi-Fi of the ESP. Either you try to switch the radio off, try it with an Arduino or STM32, or add a distance between the sensor and the ESP. Keep in mind: They do not detect motion, they detect temperature differences. So If the sun heats something up it could also trigger.
@@AndreasSpiess Thanks a lot. So would you say the Am312 is the best motion sensor ? Trying to build a multisensor device for my home automation. Will contain, temperature, motion, sound and light. What motion sensor do you recommend for such project? I stay on a tropical region and it gets very humid.
@@AndreasSpiess Sir I did but mine is still not responding I don't know whether it is a faulty product or what, Or do I have to connect some capacitors or inductors as you as shown in the video. I have no idea How to do it, so please just tell me how you connected your EKMC1603111 with your microcontroller.
Thank you, great video. I was wondering if someone could exmplain what is the impact of the capacitor on the pir output line? sorry I am a complete novice, i understand using one across Vin and ground to ensure it has the power it needs but don't understand what it does to the signal. (still saving up for an osciliscope ;)).
Global warming is revealing a weakness in outdoor PIR sensors. During last summer, our outdoor PIR sensors stopped working. At first I thought the heat had damaged the sensors, but this was not the case, ambient temperatures in the UK had reached blood heat and our sensors could no longer distinguish between the background and body heat. On some days the sensors started working again, this was when human targets actually shadowed the warmer background. Now I have plans to to use radar modules in parallel with the PIR sensors. With regard to the range of the PIR sensors, this is not the whole story as most sensors tradeoff range for angle of sensitivity, a bit like LEDs. More range usually means a smaller angular range of detection. With regard to 3.3 volt and 5 volt operation, I really do not understand the difficulty, as it always possible to insert an open collector/drain level shifting transistor. I tend to buffer my processor projects this way, as I like my active sensor state to be zero volts. The advantage is that it is far easier to protect the processor inputs from noise spikes and in all systems ground zero volts is a common voltage shared by all parts of a system, even if different elements of the circuit run from different supply voltages, such as 12, 5 or 3.3 volts. There is also a logical argument that using pull-up resistors in the receiver and open collector pull down in the driver makes the circuit fail safe. It also means that sensor on "long wires" can be connected safely, without concerns of latch-up due to the sequencing of supplies. It is one of the reasons I like CAN BUS drivers.
The problem with 5 volt is not the logic level, it is the power. The sensors do not run on a LiFePo battery or a discharged Li-Ion battery because the diode and the LDO remove roughly 1 volt. No problem for mains operated devices, but a problem for battery operated 3.3 volt devices.
@@AndreasSpiess I must say I am not a great fan of battery operated sensors, largely because at some stage the batteries need to be recharged, but I accept that in some circumstances battery power is the only solution. Not so much of a problem where solar power is used to avoid the chore of rechanging or replacing the batteries. There is always the option to run more cells in series to provide a higher supply voltage. One of the problems with lithium battery technology is the shape of the voltage discharge curve, with the need to accept the significant drop in terminal voltage if maximum energy is to be extracted from the battery. In very low power applications even the loses of voltage regulation are significant, then it becomes a matter of matching the useful battery terminal voltage range to the electronics, though TI make some ultra low power, low voltage drop, linear regulators. Maybe there is some research to be done on optimising the efficiency of switch mode, up converters regulators, operating in discontinuous mode.
Witch one does the xiaomi device use that is shortly used in your video? I have a few of those (zigbee) and I'm very impressed with their performance and battery life.
The video didn't really explain *how* they work. It's a single pixel sensor. The white plastic IR lens is absolutely critical; the bee's eye pattern creates sensitive hot spots (and dead zones) across the overall field of view. As the target moves across the overall field of view, it naturally enters and leaves the hot spots, or even wiggles in and out of a single hot spot. The built-in detection circuit looks for this alternating signal and it expects a certain timing (a broad frequency range) that corresponds to natural human movement across the overall field of view. Clearly there's an opportunity for many design choices in terms of the lens design and filtering employed. By way of example: assuming that the filtering is designed to minimize false triggers, then a very very very slow movement by the target across the overall field of view would presumably not trigger an output signal. Cheers.
Thank you for your detailed description. Much better than mine. I will pin it to the top.
which is why these are best used for objects moving across its FOV rather that away/towards it directly. So placement plays a big role in effectiveness.
To provide an alternative viewpoint, I would say that I really appreciate videos that concentrate on the application of sensors, rather than the theory of how they work (I am interested in that as well, but I have already watched a number of videos about that, there are so many). More interesting to me is to see the different sensors and compare the features and applications, which is what I think Andreas does so extremely well with his scientific approach. Mind you, your description was good and definitely worth reading.
I've always found it interesting they use a fresnel lens (the white lens cap), same as used in old lighthouses
I have a PIR sensor with 2 pixels wired in opposite, wich means that if a target passes in front of the sensor it will produce a positive then negative voltage wave.
Every Sunday morning a fresh Spiess video, like a swiss clockwork.
Life is good, thank you Andreas !!
Glad you enjoy it!
Super review, Andreas. Recently I used a 501 detector to trigger an EL-wire baseboard night-light so that I wouldn't step on the cat in the middle of the night. That wakes up the entire household. To keep the light from triggering during the day, I wired a photo cell and a resistor right on to the 501 PCB. I used the pads marked RL. I think the RL pads are for night only filter, and the RT pads are for day only filter.
I did not look at this feature. But for sure it is a good addition and you can save a LDR on another MCU pin
Perfect. Excellent video and testing of most common and not so common (Panasonic PaPIR) . Incidentally, I had also tested range/sensitivity/false triggering exclusively for Panasonic PIR. I too have exactly the same view on trigger-and-on time and retrigger time, I also prefer all logic of pattern detection be on microcontroller and for that in the basic tests I only used oscilloscope for sensors' output. Of course, I did not test other than Panasonic for the above reasons. I guess low cost PIR modules which trigger and hold output might be good for simpler projects like driving the relay/bell etc. For better control over the signal processing Panasonic PIR (I tested digital but they have analog version too) is my choice.
Overall, a great and informative video, each frame and audio is useful and can not be missed for a proper understanding, I can appreciate as I had been through this process myself and here I got the relative comparison as well.
Thank you for sharing your experience with the Panasonic sensors.
Excellent! To shorten the distance or to avoid detection in some zones, try replacing the fresnel dome with a cilinder in front of the sensor. In my case, wanted to detect in a short range of 5-10 centimeters.
well replacing the fresnel lens can greatly distort the detection pattern
@@kennmossman8701 sure, but it's fun re-defining the patterns
I can imagine that you can experiment with the patterns if you do not want the full range.
As always, the information in this video was both interesting and useful. Hope you are enjoying your summer!
Glad you enjoyed it!
Danke!
Gern geschehen!
The HC-SR501 can actually be used as a analog instantaneous input w/o delays. Have a look at the circuit in the datasheet and trace out R7 on your board. Solder a wire there and you get an analog signal straight from the sensitivity calibration circuit. I'm not sure anymore from which end of R7 I took the signal, but it worked and is already in the 0..3.3V range.
Thank you for your information! I remember I looked once at the data sheet of this IC, too. But I did no more remember
I love you! I have just started making a special "reactive stair" light, and tested different sensors for each step on the staircase. I started with many ultrasonic distance sensors, very good but since they emit ultrasound which can sometimes cause interference with speakers and light dimmer switches, I decided to use small PIRs on each step. I have designed a 3D printable tube that can restrict the field of view, so that each sensor only sees the foot on that step. I calculated through a 3D model that the tube needs to be 32mm long to restrict the field of view of a 50 degree sensor (AM312) to the height of about 200mm along the width of the stair (1m). (I didn't need to do this with a 3D model, I could have done with simple trigonometry, but it was useful in other ways.) Only yesterday I received an Aliexpress order of these new 12V PIRs very small with round enclosures that can be inserted into an 18mm hole. I haven't tested any of this yet, but just at the idea stage. So your video was PERFECT TIMING! Thank you!
One sensor for every step? Do you often stop at one point of the stairs and thus just turning the all lights on or as a timed standing clock chain doesnt work?
Leo Curious I don’t know yet, it’s a big staircase with multiple runs though and I wanted a way to support tracking movement, in case someone enters from top and bottom at the same time. It’s over the top, but we are building a home so can wire everything from new, and I like a good project...
@Mat: Nice project. You will be the hero if your friends come for a visit, I am sure.
The best explanation on PIR we could ever had. Thank you so much SIR
Thanks and welcome!
It is very important to note that the output signal of the HC_SR501 is a 3.3V logic signal, which is safe for most modern electronics, while it can be powered by anywhere between 4.5V to 20V. This gives is a wide range of uses.
You are right.
As always an excellent video, I would definitely use this information when ordering detectors for my auto off light project, thanks Andreas. And I hope your finger is healing good.
/Ole
The doctor was pleased. So we hope. Next checkpoint in 5 weeks...
Thank you , Andreas . Hope your hand gets better .
I noticed spanish subtitles when I press the subtitle button . I used to get the normal english ones auto generated by Google . Now I have to check spanish >english for getting the english ones ( I like subtitles in case I don't hear something correctly , especially when there is noise in the room where I see the videos )
I have now an Argentinian Lady which translates my videos. An investment for my Spanish speaking subscribers.
A very useful video..I was looking for a PIR sensor for a project, now I have a better understanding of what to use
Thank you for your work! I love the little hand pointer.
You are welcome!
Your videos are so educational and involve extensive research, yet you keep it simple! Great job and great channel; have subscribed. I wonder how I never stumbled on the channel until now.
Please keep up educated.
Welcome aboard the channel!
tip from experience, i replaced all my SR501's with the smaller 3.3v AM312's however the range was not as good as the 501's. I decided to try the lens from the 501 on the 312 and found i got considerably better range. I 3d printed adapters so the 3.3v am312 sensor would fit in the middle of the 501 lens correctly and am happy with the power usage and performance now.
Good idea it you have enough space!
I love your videos! Cheers from a Brazilian living in Los Angeles
Cheers!
Clean, Crisp and to the point. As always - very useful and devoid of any fuss. Be safe, dear friend!
Thanks, you too!
The HC-SR501 is the sensor to get if you want millions of false alarms. I got a bunch of these to use for my ESPHome projects around the house, and all of them fail miserably, with false positives. Every few seconds with some of the sensors, to every few minutes for the better ones. If you search for this sensor, people complain about how useless they are, and the frustrations and waste of money. No amount of pull-up or pull-down resistors, added capacitors are going to fix it. I found a place they suggested to use the Panasonic EKMB or EKMC series PIR's, which are the two Panasonics shown in this video. You can buy these from DigiKey or Mouser. They are a little more. I got some of them, and they work perfectly. The one I got said the data pin would be VIN minus half a volt. So for my ESP32, I powered it with 3.3 volts so I wouldn't overpower the data line to my ESP32.
There are some discussions on these sensors and ESP32s. If too close, the Wi-Fi triggers these sensors.
Thank you for your videos Andreas. Very interesting and well documented and tested. Congratulations !!
Many thanks!
Thanks for this very informative video, it really helps!
My pleasure!
Wow thank you for all that info!! You didnt waste any time!
My pleasure!
Thank you for your video. I pretty much have concluded to the same findings. It would be very interesting to see a false alarms area comparison between all those sensors.
When I used SR-HC501 or SR-HC505 sensors with esp8266 boards I had a lot of false alarms. But that was to be expected as those two don’t work at 3.3 volts. Perhaps those hiccups could be eliminated with a voltage shifter board, but I never tried it. I went for the tiny AM-312 Sensor and I’m happy with it.
Many thanks !
Thank you very much Sir for reviewing this Sensors....very helpful.
My pleasure!
Very useful information! Looking forward to trying one of these sensors in combination with a relay to turn on/off the lights whenever my kids enter or leave their play area in our basement.
Glad it was helpful!
Thank you for your last two videos. I'm in the process of creating a battery powered PIR Sensor with the AM312, so this fits perfectly.
My Tip for one of your next videos: How to create a low powered PIR Sensor using deep sleep and wakup by the PIR.
This should be easy if you use an ESP32 for example. It has many different wake-up pins and you just connect your PIR to one...
@@AndreasSpiess I thought so too. I haven't started yet with this but i read the following:
"The problem is that to wake the ESP8266, you have to send a single rising edge to the Reset pin. When using a switch or the signal of a PIR detector, the signal sent is not correct and it causes a multitude of restarts of the module. The peak power consumption is at the start of the module. If we want to avoid waste and save the battery from unnecessary energy costs, we must solve this problem."
diyprojects.io/esp8266-deep-sleep-mode-test-wake-pir-motion-detector/
I mentioned the ESP32 and interrupts
This video explained very well about the sensor range volts best to buy for your project thanks
You are welcome
Being able to adjust HIGH output duration (after a trigger), can be useful if you want to keep a microcontroller powered during that time through a load switch made with mosfets. I use the HC-SR501 for that purpose.
I agree.
I strongly recommend the Panasonic EKMB series with 1uA supply current for low power applications. I built many PIR Lora Sensors which are battery powered, using an atmega 328 as a microcontroller in low power mode. This gives me a total of 2 uA sleep current and on 2 AAA cells a lifetime of up to 5 years and a million Lora transmissions.
With two AA cells you can reach 10 years. (Energizer lithium). Sleep current is less than the battery self discharge.
The PIR sensors are about 10 EUR at digikey but there is no alternative for such application.
Sensitivity is great and no false alarms.
Thank you for sharing your experience. Maybe I will put one in the shopping basket when I order next time at digikey...
Man, that little hand pointer that you use, is creepy, gives me goosebumps everytime.
Glad you like it. It seems to have a lot of fans ;-)
It freaks me out.
I am super happy that i have subscribed this channel
Welcome aboard!
thank you so much for uploading such great informative content.
It's my pleasure!
I used the hc-sr505 in Arduino mkr 1010 wifi without modifying it. I connected the the sensor VCC pin to mkr 5V pin and, ground to ground and signal from sensor to a digital pin on mkr. It worked pretty well, the out from sensor is regulated to 3.3 V so it did no damaged the mkr.
Thank you for sharing!
Thanks Andreas, I've been looking for some more reliable pir sensors, the am312's if used very close to a wemos d1 mini, seem to trigger randomly, I'm assuming that's due to the rf, if I move them away by 4-5 cm, they seem to work, but it means the small footprint project boxes for sensor nodes can't be achieved..... I will order some of the panasonics, see if they fair better... Many thanks,
I did not test them with Wi-Fi energy. EMC is a general problem...
Even if you put some Aluminium foil in between and solider it to grnd (minus) of the supply? Create a shield around the pir PCB juzst the eye thgat points away is uncovered shoulkd work!
Maybe. EMC is more an art (or try and error)
I create a shield with aluminium foil and cover it with insulation tape then place that between the wemos and the sensor - I get zero false triggers.
SR-HC501 and SR-HC505 seem to use, according to schematics I found, the very same power supply circuit (based on 7133-1 LDO regulator and some not described protective diode).
Thank you for the info!
Good information. Would have liked to see another row testing the angle of the detection area, datasheets can be wrong on some of these modules.
The problem with this is that range, size of object, and angle are interlinked.so results are always very special unless you make hundreds of different tests :-(
I pair an HC-SR501 PIR module with a cheap RCWL-0516 microwave motion sensor. Together, they provide reliable motion sensing, but motion alone is not useful in an area where deer and turkeys are common visitors. So, spacing of sensor pairs can be used to establish a "confidence value" variable. If one HC-SR501 detects motion, a confidence level variable is increased by 0.1, or by 0.15 if both the HC-SR501 and RCWL-0516 were triggered. If another sensor pair that's 20 meters away is triggered, the confidence value is raised in inverse proportion to the time between the triggers. If the confidence variable exceeds a trip value, I get a notification, and since confidence level is decremented a small amount in each loop, false triggers (usually turkeys) are ignored. You can sneak past these sensors by moving very slowly, but YOU WILL BE LOGGED! (And your picture will be saved for 45 days)
Sounds you have a sophisticated installation! Pattern recognition probably will also help in the future to distinguish between animals and humans. But usually at a higher price.
The RUclips algorithm hid this one for me, weird. Thanks for the comparison! My practical application for the AMG8833 grideye is to detect presence where no movement is possible, for example on the sofa, behind a desk or at the dinner table. I use it in combination with a PIR that detects the initial moment and then the AMG8833 makes regular checks to see if the presence is still there. I've written some software that analyses the grid for that. It's been running for half a year now without a single mistake and is linked to (among others) room lights, so the light in the specific rooms stay on even if you sit dead still on a chair or sofa. I'm curious to see how it will hold up in the summer when temperature differences might be more subtle. For rooms where presence is always linked to movement (hallways etc.) I only use PIRs (HC-SR501) but am really struggling with false positives. Tried remedies like wrapping an outer case with aluminum foil to prevent interference but don't have a fail proof solution yet. I will definitely try out the Panasonic sensors you mention!
Sounds like a cool project! Proximity to Wi-Fi seems to be bad for most PIRs.
can you share the code you use to analyze the data coming from the amg8833? I have found relying on just the raw data to not be reliable, it seems some kind of algorithm or further processing is required.
Been waiting for this one
A little drunk ATM.
Will check it out tomorrow.
Happy Sunday
If it is only a little, it is ok ;-)
@@AndreasSpiess no. It's a lot.
Sunday playing games.
honesty is the best policy
Wie immer: Besten Dank für Deine tollen Videos. 😊
Gern geschehen!
Thanks for another great video, you often are looking into the stuff i am considering to experiment with, very helpful. I hope you’ll do some more research on the Panasonic sensor they are promising for combination with (low power) esp-01 projects
I've got a project to use the AMG8833 as a person detector. It takes a lot of processing to make it reliable, you have to do background estimation from the onboard temperature sensor and Kalman filtering on the pixel values to smooth noise. I got a prototype working on the bench and it worked really well at identifying people against background, but I still haven't had a chance to port the code to a microcontroller.
Maybe you document your project and release teh code. As I said, there is nothing around...
@@AndreasSpiess It's on my to do list, but I was still missing one crucial piece to really get it working and it's all really half baked. I'll share if I ever have a chance to get it into a state that someone else can do something with it!
I am really interested in anything semi-reliable
Great improvement the spanish subtitles! Thanks!
Thank you for the feedback. An Argentinan lady does the translation. My investment for the Spanish community...
@@AndreasSpiess Really? Great! I live in Buenos Aires (Argentina)
The HC-SR501 and HC-SR505 are not using the AM312. The AM312 is a complete digital sensor, while the HC-xxx use an analog sensor and analog IC next to it.
I want through a similar testing phase a while ago for home automation, included ready made thing as well, like Ikea lamps. In the end the AM312 sensors are the best because of low size and low power consumption. Good video!
What chip do they use instead?
@@AndreasSpiess Pretty generic stuff, it behaves like a transistor with more or less current flowing depending on amount of IR. Then it is processed by a chip, the BISS001 is common in many products and found on the HC-SR501. The '505 uses some similar version, but with more passive components inside.
Te ganaste un suscriptor con este video. Me ayudaste mucho. Muchas gracias. Saludos desde Argentina.
Welcome aboard the channel!
to get long range out of any single pixel sensor use a tube about 4cm long that fits over it snugly with a 2mm pin placed vertacally true it at about the middle of the tube. it wil have an smal FOW but very long range
I have found out that acorrding to Schematics of HC-SR501 and HC-SR505 uses same LDO! The Holtek HT7133-1 which converts 24Volts Max to 3.3Volts so I removed it and made a Bridge with VIN and VOUT and removed the Zener Diode in series with the VIN of HC-SR-501 and and Bridged the connection and Yess It Works with 3.3Volts now. It is the same as HC-SR-505 but you dont have to remove any Zener Diode cause simply there is none on HC-SR-505. This is my happy IoT gift to everyone. Enjoy and keep Making things!
Thank you for the info!
I have a pair SR505's on my bench, with a 18650. want to light some LED's like a simple room light.
I have a string of those micro LED's that run on 3 AA batteries but they work fine direct on one 18650.
looking to remove the voltage regulator. watching now to see your trick at the end.
----------------------
The SR505 has a HT7133 voltage regulator, since it can take up to 26v that seems to be a good choice.
I was thinking of just removing it for my use.
I need to run a string of white LED's, no more than 10.
For initial testing, I will simply use a phone charger for 5v and a 1N4148 to drop the voltage.
My current is not very high (5 LED's for testing) so this should work.
The project is under cabinet lighting so duration is not very important and longer is better.
if all goes well, then a micro to fade up and down the LED's will be a future upgrade.
Maybe you can do my trick also on the 505. I did not try.
@@AndreasSpiess : it is almost 4:00 AM here in the States...
I do plan on trying your trick.
I watched this video within 13 minutes of your post and my thumbs up was #63.
now, a few minutes later it is almost 300 !
Very informative as usual
Glad you think so!
Excellent, well presented, interesting subject. Well done.
Thank you for your kind words!
What a superb pleasant vid to watch (even though i'm not so electrician guy). Please do review sometimes with BS612, or is it too unreliable? can't see clear from spec sheet. maybe you could help me what this chip is in par with? or just the worst of them all, cheers
I have no plans to test PIR sensors soon :-(
@@AndreasSpiess ah nevermind good sir, just need to know where this type segment is, i think its the low end segment..
Thank you Andreas. 2 Questions I'm looking for an answer: 1) how to overcome sporadic/false alarms ? 2) sensor which are 3.3v, can't we use a 5v pin as most MCU's have ?
You always have to consult the datasheet before you connect a sensor. But most of them can go with 5 volts.
False alarms can be triggered by unstable poweer as mentioned and also if you have an ESP close to it because it emits RF energy
Regarding the false alarms. What about deploying a bunch of sensors and let the majority decide? As Andreas mentioned, they are extremely cheap and when you have enough sensors spreaded across an area you could feed a neuronal network to learn a persons exact location.
I have a few HC-SR501s and they randomly trigger themselves. Even when inside a drawer! Girlfriend was not impressed when the front door light goes on and off all night. Gonna buy a more expensive one, like the Panasonic one from your video.
Are they close to a ESP?
@@AndreasSpiess It's being powered by a RPi4. It's about 3cm away from the board, but located at the opposite end from the antenna. RPi is running Motion Eye. When in the drawer, it was much further and still randomly triggering. Could've been a bad batch.
Thank you Andreas just got 2 shields with your link :) hopping you got some commission
Regarding HC-SR501:
- Many 3.3V boards have a 5V power supply, like ESP8266 boards. This sensor can be powered with 5V but still has 3.3V output, i.e. fully compatible
- Most versions have a jumper to select single or continuous triggering, i.e. if motion is constant, the output stays constant in the continuous mode
- I've hade some problems with false triggering but have found that this is completely removed if the sensor is not too near the ESP and a 1000uF capacitor is added between 5V and GND at the sensor side.
- And regarding false triggering, in some projects I'm using 2 or 3 sensors of this type. I then get a better coverage of a certain area and I can add logic to e.g. require at least 2 triggered sensors to further avoid false alarms.
Of course, you can use 5 volts for mains operated projects. For battery-operated projects, I do not use 5 volts to save a lot of energy. Unfortunately, the "continuous mode does not resolve the minimal trigger time of 8 seconds. And you are of course right. Do not place sensitive devices too close to an RF source. Adding more than one sensor is a good idea to prevent false alarms, also a radar sensor that detects different signals can help.
@@AndreasSpiess Most modules state 0.3s to 5 minutes, depending on the adjustment. I can adjust my modules to less than 1s at least but there is some variation. For alarm purposes this is sufficent.
Gracias por tu grandioso aporte
De nada
Nice video,
I can confirm that hc-sr501 can Work on 3,3v by removing the regulator. I have used it to turn on the light in my bathroom, but I droppede it because of false trigs. I think its the flor heating that fools the module. I have replaced it by an Ikea motion sensor, this sensor is working perfekt, not sure which sensor onside.
I even learned a better trick for 3.3 volts: A viwer suggested to use one of the three jumper pins. It is connected to the 3.3 volt rail ;-)
@@AndreasSpiess does that not apply 3,3v on the regulator output? If yes is that advisable?
Awesome! I have see a PIR N219S in a China product ( tell < 90 pA but I don`t find datasheet ).
Best regards
Where did you find the N219S? I do not get reasonable hits in Google.
In a China shop , I don´t find in google either. I can not put on a photo here...
suggestion, offer some 'lock-down' projects.
I am working on under cabinet lights from a cheap white, LED string that uses 3AA batteries.
future project is to make stair lighting with a PIR at the top and the bottom of the stairs.
I have an old coffee pot with heater and was thinking of making a Sous-Vide maker for one.
I am also trying to get node-red/mosquitto/esp8266 to work on an Ubuntu machine for use with my outdoor garden soil and rain sensors.
Plenty of good ideas! That is how we should use this spare time given us by Corona...
Thanks for all your good work. This is one of my favorite channels; I learn a lot. Any opinion on the Joulescope vs. the Otii? Is there a clear winner?
The OTII has a built-in power supply which makes it easier to use for 3.3 volt boards. The Joulescope is better if you need higher voltages.
@@AndreasSpiess Good point. I think I will go with the Joulescope due to its higher flexibility.
Thank you for explaining:
Excellent video.
One possibility, from my ancient history of PIR sensors is that in order to reset the sensor that initialize with extended reset delay, is to program restart of sensor (initiate sensor power on/off sequence), with timestamp, forcing a log file to be created. "New" active detection time is reduced to 750 ms delay.
But I have not tried this trick with Arduino or Raspberry or ESP boards because I have not investigated how the sensor library is compiled. Voltage interrupt programming sequences are not something I've worked on for over 10 years. In the past, we used simple switch relays. I do not know enough how Arduino handles sensor signal errors.
Helpful video 👍 I like it
Andreas I know nothing about electronics, but you obviously do. 😀
I’ve put up an outdoor battery powered night PIR motion sensor LED light that was purchase new around 18 months ago. I tested it first and was impressed by it. It’s solar powered and all seems great performance. It solar charges and uses 2 sealed 18650 batteries connected to a small board with a round plastic sensor as you show, that ‘looks like’ an EKMC1603111.
Installed it and tested and works great. However it false triggers 30 times each evening. I completely covered the sensor and tested it would not detect, however it still false triggers even covered, so it’s faulty. Which is a shame because otherwise it’s an impressive light for being solar powered, and I hate to just bin in.
The board and sensor doesn’t seem to have any adjustments at all. Is there anything I can ‘simply’ and cheaply do to fix it?
I know you haven’t seen it or even know what it is at all, but is it simply pushing in a replacement sensor and which to use and where to get one? Any advice would be much appreciated. Thank you! 🙂
It would need a lot of analysis to first find the fault and then try to correct it. Just a remark (I do not know where you live): PIR sensors detect heat differences. This is why they do not work in hot environments.
@@AndreasSpiess Thanks Andreas for getting back. Manchester, England, UK. I know it's stupid to ask as I cannot show it or I even tell what it is. I completely covered and enclosed the sensor so it could not be triggered and it still false triggers, and has been doing since installed about 2 months ago. Possibly some internal electronic noise is setting it off. But could that be fixed by replacing the sensor, or board, or both and everything?
The LED light is great and so too the batteries and it appears to charge ok, so a shame to throw it if it can be simply and cheaply fixed. Just I have no idea, but I have got a basic soldering iron. Haha 😆
@@ChrisScott0 BTW: The ESP32's WiFi is known to disturb sensors in its vicinity.
@@AndreasSpiess This light has only a basic motion sensor, it doesn't have WiFi or any adjustments inside or out. It only 'looks like' similar to the sensor you showed. It's outside, but I and all the neighbours have indoor wifi as everybody does.
I wanted to know if you have experience in fixing false triggering battery powered outdoor sensors, and if so what's the fix - in easy simply terminology.
Hi Andreas, I watched your video and I learned some more about PIR sensors. I have a question and hope you can give me an answer.I have a solar lamp with a passive motion sensor. Could I remove it to make it only a solar lamp? if yes, Do I have to connect on the circuit board on the place I removed the PIR a cable from the ground to the neutral to make it work when the sun goes down?
Greetings from Mexico and thank you in advance.
I do not know the wiring of your device. You probably have to do some measurements with a Multimeter before you remove it. Maybe you have to shorten the two wires to get your effect, maybe not.
Hi. Great video.
How did you connect the panasonic PIR to the ESP? Did you connect cables directly from the pins of the PIR to the ESP?
I have a panasonic EKMC1603111, but it does not seem to talk to the d1 mini board. Do I need a circuit board connected, like the am312 have?
I have good experience with am312 sensors, but the range of theese sensors is too low.
Here you see how they connect it: www.digchip.com/datasheets/parts/datasheet/1718/EKMC1603111-pdf.php It does not have a true digital output
Great info as always! Thanks for the detailed review! Really interesting devices and makes me wondering about using for Terahertz spectroscopy and imaging with a few and some fancy software logic. Looks like not quite there in range however, with only the ~8 to 12um... if that usable response. I haven't used in so many years... I forget what frequency range was being used for the density measurements.
I have no knowledge in Terrahertz Spectroscopy :-(
@@AndreasSpiess That's OK! We all learn somehow. I used in the pharma industry to understand name brand extended release products design. en.wikipedia.org/wiki/TeraView
To me, seems like might be more common in the future if systems application use volume increases to bring down price point for more main stream consumer potential apps. For now, plenty of NIR, Vis, UV sensors... including for spectroscopy and imaging for example when the hot lens is removed.
I came across this video in search of a way to fix the false positives with the AM312 motion detectors. Put the 2 capacitors in place and it works perfectly now. What happens if I want to add multiple AM312 to my MCU? Do I need multiple 10uF? Or can all of the AM312 work off of the same capacitor? I believe that I would need a 1uF capacitor for each AM312 output..
I would not combine capacitors and use multiple. They are not expensive.
@@AndreasSpiess thank you for the reply! I guess I was not concerned about the costs here but more around keeping the circuit simple and minimizing the number of components.
Hey Andreas, you already have few videos about PIR sensor but seems you never reviewed SR602, which is present on AliExpress as well and performs very well with my ESP 8266 projects, don't remember I had any false alarms with them for example. I'm not sure if they are based on AM312 or it is different sensor inside, I couldn't find such information. Did you ever try to compare AM312 with SR602?
So far I do not have a SR602. Thanks for the tip!
Hi Andreas, how did you hook up the panasonic one? you hook it up directly to a gpio or did you used some opamp or a pir chip? if you hook it up directly, you used the analog or digital gpio?
Edit:now i've checked the the datasheet and it seems those pirs are digital ones so i guess no amp it's needed
No amp needed. But maybe a pullup or pulldown. I do not remember
have a problem in tasmota configration and i need help plz...
i have sonoff basic r2 changed it to tasmota and i attach physical switch to RX (gpio03) and PIR sensor to Gpio14
and i defiend pir sensor as switch
put i want pir didnt control the relay direct...
so i apply command setoption114 .. that detach all switches from relay but it detach also my switch (gpio03 RX)
and that make problem that when sonoff didnt connect to HA i cant controlr relay from the physical switch
any way to make switch automatic control realy and only detach pir and expose its signal to HA so i can make automation from it.....
Unfortunately, I am no Tasmota specialist. I do my complex automation in Node-Red or HA and use Tasmota only as a sensor or actuator (as you mention at the end of your comment). Since I use HA, I anyway completely changed to ESPHome...
I live in both Florida and Viet Nam. The high temp. often cause false triggers. What else could I use?
I looked into the lasers used on automatic garage door openers but there expensive. (but no false triggers)
I will be testing the ultra sonic next.
I want it for use with an Alarm/pizo horn for intruder. And to trigger cameras to start recording.
The PIR is a big failure for these applications. Even a cloud passing by on a sunny day will cause the PIR to trigger.\
Any Ideas on what you might think would work better?
Intruder alarm is very difficult. Even expensive cameras with millions of pixels create false alarm. So I cannot help :-(
Andreas, thanks for posting a great video. I not an electronic engineer, but got inspired to try the panasonic pir (EKMC1603112
) with nodemcu esp8266 (Amica) chip. But the sensor is always returning high status on output. Checking online it seems I need to add a pulldown resistor to the output of the pir. I am no idea to figure out which which resistor to put in.. Some people say 10k and some 100k.. Could you help me with this? From the datasheet of panasonic pir "Please select an output resistor (pull-down concept) in accordance with VOUT so that the output current is maximum 100μA." I plan to power using 3.3v from nodemcu, Average current consumption of the sensor is (I-w) 170μA, Max Output Current (I-out) is 100μA, Min Output voltage is 3.3v-0.5v=2.8v. Thank you!
Just try the sensor with different resistors without ESP first. If it works, try to connect it to the ESP. Maybe you have to reduce the resistor then.
which are better outside in the rain? PIR or Beam breaks? Looking for a trigger when someone drives through a gate. Any thoughts?
PIR sensors do not like heat and sun. Many viewers, particularly in warmer countries complained about them for outdoors usage. I do not know how they behave in heavy rain, too. Radars sould work in both situation. But you have to try.
A another great video. A bit off topic, could the PIR be modified so sensitivity/time could be adjusted with an Arduino?
Sensitivity: No. Tming: Yes
@@AndreasSpiess Is that with replacing the RC circuit connected to pin 8 (RESET) with a digital pin from Arduino ?
Hello! I got a question about PIR sensors. Can they detect a person sitting a desk only moving his hands by typing on a keyboard or moving his computer mouse? What i mean is normal behaviour of a person sitting by a desk. Very still and small movements. Range would be like up to 5 meters. Thanks in advance! (even if this was released 3 years ago)
I do not think so. The movement has to be bigger.
Great Video. Is it possible to detect direction of travel with a single PIR sensor?
I do not think so. It only detects temperature differences.
Temperature compensation is key in the 90-95f range, and dual pirs sensor elements may be wired as opposite inputs to a differential amplifier. This is done in alarm grade, do these have these features?
I do not know, and I am not sure if they publish everything in their datasheets. They write something about temperature compensation. Here where I live, for the next few years they still run ;-)
Thank you.
You're welcome!
Спасибо за полезную информацию. Thank you for useful info.
You are welcome!
Thanks for this video Andreas, it came really handy, I've been looking for good PIR sensors, did you know about the Murata IRA-S210ST01? Also your circuit to reduce the false alarms, what are recomended values for the coils? Thanks!
No, I do not know the Murata sensor. I ordered now a few. Thank you!
And the values for the coils in your circuit? Thanks
Thank You
You're welcome
Sehr interessant. Danke.
Bitte, gern geschehen!
Hello Andreas!
Thank you for the comparison 👍 It would be interesting to have a pir sensor which could be triggered by humans and not by cats, but the temperature difference is very small between them. Cat's operating temperature seems to be about a few degrees higher than human 😉
Otherwise pir switched lights like in the carport or hall makes no sense for me.
Detection depends on beam WIDTH and length . Unless your cat is over 1m in height then it is only a matter of placement, orientation and selecting beam length/sensitivity.
Maybe a reduced sensitivity would help?
You could try experimenting with a plastic tube in front of the sensor, that way it would not see anything on the ground,
Hot cat = no problem
I want to make a automatic opening sliding door, what sensor should I opt for?
I do not know. I would first start with the requirements and then start to search and to experiment.
I have a perimeter alert system that uses wireless motion sensors. The motion sensors have failed one by one over time and new ones not available. How Can I make another motion sensor become compatible with my system?
I do not know because I do not know your devices nor your situation :-(
Hi Andreas, I tried the Panasonic EKMC1603111 Sensor but I could not get it to work with a WEMOS D1 Mini and Tasmota. As requested by Panasonic I tried a pull-down resistor around 100k between ground and the output on different pins, I tried D8 Pin which should have a pull-down onboard but everytime I connect a PaPir to a WEMOS, the WEMOS gets practically unusable. How did you connect it to the Arduino and get it to work? Greetings
I would not trust the internal pull-down and use also different pins. Did you try the sensor without the D1?
@@AndreasSpiess No, I haven't tried the Sensor without the D1. I bought 4 of them just to make sure to have a working one because I am cursed with ghost triggers of the HC-SR501 Sensors. So you say I should give the PaPir a 5v source and measure the voltage of the output pin or is there another method?
Just look into the datasheet.
I tried to wire two am312 sensors together to increase the viewing angle. I had both sensors share the vin, gnd, and out but it did not work. I am assuming they can't share the out. I tried to use diodes to stop the out from going into the other sensor but that didn't work either. Why can they not share the out? Is there an easy way to make them share the out pin? Thanks. P.S. I have them connected to and esp32 sharing pin 4 for the out and using the vin and gnd on the esp32. I monitor the results in home assistant.
The easiest way would be to connect them to two pins. Otherwise you have to create the right logic. I do not remember if they are low or high active. You can google how this is done.
@@AndreasSpiess Thanks for the quick reply. I believe they pull high. But I think I will take your advice and just run two pins at least this way I will know which direction the movement is coming from.
Im getting a lot of false positives for the Panasonic, do you have a wiring diagram? Did you use resistors?
I would use wire your sensor according the datasheet.
Do the Panasonics work directly interfaced with gpio pins of raspberry pi?
It should work when you use a pull-up resistor to 3.3 volts. See the datasheet.
Take those bare sensor ones that made bad thermal cameras and use one of them to make an IR spectrometer or temperature, with the aid of some form of collimation or lensing.
I already once built a bad thermal camera. That is enough for me ;-) I have a FLIR which works ok.
Can you show us how you connected the panasonic sensors with the microcontroller because when I connected it with esp32 it doesn't respond at all, so do I have connect some additional devices like capacitor, or resistor or or I can directly connect it with the microcontroller, but when directly connect the vcc ,gnd and out pin mine is not responding so please help me with this
Maybe you do your measurements to decide where the problem is. First: Sensor alone. Second: Connected to the ESP32. Third read by your sketch. And always read the datasheet for your particular sensor.
Hello Thanks for the Video. I used the HC-SR501 with ESPhome and an ESP32 but it keeps triggering false. detects motion when theres no motion. tried two of them and even tried with a d1 mini. i got the same result. false triggers. Any idea what the issue might be?
Maybe they are influenced by the Wi-Fi of the ESP. Either you try to switch the radio off, try it with an Arduino or STM32, or add a distance between the sensor and the ESP.
Keep in mind: They do not detect motion, they detect temperature differences. So If the sun heats something up it could also trigger.
@@AndreasSpiess Thanks a lot. So would you say the Am312 is the best motion sensor ? Trying to build a multisensor device for my home automation. Will contain, temperature, motion, sound and light. What motion sensor do you recommend for such project? I stay on a tropical region and it gets very humid.
Hi Andreas, ESP8266 is declared 5V tolerant, so you could use a sensor with 5V output without modification
But usually you have no 5 volts in low power ESP applications because you want to avoid the LDO
Can you tell me how you connected the panasonic pir sensor with the microcontroller please ....
You have to read the data sheet for your particular sensor.
@@AndreasSpiess Sir I did but mine is still not responding I don't know whether it is a faulty product or what, Or do I have to connect some capacitors or inductors as you as shown in the video. I have no idea How to do it, so please just tell me how you connected your EKMC1603111 with your microcontroller.
Just test it without microcontroller first.
Thank you, great video. I was wondering if someone could exmplain what is the impact of the capacitor on the pir output line? sorry I am a complete novice, i understand using one across Vin and ground to ensure it has the power it needs but don't understand what it does to the signal. (still saving up for an osciliscope ;)).
Capacitors "short-circuit" higher frequencies, and noise is on higher frequencies. So it does not get to your Arduino.
Global warming is revealing a weakness in outdoor PIR sensors. During last summer, our outdoor PIR sensors stopped working. At first I thought the heat had damaged the sensors, but this was not the case, ambient temperatures in the UK had reached blood heat and our sensors could no longer distinguish between the background and body heat. On some days the sensors started working again, this was when human targets actually shadowed the warmer background. Now I have plans to to use radar modules in parallel with the PIR sensors.
With regard to the range of the PIR sensors, this is not the whole story as most sensors tradeoff range for angle of sensitivity, a bit like LEDs. More range usually means a smaller angular range of detection. With regard to 3.3 volt and 5 volt operation, I really do not understand the difficulty, as it always possible to insert an open collector/drain level shifting transistor. I tend to buffer my processor projects this way, as I like my active sensor state to be zero volts. The advantage is that it is far easier to protect the processor inputs from noise spikes and in all systems ground zero volts is a common voltage shared by all parts of a system, even if different elements of the circuit run from different supply voltages, such as 12, 5 or 3.3 volts. There is also a logical argument that using pull-up resistors in the receiver and open collector pull down in the driver makes the circuit fail safe. It also means that sensor on "long wires" can be connected safely, without concerns of latch-up due to the sequencing of supplies. It is one of the reasons I like CAN BUS drivers.
The problem with 5 volt is not the logic level, it is the power. The sensors do not run on a LiFePo battery or a discharged Li-Ion battery because the diode and the LDO remove roughly 1 volt. No problem for mains operated devices, but a problem for battery operated 3.3 volt devices.
@@AndreasSpiess I must say I am not a great fan of battery operated sensors, largely because at some stage the batteries need to be recharged, but I accept that in some circumstances battery power is the only solution. Not so much of a problem where solar power is used to avoid the chore of rechanging or replacing the batteries. There is always the option to run more cells in series to provide a higher supply voltage.
One of the problems with lithium battery technology is the shape of the voltage discharge curve, with the need to accept the significant drop in terminal voltage if maximum energy is to be extracted from the battery. In very low power applications even the loses of voltage regulation are significant, then it becomes a matter of matching the useful battery terminal voltage range to the electronics, though TI make some ultra low power, low voltage drop, linear regulators.
Maybe there is some research to be done on optimising the efficiency of switch mode, up converters regulators, operating in discontinuous mode.
Witch one does the xiaomi device use that is shortly used in your video? I have a few of those (zigbee) and I'm very impressed with their performance and battery life.
I never disassembled one :-( But I am pleased with them, too.