# Imptroving PIR Sensor response when feeding Arduino

**URL:** <https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135>\
**Category:** General Guidance\
**Created:** [April 30, 2026, 1:38pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135 "2026-04-30T13:38:30Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![albieb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/albieb/32/1126592_2.png) [@albieb](https://forum.arduino.cc/u/albieb)\
**Post date:** [April 30, 2026, 1:38pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/1 "2026-04-30T13:38:30Z")

</div>

Hi guys. I have an auto-sense doorbell project using a common or garden HC-SR501 PIR Motion Detector feeding my own custom electronics control unit. This works absolutely fine except for one thing. It is susceptible to other non-visitor events as is common in these projects.

These include a light going on in nearby areas inside the house at night reflecting outside and being picked up, or our nearby (necessarily near) boiler switching on and presumably producing an interference pulse. It is also sensitive to boiler flue venting from our neighbour if the wind is right.

The whole existing installation has been optimised physically to prevent this as much as possible but with the cheap little PIR unit it is difficult to eradicate it. The PSU is bespoke external non-digital and heavily regulated on the PCB. The outdoor bell switch and PIR enclosure and the wiring path through the wall to the internal enclosure is screened with steel sheet and tube and grounded correctly independent of the PCB electronics. They do come together at a single selected point but are a separate screen earth and signal ground for most of their workings.

I am proposing (as in going to do) a change to an Arduino based approach where response to such single random events could possibly be ruled out. If someone is coming to the door, they will be detected and, with the PIR in Retriggerable mode, they will generate a stream of pulses. By counting the pulses up to a set amount then triggering on that total having been reached I should rule out the light switching and boiler pulses from the equation.

The electronics and base coding are easy, (day job), but I just wondered if there was any advice on features to implement or perhaps wrinkles in the method to make this process more reliable. Can anyone offer any advice which may help me in this?

---

<div class="post-metadata">

**Author:** ![loveforcircuits](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/loveforcircuits/32/1127286_2.png) [@loveforcircuits](https://forum.arduino.cc/u/loveforcircuits)\
**Post date:** [April 30, 2026, 2:06pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/2 "2026-04-30T14:06:59Z")

</div>

Instead of just counting pulses, define a sliding time window.  
For example: Trigger only if \>=N pulses occur within T seconds  
Typical starting point: N = 3–5 pulses within 5–10 seconds  
This avoids cases where random events accumulate slowly and falsely trigger. A real visitor pauses briefly and resets your counter.

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [April 30, 2026, 2:26pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/3 "2026-04-30T14:26:14Z")

</div>

Posting schematics would help us find eventual electrical weak points.

---

<div class="post-metadata">

**Author:** ![albieb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/albieb/32/1126592_2.png) [@albieb](https://forum.arduino.cc/u/albieb)\
**Post date:** [April 30, 2026, 2:44pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/4 "2026-04-30T14:44:24Z")

</div>

Thanks for your thoughts LoveForCircuits, you've fleshed out that side of it clearly. I had envisaged the need for some sort of time based reset system just as you described but with no details.

Each positive detection should be followed by a short time delay between it and the next hit, say 0.25sec or so. At the same time the first positive detection defines the starting point of a window and starts the count process. If no more or not enough positives occur within that set time frame then reset to 0.

There should also be a predefined hold off time once the bell has been rung to prevent it from ringing constantly while you deal with someone on the doorstep who would be constantly detected.

If it's of interest I'll post the schematics of the current version Railroader. I'll tidy things up and get that on here.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [April 30, 2026, 2:52pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/5 "2026-04-30T14:52:39Z")

</div>

The HC-SR501 does have the two adjustments that will allow sensing multiple triggers over a time period, but why do you think at least some of those extraneous events will not still qualify.  
If the existig ubit is NOT missing any of the desired events, why not gate that sensor with another human presence sensor like any of the radar units. I find the radar units to be a little too log range, but by combining the outputs I think you will not miss any of what you want and also not get any false positives.  
There are many but here is the first I found on [Canadian Amazon](https://www.amazon.ca/LD2410C-HLK-LD2410-Presence-Millimeter-Contact/dp/B0F939YGLG/ref=sr_1_1_sspa) NOTE this is not the one I used, this is more modern. I used the RCWL-0516 and there are others.

---

<div class="post-metadata">

**Author:** ![albieb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/albieb/32/1126592_2.png) [@albieb](https://forum.arduino.cc/u/albieb)\
**Post date:** [April 30, 2026, 3:16pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/6 "2026-04-30T15:16:52Z")

</div>

This is the sort of thing I have in place at the moment. It's fairly generic.

 ![Test_Dual555_Doorbell](https://europe1.discourse-cdn.com/arduino/original/4X/e/e/3/ee35ec5c22d1c15bc378241ccda79ba98a21ce25.jpeg)

There is a separate Tx/Rectifier/Cap box a couple of feet away from the control enclosure. This feeds the enclosure for the circuitry which is fitted in the house inside a wall mounted box directly behind the bell push/PIR box outside. The wiring between the two comes directly through the wall through a strong steel 10mm pipe. All the screening metalwork is welded together and the earthing of that assembly is handled within the PSU enclosure not the control unit. The active circuitry has its own signal ground which is connected to the screening only within the PSU enclosure. I haven't shown that side of things in the schematic.

I will also stress that this is a fun project, not anything commercial. It was started because I get **INFURIATED** with couriers who take back deliveries because they don't seem to have the strength to push a doorbell or rap on the door knocker to get a response. They seem to have knuckles of lambswool which make no real sound on a plastic moulded front door but that is all they can manage and all they apparently think is necessary.

This happens frequently where we live, and we are in a very small terraced house so are just inside the door. It is endemic in the UK where couriers simply refuse to use a knocker or bell. Even dropping it on the doorstep and immediately running is not prevented by a simple ring on the doorbell to indicate to anyone inside the parcel is outside - - in plain sight to anyone passing - - and I live in a "less than affluent" location.

(Rant over. Sorry. 😁 )

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [April 30, 2026, 4:10pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/7 "2026-04-30T16:10:01Z")

</div>

- An Arduino in this project will greatly simplify and adds capabilities that dedicated hardware cannot.

- An Arduino Pro-Mini or an ESP32 controller should work, the ESP (a bit more difficult to grasp) could serve a local WEB page.

- The @sonofcy link looks great 👍

---

<div class="post-metadata">

**Author:** ![albieb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/albieb/32/1126592_2.png) [@albieb](https://forum.arduino.cc/u/albieb)\
**Post date:** [April 30, 2026, 4:26pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/8 "2026-04-30T16:26:27Z")

</div>

Hi Sonofcy. I'm not thinking of trying to catch every trigger event in the sense of pulses, only what is necessary to identify the real event itself. I think we would have more pulses to work with than we needed in any real situation. As I'm seeing it the issue is making the setup less sensitive not more, i.e. only responding to more stringently filtered responses or combinations of responses.

The real event we are considering is someone walking up to the door in order to request an audience or to leave something there. We actually want to reject everything other than that. I should have mentioned that I have the PIR sensor sensitivity adjustment backed right off in order to only detect over a small area in front of the door. We live with a very short front path onto the local pavement. It still takes a second or two to walk to the door across that area which should be enough for accuracy.

Your idea of augmenting the setup with a different type of detector is a good one. I hadn't considered that. That would certainly give a lot more flexibility and reliability of response. I've looked at your own which you posted and am surprised to find it as a simple standalone PCB unit, sort of plug and playish. It should be very easy to incorporate and I'll be trying that.

My view of the way to go from here is to set up a new Arduino based unit on a new bespoke PCB as that will simply take in more than enough inputs and respond with a good number of outputs. There is only one essential output needed, the relay switch to trigger the real life bell. Others are merely for LED status indicators. So once that one is laid down on a PCB with a few generic output options, a number of inputs could be made available for generic sensing. The rest is down to the programming which should be fairly easy.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [April 30, 2026, 4:33pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/9 "2026-04-30T16:33:19Z")

</div>

I live in an apartment with those ubiquitis admit code devices. Some couriers are so lazy they just see it and mark the package unable to deliver. Not so bad when they re-route it to a local drop off, but a real PIA if it is returned to sender.

I didn't study your schematic, but if you want to involve an Arduino or ESP32 (SEEED XIAO are about thumb nail size) you could add a camera and a web site, the PIR,  
Human Presense/RADAR/Milliwave and even text to phone (I think pushover would work)

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [April 30, 2026, 4:35pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/10 "2026-04-30T16:35:40Z")

</div>

I think maybe I didn't explain it well. Since you are getting false positives, the human presence sensor (HPS) will NOT get those false positives so if you only check the PIR after the HPS triggers the PIR will never see those false signals.

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [April 30, 2026, 4:38pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/11 "2026-04-30T16:38:00Z")

</div>

Sine you are using an Arduino…

I have recently had very good results with the TOF measurement devices like this one:

> **[Adafruit VL53L0X Time of Flight Distance Sensor - ~30 to 1000mm](https://www.adafruit.com/product/3317)**
>
> The VL53L0X is a Time of Flight distance sensor like no other you've used! The sensor contains a very tiny invisible laser source, and a matching sensor. The VL53L0X can detect ...

I was skeptical at best but example code worked out of the box and my own use was straightforward.

One here now is the best cat detector I've made so far.

a7

---

<div class="post-metadata">

**Author:** ![albieb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/albieb/32/1126592_2.png) [@albieb](https://forum.arduino.cc/u/albieb)\
**Post date:** [April 30, 2026, 4:39pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/12 "2026-04-30T16:39:31Z")

</div>

Aaaaaah! The penny drops. It's true what the Chinese say, "a moment of embarrassment is better than a lifetime of ignorance." Great idea, thanks for the clarification. Simpler to programme too.

---

<div class="post-metadata">

**Author:** ![albieb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/albieb/32/1126592_2.png) [@albieb](https://forum.arduino.cc/u/albieb)\
**Post date:** [April 30, 2026, 4:42pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/13 "2026-04-30T16:42:02Z")

</div>

Hahaha! The first thing I thought when I read your post and saw laser source was - Cat "Detector"? Does that device lend itself to power upgrades? Another option to definitely look into, thanks for the heads up.

---

<div class="post-metadata">

**Author:** ![tigger](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tigger/32/1104210_2.png) [@tigger](https://forum.arduino.cc/u/tigger)\
**Post date:** [April 30, 2026, 4:49pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/14 "2026-04-30T16:49:03Z")

</div>

Be aware that the HC-SR 501 with BIS1000? chip has a built in delay of about 1 second after it is activated  
Best seen on a scope.  
The bare PIR module plus Arduino gives you full control over timing.  
As mentioned, dual technology can eliminate false triggering, microwave and PIR are commonly combined.  
Look at the PIR (Murata) datasheet for best practice.  
Boiler flues can be a pain as are hedgehogs and neighbours cats.  
Maybe set up dual PIRs spaced apart?  
Commercial (Steinel) PIR light controllers seen to be fairly immune to false triggering.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 27, 2026, 4:49pm UTC](https://forum.arduino.cc/t/imptroving-pir-sensor-response-when-feeding-arduino/1442135/15 "2026-10-27T16:49:34Z")

</div>

Closed on October 27, 2026, 4:49pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
