Alarm diy with arduino

I would like to build my own alarm with one arduino and some door contacts .
Door contacts can be hack easily by shunting the 2 wires .
I read some articles where they add 2 resistors.
I thing one resistor is in series with the door contact, the 2nd resistor is in parallel with the 2 first components.

Does someone has already use that kind of circuit?
Can you share some of your experiment?

Possibly something like below. You will need to use an analog input (A1 in the example).


When the door is closed, the switch is open and the voltage is 2.5V.
When the door is open, the switch is closed and the voltage is 0V.

Bypassing the switch will result in 0V and hence the system thinking that the door is open.

Many thx , I understand now.
Since you seems to have good knowledge in alarm systems,Just 3 more advises

1- what kind of ILS (door contact) do I need, I think 3 wires with normally open and normally closed ? Please confirm or share an internet link
2- if I want to create a zone with several ILS (door contacts in parallel) can I put the ILS(S) in parallel ? If yes I may need two resistors per zone. Please confirm
3- what kind of wires do I need for alarm system ? Can you please share an internet link.

Two extra questions, regarding pir sensors , it is possible to do the same cabling for pir sensor? What kind of pir sensor should I use? Is there normally open and normally closed pir sensors?

Do you know If I can find an ups for arduino if the thief shutdown my electrical network?


None, whatsoever :slight_smile: I remembered something from a magazine from before Y2K.


  1. No idea; what type of options are there? You only need two wires (gnd and signal) as shown in the image. I think that in my house they have used reed contacts for the switches and magnets.
  2. In theory one zone requires just R1 and R2 and multiple switches can be connected.
  3. For the signals, any type of cable with two conductors should do.

Be aware that long wires might pick up noise and can trigger false alarms.

Regarding the PIR sensor, the answer is probably that the above will not work without additional components; the reason is that the output of a PIR sensor (to my knowledge) can drive both HIGH and LOW and you will need an open collector output. Below extension to the previous schematic shows the idea; a switch and the transistor in parallel (for one zone).


I would use NC contacts, if a thief cuts a cable the system will detect it. Ups don't have to be difficult. An AC relay with a NO/NC CONTACT can activate a battery via the NC contact if the power is shutdown.

In the schematic in post #2, you can also detect that one tries to temper with the 5V.

But there is a flaw in the schematic in reply #4. If you apply a hard 5V on the emitter of Q1 and the PIR sensor activates, Q1 more than likely dies.

Thx a lot for all
Let me think about all these answers
I will be back to you if needed

One last, about noise with long wires maybe i can add capacitor to reduce noise?

This is / was somewhere on the forum, from memory posted by @dlloyd. The relay is the switch.


Noise is always a problem. Design your system based on CURRENT, not voltage.

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