Reusing old alarm-panel door contacts and PIRs as Hermetry inputs
Hi everyone, sorry if this is the wrong place, I’m pretty new to all of this.
We took over a building that had an old monitored security system. The monitoring contract is cancelled and the panel is being removed, but all the sensors are still in the walls: about 14 magnetic door contacts and 6 motion detectors (PIRs) on the ground floor. Each one has a 4-wire cable going back to the panel closet. Some of the door ones only have 2 wires used.
My idea is to keep the sensors and put an ESP32 in the closet instead of the panel, so I can see in Hermetry which doors are open after hours and get an alarm. I already have one ESP32 sending a temperature to Hermetry over MQTT (copied from the getting started guide), so the sending part works.
What I don’t understand:
- how do I wire a door contact to the ESP32? Is it just a switch?
- the PIRs say 12VDC on the label. Can the ESP32 power them?
- the electrician says there are “resistors at the end of the line” on some of them. What are those for and do I need to remove them?
I measured one door loop with a multimeter: about 2.2k ohms with the door closed, open circuit with the door open.
Following this, we have the same leftover sensors in two of our hotels.
Door contacts are plain reed switches, yes. The PIRs will not run from the ESP32, they need their own 12 V supply. Do you know if the PIR outputs are relay contacts or open collector? It’s usually written on the board inside the cover.
Opened one up. It says “ALARM N.C. RELAY” next to two of the terminals and “TAMPER” next to two others. Model is a DSC LC-100.
Good, then everything is just a dry contact and this is easy. I did almost the same thing for a client’s warehouse a while back.
The 2.2k you measured is the end-of-line (EOL) resistor. The old panel used it to tell “closed” from “wire cut” from “short”. You have two choices:
- Simplest: bypass or ignore it and read each loop as a digital input. Closed door = 2.2k to ground, which with the ESP32 internal pull-up (around 45k) reads as LOW. Open = HIGH. That works, but a cut wire looks exactly like an open door.
- Keep the supervision: read each loop on an ADC pin with a 10k pull-up to 3.3 V. Closed is about 0.6 V, open is 3.3 V, shorted is 0 V. Then you can send a separate
faultvalue.
For 20 loops you will run out of usable ADC pins, so I’d do digital inputs, or add an MCP23017 I2C expander for the inputs.
PIRs: put a 12 V supply in the closet, power the PIRs from it, and wire the N.C. relay contact to an input exactly like a door. Tie the 12 V negative to the ESP32 ground only if you need to, the relay is isolated anyway. The tamper contacts can go to inputs too if you want to know when someone opens a cover.
On the Hermetry side, send each input as 0/1, not true/false, so you get a chart history of it. Something like:
{"door_lobby": 0, "door_dock": 1, "pir_hall": 0, "tamper_any": 0}
Send on every change plus once a minute, so the latest value is fresh. Then an alarm rule like door_dock == 1 on the profile, and a time condition for after hours.
Small add: debounce the reed switches in firmware (20-50 ms) or a slammed door will send three changes in a row.
^ yes. And use GPIO pins that have no boot role, so avoid 0, 2, 12 and 15 for the loops.
Got it working on a test bench with 4 doors and 1 PIR. I went with option 1, digital inputs, and moved one loop off GPIO 12 after the board refused to boot with the door open, which is exactly what you warned about. Sending 0/1 now and the chart looks right. Ordering an MCP23017 for the rest. Thanks all!
- You must be logged in to reply to this topic.
Join the conversation
Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

