Electronics > Beginners
Isolating switch lines
(1/3) > >>
Muffins:
Hi guys.

I am trying to use switches to input high/low signals into a microcontroller. They are connected to wires a few meters long.

I was looking for an easy way to isolate the microcontroller since I have previously experienced some noise problems when doing this. One way to do this seems to be to use an optocoupler between the switch and microcontroller as attached.

My question is, how do I go about powering the switch circuit? Is this even a good way to approach this?
Muffins:
Here is the second iteration of the circuit.

Am I being dumb thinking that separately powering the switches and isolating them is going to help prevent EMI from effecting my controller?
jhpadjustable:
You were probably seeing the wire's self-inductance imposing transient voltages across your pull resistor, and injecting that into the internals of your micro and its power supply. The first version would be fine, because the long wire's transients stay out of the micro itself. In fact, I think you could get away with a simple, non-isolated transistor in place of the opto.
Muffins:
Would it be a good idea to use a twisted pair wire for the switch? If inductance is a contributing factor.
max_torque:
Are you confusing debouncing or low pass filtering for isolation?

Isolation, ie the input does not share the same ground potential as the controller is used primarily for safety or functional reasons.

Debouncing,low pass filtering or similar techniques for noise reduction and rejection are used to prevent spurious triggering or a loss of funcitonality due to noise or transmission line effects.


You haven't told us with the switches do, or how they are actuated, but taking a guess that they are pressed by a human, the good news is that this means, in microcontroller terms, the reponse of your system can be glacial!  That means you can easily introduce a large amount of filtering without impacting on the performance of the system.  For example, it takes a human around 100ms at best to press a switch. A delay of even 200ms is realistically mostly impercepatble, but that delay would still allow a 5hz input. Chances are, your "noise" is likely to be at an above mains frequency (50 or 60 Hz) so it's trivial to arange a simple low pass filter to stop the noise, but pass the signal.


Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod