remote button monitoring idea

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Hi guys

I need to monitor two remote buttons, the remote buttons are just dump buttons, work as input and output, any idea how to monitor them? The photo attached just show how I want it to be without the monitoring function. Open to suggestions.

Thanks guys!

IMG_2935.JPG
 

dendad

Joined Feb 20, 2016
4,641
If you are driving the port pin as an output to drive the LED, put the Rled and Led series pair across the pullup resistor. Then drive the port pin low to turn the LED on.
Switch the LED off by changing the port pin to an input. That way the port never tries to drive the switch high when it is operated to Gnd.
When the LED is on, momentarilly switch the port to input to read the switch status then back to output low to keep the LED lit. The few microseconds the LED may be off when reading the switch will not be seen.
The pullup resistor is still needed across the LED and its resistor as the LED drops a couple of volts so the port would not pull up to high without it.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
If you are driving the port pin as an output to drive the LED, put the Rled and Led series pair across the pullup resistor. Then drive the port pin low to turn the LED on.
Switch the LED off by changing the port pin to an input. That way the port never tries to drive the switch high when it is operated to Gnd.
When the LED is on, momentarilly switch the port to input to read the switch status then back to output low to keep the LED lit. The few microseconds the LED may be off when reading the switch will not be seen.
The pullup resistor is still needed across the LED and its resistor as the LED drops a couple of volts so the port would not pull up to high without it.
Thanks for pointing this out, didn't see this fault when I draw this little circuit. Thanks again!
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
How about this ?
using an ADC to read the voltage, drive Led as you normally would, switch to ADC to read buttons state, thought?

  • ADC ~= VCC for a short time, valid press
  • ADC ~= VCC for a long time, fault
  • ADC ~= GND, faut
  • ADC ~= VCC * R2 /(R1 +R2), good



IMG_2937.JPG
 

dendad

Joined Feb 20, 2016
4,641
You could do it that way but as I mentioned above is a lot easier.
LedSwitch.jpg
One of our products has been running with a variation of this for the last 20 years without problems.
On our board, it is more complicated as it is switching a power FET and optoisolated as well.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
You could do it that way but as I mentioned above is a lot easier.
View attachment 138370
I should have mentioned that the remote buttons could be up to 40m away (most likely 20m).

The reason I did that was I can detect if the IO/Port is short to ground/Vcc, my SW is damaged. In the unlikely even R1 and/or R2 are open/short. Make sense?

edit: normal input protection is assumed
 

Reloadron

Joined Jan 15, 2015
7,892
If you want a button read why use an ADC channel? As drawn using Q1 as an NPN I think your LED will always be On. For a simple button read maybe something like this:
PNP LED Switch.png

Using a Digital input the logic will be low when the LED is On (button pushed). When the button is held the LED is ON and there is a Logic Low to your DIO. Button released is a Logic High to the DIO.

Ron
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
If you want a button read why use an ADC channel? As drawn using Q1 as an NPN I think your LED will always be On. For a simple button read maybe something like this:
View attachment 138372

Using a Digital input the logic will be low when the LED is On (button pushed). When the button is held the LED is ON and there is a Logic Low to your DIO. Button released is a Logic High to the DIO.

Ron
I properly didn't explain well enough in my OP.

The buttons are in a remote location, up to 40m away.
What I mean by monitoring is have the ability to detect:
  • the wire is open
  • the wire is shorted out
  • the remote buttons are attached
That's why I use an ADC, make sense?

In my drawing, the IO will be driven low most of the time, only change to ADC for a short time to read the inputs. It also have the ability to flash the LED if needed.
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,892
I properly didn't explain well enough in my OP.

The buttons are in a remote location, up to 40m away.
What I mean by monitoring is have the ability to detect:
  • the wire is open
  • the wire is shorted out
  • the remote buttons are attached
That's why I use an ADC, make sense?

In my drawing, the IO will be driven low most of the time, only change to ADC for a short time to read the inputs. It also have the ability to flash the LED if needed.
OK, makes sense now and the ADC will make for easier. Years ago I did a little work with an alarm tamper system. They used a diode across a switch at the remote location. Another thing used was called EOLR (End of Line Resistor) where a switch has a resistor across it at the end of a line. Sometimes two resistors are used. I want to say circuits like this are popular in Fire Alarm circuits and security circuits making it known if a line is cut or damaged or if a valid alarm condition exist. See what a Google of "End of Line Resistors Circuits" gets you. Your ADC can become a window comparator of sorts.

Ron
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Using your circuit, add a resistor across the pushbutton. Then you can read if the line to it is open.
I thought my circuit already can detect open? I am using a normally closed sw here, or am I missing something?
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
OK, makes sense now and the ADC will make for easier. Years ago I did a little work with an alarm tamper system. They used a diode across a switch at the remote location. Another thing used was called EOLR (End of Line Resistor) where a switch has a resistor across it at the end of a line. Sometimes two resistors are used. I want to say circuits like this are popular in Fire Alarm circuits and security circuits making it known if a line is cut or damaged or if a valid alarm condition exist. See what a Google of "End of Line Resistors Circuits" gets you. Your ADC can become a window comparator of sorts.

Ron
Can you explain a bit more how you use a diode across a switch at the remote location?

Now you mentioned "End of line Resistors", I remember it, will google it, thanks
 

dendad

Joined Feb 20, 2016
4,641
I thought my circuit already can detect open? I am using a normally closed sw here, or am I missing something?
With the added resistor, you can detect the difference between the switch open and the wire broken.
With the appropriate resistor valued (or the diode and resistors) you can tell if the line is open, shorted or switch operated.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
With the added resistor, you can detect the difference between the switch open and the wire broken.
With the appropriate resistor valued (or the diode and resistors) you can tell if the line is open, shorted or switch operated.
Can you explain why my circuit doesn't detect open? Here is how I think it can detect it:
  • ADC ~= VCC for a short time, button press
  • ADC ~= VCC for a long long time, open
Or are we talking about different thing here?
Thanks
 

dendad

Joined Feb 20, 2016
4,641
Does your circuit know the difference between an open switch and an open cable to the remote switch?
I take it just the switch is remote.
It could be set up to read someting like...
1V for cable shorted.
2V for switch operated.
3V for switch open.
4V for cable open.
 

Reloadron

Joined Jan 15, 2015
7,892
Can you explain a bit more how you use a diode across a switch at the remote location?

Now you mentioned "End of line Resistors", I remember it, will google it, thanks
I have forgotten how it worked but I think the idea was at the location of the switch the idea was the diode dropped about 0.7 volt. When switch closed the drop went to zero across the switch. Similar to the use of end of line resistor(s). The idea was if the line were cut or open the operator would know. Same thing you are after.

The original system was installed in the 60s and as I recall used analog meters on a big console having a Red area on the scale. Something like a 3 zone on the meter face for Door Open, Normal, and Trouble (as in a line open loop).

Ron
 
Top