Page 1 of 1

Security system upgrade

Posted: 24 May 2019, 22:57
by drako
Hi all,

I would like to upgrade my old 12v wired security system with ESPEasy - NodeMCU that will be controlled with Domoticz. This are my thoughts, any suggestions / advice are welcome.
1 ESPEasy - NodeMCU
2 I need a device to send (arm/disarm) and receive (sabotaged) status from 12v Motion sensors and Door switches. this device could be powered by power supply
3 I think I could use 12v Relays to turn on/off 12v Buzzer and 12v Flashlight, I could power relays by power supply
4 12v Motion sensors (4 wires, 2 power +/- and arm/disarm/sabotaged)
5 Door switches (not tested yet, but maybe I could connect them direcly to NodeMCU)
6 12v Buzzer
7 12v Flashlight
8 I need a device that could be used as a power supply to NodeMCU(from main power and battery), powering sensors, charging battery and optional monitor battery life/charging status.
9 Transformator 220v to 12v
10 12v Battery

Next step will be measure power voltage on arm/sabotage wires, probably it will be 12v, and test door switches by connecting directly to NodeMCU. Update will follow.
If you have any suggestions/advise, please let me know.

Thanks.

Re: Security system upgrade

Posted: 25 May 2019, 04:48
by ThomasB
Don't connect the door/window sensors directly to the MCU's GPIO pins. The long wires (a.k.a. big antennas) can be affected by electrical noise and cause unexpected behavior. And during lightning storms the induced voltages will damage the input pins. Instead, use 10mA-20mA current loops on the sensors that feed the input (LED) side of opto-couplers. The optos' logic output will provide electrical isolation from the demons.

- Thomas

Re: Security system upgrade

Posted: 26 May 2019, 11:13
by drako
ThomasB wrote: 25 May 2019, 04:48 Don't connect the door/window sensors directly to the MCU's GPIO pins. The long wires (a.k.a. big antennas) can be affected by electrical noise and cause unexpected behavior. And during lightning storms the induced voltages will damage the input pins. Instead, use 10mA-20mA current loops on the sensors that feed the input (LED) side of opto-couplers. The optos' logic output will provide electrical isolation from the demons.

- Thomas

Thank you Thomas, what if i use level shifter like this one: https://www.tindie.com/products/ddebeer ... x6-channel
Will it do the job?
Can I use same level shifter to provide power to NodeMCU? If it's possible then it will be nice solution for steps 2,8,9 and 10. I could use the main board of security system for power management (and battery charging) and arm/read/disarm sensors with NodeMCU.
Thanks

Re: Security system upgrade

Posted: 26 May 2019, 18:25
by ThomasB
That level shifter won't solve the problem I mentioned. An opto-isolator will provide the needed isolation as well as logic level shifting.

Here is an example (found by quick google search) of using a optocoupler such as the popular PC817. Use 12V to power the door/window sensor switch that is connected to the left side of the circuit.
Image

- Thomas

Re: Security system upgrade

Posted: 27 May 2019, 22:21
by drako
Thank you Thomas, it is clear now. The main board has one on each zone connector. I am going to dive in en do some shopping to experiment with.

Re: Security system upgrade

Posted: 05 Jun 2019, 22:22
by drako
Hi I am back. I think that I got it all accept PIR sensors. My PIR sensors have 4 wires +/-, alarm and tamper.
So this is a new setup:
Level shifter to power up NodeMCU and relay directly from the old system.
Relay will be used to turning on/off buzzer, flashlight and powering door switches.
Optocoupler to read open/closed status if armed.
But then motion sensors, is it possible to connect them to optocoupler or should I use other transistors for isolation? What I didn't tested yet, is that they are always powered up or not due to tamper switch. (should do that next) Otherwise I could use the same logic as with door sensors providing power though relay to arm sensor. When motion is detected it will send impulse to opto and opto to nodemcu.

Thanks.

Re: Security system upgrade

Posted: 06 Jun 2019, 07:15
by dynamicdave
Here's a link to my PIR motion sensor project.
It might give you some ideas for your application.
I used a cut-down version with the students at my IoT Computer Club.

I powered the PIR unit with 12v that I generated using a 'step-up' converter from the 5v input that feeds the Wemos D1 Mini.

I must admit the project started off just sensing body heat, then grew and grew as you will discover if you read the tutorial.

http://resources-area.co.uk/node-red-fl ... d_grew.pdf

Kind regards from David.

Re: Security system upgrade

Posted: 11 Jun 2019, 22:26
by drako
dynamicdave wrote: 06 Jun 2019, 07:15 Here's a link to my PIR motion sensor project.
It might give you some ideas for your application.
I used a cut-down version with the students at my IoT Computer Club.

I powered the PIR unit with 12v that I generated using a 'step-up' converter from the 5v input that feeds the Wemos D1 Mini.

I must admit the project started off just sensing body heat, then grew and grew as you will discover if you read the tutorial.

http://resources-area.co.uk/node-red-fl ... d_grew.pdf

Kind regards from David.
Thank you dynamicdave, i will try it out.