Connect wired alarm system sensors to SmartThings with a NodeMCU ESP8266 [deprecated]

That kit is correct. This guide is really intended if you want to disconnect your sensors from the existing alarms control board, and connect them only to SmartThings. That is one of the reasons you need to measure the voltage, when in normal state, and when the doors are open or motion is detected.

For example, on my alarm board, my voltage across pins when the door is closed is 0 VDC (normally closed contact). When the door opens, I get a voltage of 6 VDC. On the NodeMCU ESP8266, you will get 3.3 VDC when the pins are open, or 0 VDC when the circuit is closed.

Because I have a difference between the 3.3 and 6 VDC, if I want to use my existing alarm control board in parallel with the NodeMCU, I’m going to have to rig up a voltage divider to get the 6 VDC down to 3.3 VDC. Otherwise, there will be a negative voltage coming back to the NodeMCU.

1 Like

I will go ahead and measure after the resistor for the door. Should I also measure for the motion?
I plan on using my system in parallel as I want my current alarm to still function.

The panel has the green wire that contains the resistor connect to the same point (refer to the image on my last post). Will that pose a problem??

The 2 sensors share the same common, not an issue.

1 Like

Just conducted a voltage test for the door and motion.

Door is closed: 5.39 DC Volts
Door is open: 13.50 DC Volts

No Motion: 5.41 DC Volts
Motion: 13.20 DC Volts

I suppose I won’t be able to integrate?? Or would a voltage divider work? Any device that will be able to get this to function?

For instance if voltage is 5V output 0, if voltage is 13 output 3.3. Would be great if I can do something like that.

I would assume I can do this with a combination of a low voltage disconnect and resistors.
Where can I get a 6V disconnect switch and what kind of resistor would be appropriate in dropping 13.5V to 3.3V?

There are resistors on every leg of field wiring, correct? I assume you are measuring the voltages at your alarm panel’s input screws, relative to the alarm panel’s Gnd, correct? If so, try measuring your voltages on the other side of the resistors, relative to ground and report back. My guess is that you will get 0 and some other voltage depending on the state of your open/close sensors (or motion sensors.)

If you get a zero / positive voltage combination, a simple 2-resistor voltage divider is all you’ll need to scale the max voltage down to 3.3v to work with the ESP8266.

1 Like

You are correct!! I just tested the voltage on the other side of the resistor and got a 0. I have resistors on the green wires of all the sensors.

So I get 0 when there is not motion and 13.4 when there is. So where can I get the 2-resitor voltage divider? Can you provide me with a link or something. I have no idea.

Thanks again!!

Take a look at this web site. Enter in 13.4v for input, 3.3v for output, and enter something like 10 KOhm for R1. It will calculate R2 for you. Play around with the resistor values until you find a combination of values that are readily available for purchase. I would try to make sure that the resistors you select add up to at least 10KOhms, but less than 1MOhm. 10Kohm and 3.3KOhm would make a good pair of resistors to scale the 13.4v down to 3.3v.

Too low a value and you risk sinking too much current through the volateg divider. Too high and not enough current will be available to drive the ESP8266’s digital input.

http://www.daycounter.com/Calculators/Voltage-Divider-Calculator.phtml

And you probably already know this
 make sure you tie the ESP8266 Gnd to the alarm panel Gnd. Do NOT tie the ESP8366 3.3v to anything on the Alarm panel.

Also, make sure you disable the Internal Pullup resistor on all of your ESP8266 digital input pins since you will be using the Alarm Panel’s voltage source, scaled with a voltage divider per input, to trigger high and low states on the ESP8266.

1 Like

Is Gnd and ground the same thing? I wasn’t using my multimeter previously to measure the ground. I was simply using the two wires coming from the sensor (yellow/green). The green was going to comm in my panel. My panel isn’t even connected to the ground. I attached a picture that illustrates my measurements.

Green is at the panel for the yellow and green wire.
Blue is at the panel for the yellow wire and before the resistor for the green wire.
Yellow is on the panel for the yellow wire and the ground terminal on the panel.

The measurement with the ground terminal kept on fluctuation between 1.2 and 4V when motion was present.

So which two wires should I measure the voltage off and which ones will connect to the ESP8266?

How do I disable the internal pullup resistor?

Are these the two resistors I should get?

  1. https://www.amazon.com/E-Projects-100EP51410K0-10k-Resistors-Pack/dp/B0185FGYQA/ref=sr_1_2?ie=UTF8&qid=1488759219&sr=8-2&keywords=10kohm+resistor

  2. https://www.amazon.com/E-Projects-100EP5143K30-3-3kOhm-Resistors-Pack/dp/B0185FGTN8/ref=sr_1_1?ie=UTF8&qid=1488759234&sr=8-1&keywords=3.3kohm+resistor

I also plan on powering the ESP8226 with USB as I think that will be easier.

Thanks again for all of your help.

The kit you are buying includes a dev board that will allow 12v DC to power it (and the ESP8226). This will allow you to pull power from the 12v backup battery. Extremely easy IMO. Just find a DC power pin that will fit the 12v DC plug on the Dev Board and run the wires from the power pin to the backup battery terminals.

1 Like

Is using the battery fine? I thought those alarms battery should only be used for emergency purposes and doesn’t have that many cycles.

Do you have the answers to my previous post? Just want to know I got everything clarified before I place my order.

Honestly, I don’t know about the battery life
 I figured that since it’s trickle charged by the security board, powering the ESP8266 wouldn’t be a big deal. I could be totally wrong about that. I might look to see if I can directly tap something on the security board instead. That dev board will handle from 6v up to a 24v input for power.

As for everything else you are asking, I’m not the guy to ask. Sorry. :frowning2:

1 Like

Yes, those resistors should be fine. As for the wiring, based on your picture and voltage measurements, it would seem you would tie the Arduino Gnd to the Alarm Panel Comm (common). Then attach the voltage divider to the far side of the resistor and Comm/Gnd. Then attach the ESP8266 pin to the middle of the voltage divider.

You’ll need to ask Nate about disabling the internal pull-up resistor in his LUA code. All of my work is based on the Arduino IDE in C++.

1 Like

I will consider using the panel but powering with USB will be relatively simple in my setup.
Thanks for the suggestion though, I would assume I could add it to the alarms panel power supply if it can handle between 6-24. The alarm runs on 16.

Thanks for the info! So for my setup, I will add the two resistors (form Amazon) from the green wire to the ESP8266 and the yellow wire will also taken from the panel into the ESP8266 as well.

What is the voltage divider? I thought I am just using resistors to drop the 13V to 3.3V?

I never used a bread board before so hopefully I won’t fry anything in the process. I will post pictures before I power anything just to make sure.

Thanks again for your help! I will order the 3 things from Amazon and will keep you posted.

@heythisisnate Can you please provide some information on how I can disable the internal pull-up resistor in the LUA code?

Thanks!

@kamran To disable the internal pullup, just remove the gpio.PULLUP parameter from line 7 in the Lua application: https://github.com/heythisisnate/nodemcu-smartthings-sensors/blob/master/lua/application.lua#L7

@TylerDurden I decided to try hooking up my siren. Mine just needs 12V of power to trigger so I just ordered these 3V relays: single: http://amzn.to/2mVCk0g 5-pack: http://amzn.to/2luWf9C. Its shipping from China so probably will take a while to get here, but I’ll get started on the code for triggering the siren from SmartThings and will update here when I have progress.

2 Likes

Thanks! I ordered the 3 items (kit, + 2 resistors). I am sorry for asking all of these questions, I really appreciate your help.

I will be documenting the install process from A-Z and will post the video on YouTube. I will be sure to give you all credit and a shoutout for helping a beginner like me with the process.

One question @heythisisnate, if I disable the internal pullup will I still be able to test the unit as you did “take a wire and connect one end to pin D6 and the other end to the ground (GND).” before installing it in the alarm panel.

Thanks

Nate, any idea what the value of the internal pullup resistor is? I’ve seen on other forums somewhere between 30K and 100K, but that’s a rather large range. Don’t see anything in the specs either:

Maybe. Probably for testing this will be fine. In my experience, without enabling the pullup, the voltage will continuously fluctuate causing the event listening on that pin to trigger multiple times in quick succession when the wire is connected.

I have no idea. It doesn’t seem to be documented anywhere.

1 Like

@kamran
After you disable internal pull-up, simply take a jumper attached to your digital input pin, and move it between 3.3v and Gnd. This will ensure the input is never left floating, and you can easily test the circuit.

1 Like