Using alarm panel to trigger nodemcu board

Thread Starter

eggy28

Joined Jan 29, 2018
7
Hello. I have a project where I'm trying to trigger my nodemcu micro controller on a voltage change from my existing honeywell vista 20p alarm panel board. On this alarm panel board, I have a 2 post hard wired sensor that, when the door is closed, the circuit will have ~4.5 volts. When the door opens the voltage changes to ~11.5 volts. Ideally, I would like to use this voltage change with my gpio pins on my nodemcu board. The issue I have is that my gpio pins only allow 0-3.3 volts. If I use resistors to reduce the voltage for the nodemcu, it brings down the voltage on the alarm panel board which then plays havoc with the alarm panel. I've been reading about transistors and optocouplers, but seems like lot of use cases are low voltage devices trigger high voltage. If I could somehow have this voltage change (4.5 -> 11.5 ) act as a switch to control a (0 -> 3.3v) circuit I could handle this on my nodemcu. Forgive me if I'm missing something obvious, but any help into components I may need to have this work would be much appreciated!
 

AnalogKid

Joined Aug 1, 2013
11,056
1. What power is available for an external buffer circuit between the alarm panel and your uC board?

2. For this to work, the interface circuit will have to draw very little current from the alarm loop. For that to work, either one of two things:

a. The alarm panel and your NodeMCU share a common ground;

b. The interface circuit is powered by the alarm panel (there is plenty of extra power capacity for this; I have the same panel), and drives an opto-coupler that connects to the NodeMCU and its own ground.

ak
 

AnalogKid

Joined Aug 1, 2013
11,056
If you only apply the resistor divider to your GPIO pins, why would that affect anything else??
It is a medium-impedance analog loop, and is both noisy and sensitive to resistance changes. I think the terminating resistor is 2.2K or 4.7 K (been too long).

If you use a (high impedance) fixed divider to drop the low 4.5 V level down to a logic 0 (0.4 V), that drops the high 11.5 V level down to 1.02 V, not enough for a logic 1. I thought about using a zener to subtract rather than divide, but then you need at least 0.5 mA to wake up the diode, and that is enough to upset the loop.

I think a MOSFET 2N7000 source-follower can drive either the NodeMCU directly or an optocoupler, but need to know about the grounds first.

ak
 

Thread Starter

eggy28

Joined Jan 29, 2018
7
Thanks AnalogKid!! From everything I read and try to learn, I think the mofset & optocoupler may be the route for me to go. My original attempt at this had the NodeMCU powered separately by a 5v usb wall charger, so I could keep this ground if that helps. You wouldn't happen to have a layout diagram or link you might be able to send my way to show the circuit your thinking of? And which optocoupler would you suggest?

I truly appreciate the help! thank you.
 

AnalogKid

Joined Aug 1, 2013
11,056
On the alarm board you need to find a place to get steady DC power. On my panel it is terminal block positions 4 and 5, and measures 13.62 Vdc. It looks like each loop goes through one section of an LM339 quad comparator, but finding the correct output would be tricky without a full-board schematic. I'll see what I can do about an interface circuit schematic.

The easy option is1/2 of an LM393 comparator, but I'm leaning toward something more simple, like a 2N7000 source-follower.

What parts do you have access to, what is your skill set for assembling a circuit, and where are you located?

ak
 
Last edited:

Thread Starter

eggy28

Joined Jan 29, 2018
7
Thanks AK. Your awesome man for lending me a hand with this. I have a lot of the basic parts around like resistors, capacitors, etc, but I don't have any optocouplers or mofsets yet. I will happily order some up if I know what I need. I confident with building/assembling the circuit, I'm just struggling with what I could use to have my Nodemcu detect the higher voltage change on one of its gpio pins that only can only handle 0-3.3v. On my part, I'll try to become more knowledgeable on the 2N7000 and how others have used them in their projects. I'm located in the Minneapolis/St. Paul area.

Thanks again...
 

AnalogKid

Joined Aug 1, 2013
11,056
It looks like the uC has one A/D pin.
IF that is available
AND IF it has a high input impedance
AND IF it is ok to have a common ground
THEN this can be solved with two resistors and some code.

But the important question is: do you know where Thief River Falls is?

ak
 

Thread Starter

eggy28

Joined Jan 29, 2018
7
Yeah, I certainly know the town - although it's been quite a while ago since I've been there...You from the area? I would think they could share a common ground, as I could certainly power the nodemcu directly from the alarm panel. I believe it has a 20v regulator.
 

AnalogKid

Joined Aug 1, 2013
11,056
As above, a "normal" way to do this would be to use a comparator. Here are an isolated and non-isolated approach that uses a zener diode as the comparator.

Q1 acts as a very high impedance buffer. R1 limits the current through the output string or through the opto-coupler LED. R2 makes sure things turn off.

In the left circuit, when the loop voltage goes high the GPIO pin voltage goes high. In the right circuit the GPIO voltage goes low, but that can be changed by moving R3 to between emitter and GND.

EDIT - in the left circuit, R1 can be increased to 1K - 3.3K.

ak
Alarm-Panel-Buffer-1.gif
 

Thread Starter

eggy28

Joined Jan 29, 2018
7
Hey thanks so much AK, and others! Beyond appreciated!! I'm going to print these off and start digesting this information to fully understand how its working. And thanks for identifying the exact parts that I'll need to order!

I'll keep you updated on the progress. Again - thank you.
 

Thread Starter

eggy28

Joined Jan 29, 2018
7
AK - I was able to get the parts this week and have a follow up question. I've tried both solutions, and I'm wondering if I'm wiring the 2N7002 mosfet incorrectly? I have the right picture put together on my bread board, but if I read the voltage on my loop line when I connect it to the gate input, it'll pull the voltage down to ~7.3 volts. Where normally this voltage is almost 11v on the loop if I disconnect it from my project. Should it do this on the gate input to the 2n7002? Thanks.
 

AnalogKid

Joined Aug 1, 2013
11,056
The gate impedance of a MOSFET at DC is near infinite. Something to check: some datasheets show the transistor pinout from the bottom view, some from the top.

Please draw a sketch showing how you have the circuit connected to the alarm panel.

ak
 
Top