remote buttons monitoring - Page 1
Forum section: electronics / projects

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 02:07:41 am
content: Hi guysI have a need to monitoring a remote buttons, how do people normally do these? Could someone point me to the right direction, or something I can search for? I did google "remote buttons monitoring", I didn't come back with something meaningful.Thanks guysJames W

author: Ian.M
author_rank: Super Contributor
timestamp: October 30, 2017, 02:20:50 am
content: To helpus help you, you need to specify your problem more clearly.Define 'remote' (as applied to your problem)!Is it practical to run a circuit between your controller and the button? If so, approximately how long would it be and what significant sources of electrical interference would you expect?If its not practical to run a circuit, explain why not.Also, is monitoring the button safety critical? What are the consequences of failing to detect a button press and of falsely detecting a button press?

author: ataradov
author_rank: Super Contributor
timestamp: October 30, 2017, 03:22:52 am
content: Assuming you are talking about wireless remote controls, then nrf24l01+ is a popular choice.

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 07:28:01 pm
content: Quote from: Ian.M on October 30, 2017, 02:20:50 amHi Ian.MThank you for your replay, I should have explain my problem better."Remote" means the buttons are within 40m away. The buttons are wired, with multiple cores cable (ideally as few cores as possible)The device are in residential environment, no crazy motors starting or stopping.Is monitoring the button safety critical? Yes and No. Buttons monitoring is a new feature we want to add, it's OK if we can't do it. But if the buttons monitoring is designed in, people will expect them to work, if it fail to report a faulty button, I don't think it will go well.It's OK to falsely detecting a button press (not ideal but ok).Consequences of failing to detect a button press, well, that mean my design doesn't work. This remote buttons monitoring thing will not be implement.Please ask me again if I am not making senseCheersJ

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 07:29:40 pm
content: Quote from: ataradov on October 30, 2017, 03:22:52 amHi ataradov,Thanks for the replay, I should have stated that we are looking for a wired solution.

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 07:49:54 pm
content: I am thinking 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 pressADC ~= VCC for a long time, faultADC ~= GND, fautADC ~= VCC * R2 /(R1 +R2), good

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 07:54:33 pm
content: Image attached

author: ataradov
author_rank: Super Contributor
timestamp: October 30, 2017, 08:05:36 pm
content: How many buttons do you need?

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 08:21:04 pm
content: Quote from: ataradov on October 30, 2017, 08:05:36 pm2 buttons in a pair, up to 4 pairs in 4 different remote locations.

author: ataradov
author_rank: Super Contributor
timestamp: October 30, 2017, 08:25:41 pm
content: So each remote controller only has 2 buttons? Then resistor across each button, buttons in series, and ADC/comparators on the other side. Distinguishing 4 levels should not be that hard.

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 08:45:51 pm
content: Quote from: ataradov on October 30, 2017, 08:25:41 pmYou mean like this?

author: ataradov
author_rank: Super Contributor
timestamp: October 30, 2017, 08:50:39 pm
content: Almost. Remove IO pin, and connect your GND and VCC pins to two wires of the cable. Now on the other end you have a resistor that can take one of 4 possible values. Form a resistor divider with this resistor and a local resistor on the other end, and sample the voltage on the output of this divider. You will only need two wires (shielding may be required on such distance).You need to select resistances value high enough that wire resistance does not contribute a lot (or you can take it into account), but low enough, that noise is not an issue.And keep in mind, this is cheap, but not necessarily robust. But you said absolutely noting about your application, so who knows if this is good enough.

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 09:06:53 pm
content: Quote from: ataradov on October 30, 2017, 08:50:39 pmLike this?

author: ataradov
author_rank: Super Contributor
timestamp: October 30, 2017, 09:08:52 pm
content: Yep.Again, this is pretty sketchy for industrial application. You are potentially exposing your circuit to a lot of interference.I would not do anything like this for a real project, but it would work for a quick hack. May be put some ferrite beads in both lines of the cable on the device side.EDIT: If you want something more real, but still use two wires, then look at 4-20 mA current loop.

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 09:23:45 pm
content: Quote from: ataradov on October 30, 2017, 09:08:52 pmThanks ataradov, that might work.My application is in a residential environment, should be OK. And what I mean by "monitoring" is, the remote buttons are connected properly, no damage, working as intended.I have modified your circuit, add another resistor R2 on the ground, and change the SW to normally closed. Should be able to tell if the buttons are working as intended. Thoughts?Edit: just saw your edit post, I will google 4-20mA current loop, thanks.

author: ataradov
author_rank: Super Contributor
timestamp: October 30, 2017, 09:26:33 pm
content: Why the second resistor? Otherwise, it will work. But what sort of damage you plan to detect? This will not detect shorts, of course.

author: bug13
author_rank: Regular Contributor
timestamp: October 30, 2017, 09:33:24 pm
content: Quote from: ataradov on October 30, 2017, 09:26:33 pmOoops, you are right, it can't detect short.The second resistor is to detect the remote buttons are connected as intended (except short, off course, doh!)edit:We want to know if the buttons are connected, and no faults. What do you think of the design I posted above?ADC ~= VCC for a short time, valid pressADC ~= VCC for a long time, faultADC ~= GND, fautADC ~= VCC * R2 /(R1 +R2), good (guessing a shorted N.C. is rare?)

author: Ian.M
author_rank: Super Contributor
timestamp: October 30, 2017, 11:00:49 pm
content: Here's how I'd do it. I'd use a loop powered 4-20mA transmitter and a current sense resistor at the master end to convert the loop current to a voltage that represents the buttons being pressed for one remote location. Use another instance of the circuit for each remote location.For the transmitter, use a regulator wired as a current source. Not all regulators are suitable - it needs a low minimum output current (well under 4mA), and a low quiescent current, and a high enough input voltage rating to withstand the maximum loop driving voltage + reasonable transients. I would suggestTS2950CT-333.3V 100mA LDO regulator. Loop + to In, and loop - to (regulator) Gnd.N.B. regulator Gnd does *NOT* connect directly to system ground.1uF from In to Gnd and 1uF from Out to Gnd keeps it stable. 820R resistor between Out and Gnd sets 4mA base current. Switch in extra resistors between Out and Gnd with the buttons, button 1: 680R (+4.85mA), button 2: 330R (+10mA). Put a 27V Zener from In to Gnd, cathode to In, to protect against transient overvoltage and reverse polarity connection.At the master end, feed Loop + 12V via a 50mA polyfuse, and connect Loop - to a 150R current sensing resistor to ground for 3.3V max ADC input or 220R for 5V max ADC input. Use a minimum of 1K input protection resistor between the sense resistor and the ADC input, clamp the ADC input (to protect against overvoltage due to a shorted loop), and RC filter it. Use twisted pair for the loop wiring. If a longer loop must be driven, the supply voltage may be increased up to 24V.The resistor values specified will give:5V (220R)0.89V - No buttons1.95V - Button 13.09V - Button 24.15V - Both3.3V (150R)0.60V - No buttons1.33V - Button 12.10V - Button 22.83V - BothSet the detection thresholds midway between voltages and a suitable margin beyond the limits.Less than the no buttons voltage is an open circuit, a short to ground or a shorted loop if the polyfuse has tripped. Greater than the both buttons voltage is a failed transmitter or a shorted loop and the polyfuse hasn't tripped.

author: bug13
author_rank: Regular Contributor
timestamp: October 31, 2017, 01:57:08 am
content: Quote from: Ian.M on October 30, 2017, 11:00:49 pmHi Ian.MFirst, thank you very much for taking your time to write this details explanation for me. It's well written and easy to understand. I think it's a well fit solution for my problem.Just a couple more questions:I assume it can be adapted for few more buttons? 3 or 4 buttons will be OK for this design?Will you replace the the normally open switch to normally closed switch, so a damaged switch can also be detected? Or it won't work?Cheers

author: ataradov
author_rank: Super Contributor
timestamp: October 31, 2017, 02:02:35 am
content: Quote from: bug13 on October 31, 2017, 01:57:08 amIt will be much harder. You would have to distinguish 8 or 16 levels. The requirements to shielding and filtering will be much higher. You will probably be better off with a cheap MCU and an active protocol for a lot of buttons.Quote from: bug13 on October 31, 2017, 01:57:08 amWhere is this requirement comes from? It appears silly on the surface.Can you describe what are you doing.

author: Ian.M
author_rank: Super Contributor
timestamp: October 31, 2017, 02:32:59 am
content: The two button design doesn't mind whether the buttons are normally open or normally closed - it just outputs a binary weighted current + 4mA. I believe it would be practical to add a third button giving eight levels if more precise resistors were used. Extending it to four buttons would probably not go well.If you discard the capability to be able to detect multiple simultaneous button presses, you could use a resistor ladder to set the current that's progressively shorted out by four buttons, giving five current levels evenly spaced from 4mA to 20mA. I wouldn't try to go to more that eight buttons that way.For all other additions, you'd be better off with a MCU as Ataradov suggests. Doing 4-20mA loop powered stuff with a MCU is a bit of a PITA, you'd be better off with a RS485 transceiver chip and a 4 wire cable, one pair for power and the other for bidirectional data transfer. That would allow you to put multiple remote stations on the same cable, with as many buttons as you like at each station and even add features like remote displays, or other indicators.

author: bug13
author_rank: Regular Contributor
timestamp: October 31, 2017, 02:38:32 am
content: Quote from: ataradov on October 31, 2017, 02:02:35 amArh, I see, I didn't know supporting 3 buttons will need 8 levels. Thanks for explaining to me.Quote from: bug13 on October 31, 2017, 01:57:08 amIt's not a requirement. It's just me that when I learn something new, this new knowledge lead me to think of something else that I don't see before. This question is purely base on my assumption that when a N.C. button is physically damaged, it's very likely that it will become open.Where as a N.O. button, when it get physically damaged, it mostly still stay open.Hence my question about replace a N.O. button to a N.C one, a damaged button can be detected, that's all.Cheers

author: ataradov
author_rank: Super Contributor
timestamp: October 31, 2017, 02:45:27 am
content: Quote from: bug13 on October 31, 2017, 02:38:32 amI don't think this assumption is true, unless you have actual data on the button used in your design.Unless you actually have specific reliability requirements, don't think about it. Guessing here will rally do no good, just a lot of wasted time.

author: bug13
author_rank: Regular Contributor
timestamp: October 31, 2017, 06:40:11 pm
content: Quote from: ataradov on October 31, 2017, 02:45:27 amWell, can't argue about that.Thanks for taking your time to help me out here, I think I got what I come here for, thanks all for your helps.