D1 Mini + 12V PIR from old alarm system

Hi!

Is there a simple way to make an old PIR motion detector “smartified”. It seems to be 4 wires to the old PIR. Please point me in the right direction.

Supply the PIR with 12V and GND. Connect the PIR C alarm contact to the D1 Mini GND. Connect the PIR NC alarm contact to a GPIO. Enable pullups for the GPIO input.

These devices usually have a NC tamper contact as well. If you want to enable it you can connect it in series with the alarm contact.

4 Likes

Thanks! I’ll give it a try when I have some time! :slight_smile:

I am using Konnected for this. Advantage is that it more or less works out of the box and the board has easy screw connections for your PIR and also for siren or lamp.
The main disadvantage is that it relies on Home Assistant to generate an alarm.
With every HA update you risk losing your alarm functionality, this happened 2-3 times to me.
I am considering to build or buy? a standalone ESP32 solution with MQTT.
Less depending on HA.

@zamb
Did you ever make something

No time yet (or other things more prioritized…). But in theory I have it working… :smile:

I know this is an old thread, but I just wanted to report that @tom_l 's instructions worked for me. I now have 3 old motion detectors (and a bunch of door sensors) working off an ESP board. Konnected looked nice, but very expensive in comparison to a cheap 12V power supply and an ESP8266/ESP32.

Here’s an example from the ESPHome config in case it helps others:

binary_sensor:
  - platform: gpio
    pin:
      number: 23
      mode:
        input: true
        pullup: true
        output: false
        open_drain: false
        pulldown: false
      inverted: false
    name: "Living Room Motion"
    device_class: motion
    filters: 
      - delayed_off: 6s
4 Likes

Wouldn’t the 12V signal from the PIR burn out the GPIO?

I was trying this and being new to HA am appearing to fail badly in understanding things.

Did you get multiple sensors connected to the one ESP32? I have eight I need to get connected and so far I managed to get random “working” and detects motion then instantly switches to no motion, then seems to not work for a while, if at all again.

Your code is very different though, I got this to use from somewhere as an example:

binary_sensor:
  - platform: gpio
    pin:
      number: 13
      mode: INPUT_PULLDOWN
    name: "Bathroom Ceiling PIR"
    device_class: motion

Essentially what I need is very basic, just a way to see the motion from old PIRs that are powered from a 12V supply.

I had them wirking in Homeseer via an Arduino and prior to that on an ancient Homevision but I rely on them heavily with most being 360˚ ones that detect motion brilliantly.

8 PIRs shouldn’t be problem for Esp32 board, but it all depends on your PIR output/wiring.

I’m not so sure exactly but they are bog standard alarm PIRs.

All powered from one 12V supply and on the Arduino I have one common for all the sensors then each one (I assume) a live 5V onto an individual pin for each sensor. So far as I am aware that’s a very common arrangement for alarm PIRs.

It’d be brilliant if I could use the ESP32 in the same sorta way, solves a lot of problems for me.

If that assumption is correct (do check it) then the sensors supply 5V when clear and open circuit when movement is detected. So this config:

Is almost correct. Try:

binary_sensor:
  - platform: gpio
    pin:
      number: 13
      mode: 
        input: true
        pullup: false
        pulldown: true
    name: "Bathroom Ceiling PIR"
    device_class: motion