Monitoring a tamper circuit with Wemos D1 mini ESP8266

I'm scratching my head how to monitor an intermittently faulty tamper circuit, the cables are small diameter and aprox 50-60m total at a guess (domestic house alarm tamper).

Measuring with a Fluke it's 55ohms normally closed, there are times it goes open circuit hence setting the tamper alarm off.

So I would like to nerd out by monitoring the circuit resistance and send it to my MQTT/Influxdb/Grafana setup.

Googling brings up several Arduino based ohm meters (example), however not within the range I need (aprox 55ohm closed circuit vs infinity when open circuit). Of course I cannot expect accuracy over such an extreme scale!

The D1 mini has the below voltage divider on the A0, but I can't figure that out, i.e. adding 50ohms to a 200k/100k divider would make absolutely no measurable difference.

So not sure how to achieve this... any tips where to start would be appreciated.

Or maybe I am overthinking this, and I could just use a single pull up/down 4.7K resistor to treat it as a digital input...


I suggest you don't bother with the monitor, it will only tell you what you already know: sometimes the resistance varies. Go round the circuit and inspect every connection until you find the fault. I suggest you do so with a multimeter across the circuit and have someone monitoring it while you move the connections around, when you find the faulty connection the resistance will be all over the place.

That would certainly be a solution, and I will do that thank you. It has been happening over the years, and I was hoping to catch a pattern when it occurred. As there are several tamper circuits it could be, I was thinking to hook it up and eliminate one. Also if the open circuit is caused by a cable damage somewhere hidden under the floor etc..

I would still be interested in how this could be done with an Arduino just for my own curiosity. Maybe being too clever for my own good!

That's as good a reason as any. In the schematics you posted replace SW1 with the suspect circuit. If you just want on / off indication then connect to a digital pin and read it frequently, if you want to see the change in resistance then use an analogue pin and read it frequently.

send 12V out on the wire. Interface an MCU through an opto-coupler to a GPIO digital pin.

True :slight_smile:

I understand the digital pin method, not sure I fully grasp the analogue pin method.. i.e. getting a usable resistance. I guess it will just be more of an indication of resistance change?

Hi, why 12V?

To get the actual resistance requires some maths, but in the first instance you just measure the change in voltage produced by the changing resistance. As the lowest the bottom resistor can go is 55Ohms if you make the top resistor (about) 55Ohms then the output from the A2D will be the mid point, ~512, when the circuit is closed, and will rise with higher resistance. If you make the top resistor, say, 10k then the closed output will be a lot lower and you'll probably get more meaningful results as the resistance increases. I'm going to stop there and encourage you to experiment, use a 10k variable resistor to simulate your faulty wiring (bottom), try different top resistors and send the readings from the A2D to the serial monitor.


1 Like

Thin wires, long distance.

1 Like

That’s great I will indeed experiment.
Thank you :+1:

After some playing I can see what you mean, 10K actually seems perfect.. thanks again!

1 Like

OK, good.

You need to be aware of something else: If this is an alarm loop around the house it will pick up a lot of electrical interference, which could damage the inputs. You need to protect against that. At the very least place a 10k resistor between the mid point of the potential divider formed by the loop and the top resistor and the input.

1 Like

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