Connecting an old wired PIR to ESPHome

Hi,

I have recently taken on my first ESP32 and ESPHome project. I have an old security system installed in my house, where most of the hardware was removed before I purchased the property. What was left was 14 cables terminating in my utility cupboard. This includes 8 PIR sensors, 3 Door contact sensors, an entryway keypad, an internal audio alarm and an external audio and visual alarm.

The system was originally powered by a cable with 6 cores, color-coded as black, red, white, green, blue and yellow.

The PIR sensors are connected as follows:
+: Red
-: Black
C: White
NC: Green
T: Blue
T: Yellow

My thinking was, I install a 60w 12V5A power supply in the utility cupboard and use this to power all of the devices with 12V power. I then have a 5V regulator connected which powers the ESP32.

I have successfully installed ESPHome, and flashed my ESP32 with a YAML file that means it appears within Home Assistant.

I can get a motion sensor to show in Home Assistant, and to flick between Clear and Detected when I connect a wire to GPIO4 and switch it between 3.3v and GND. This meant the ESP32 is working as expected.

What I am having issues with it getting the PIR sensor to output a singnal from its C or NC connection that the ESP32 can recognise. The PIR is Normally Closed (which I verify using the continuity setting on my multimeter, it beeps when no motion is detected, and doesn’t when motion is detected).

The PIR is the Honeywell IS-215QT (chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.sourcesecurity.com/datasheets/honeywell-security-is-215tq/co-2173-ga/is2125tqdatasheet.pdf)

The label shows - and + as 12 VDC 10mA, the C and NC as 16VDC 90mA and the Tamper as 30 VDC 0.5A.

I have tried changing between INPUT_PULLUP and INPUT_PULLDOWN without success, and am assuming it is my lack of understanding of electronics meaning I am not clear on what connects to what. I have tried resistors between the C and GPIO 4 to take the Voltage down to 3.3V, but this hasn’t helped.

Please see my rudementary diagram below. I am actually now using an ESP32-C3-MINI, not a C6.

Any help or advice would be appreciated. I am completely new to electronics, so my knowledge is limited.

C to the ESP ground.

NC to the GPIO.

Enable pullups.

1 Like

Thanks for the quick response, I have now tried this.

The sensor in Home Assistant is now switching between Clear and Detected multiple time (20ish) a second, regardless of if motion is detected or not. This continues even if the PIR sensor is not powered, but the ESP32 is (via USB).

The

Then either you have wired it incorrectly or you have a lot of electrical noise induced onto your cabling. Try a 0.1uF capacitor from the GPIO to ground as well.

Thanks for you reply. I have double checked my wiring and all seems as you said. I only have resistors at present, but have some capacitors arriving tomorrow, so will try then.

Post your yaml.
Sounds like you don’t have pullups set.
Also, you can use esphome sensor filters to eliminate noise.

1 Like

Though it is better to eliminate it.

1 Like

Of course.
Also we don’t know anything about the physical wiring.

1 Like

Here is my YAML.

binary_sensor:

  • platform: gpio
    pin:
    number: GPIO4
    mode: INPUT_PULLUP
    name: “PIR Motion Sensor”
    device_class: motion

Unfortunately I don’t have much experience with ESPHome yet, so not sure how to use sensor filters to eliminate noise.

Happy to post a picture of my wiring if that would help troubleshoot the issues.

If you don’t use code tags, no-one can tell if your indentations are correct’


binary_sensor:
  - platform: gpio
    pin:
      number: GPIO4
      mode:
        input: true
        pullup: true
    name: “PIR Motion Sensor”
    device_class: motion
    filters:
      - delayed_on: 10ms
1 Like

I will test your code.

typbinary_sensor:
  - platform: gpio
    pin:
      number: GPIO4
      mode: INPUT_PULLUP
    name: "PIR Motion Sensor"
    device_class: motion