Author Topic: protection from noise in a long wire  (Read 1798 times)

0 Members and 1 Guest are viewing this topic.

Offline fisz

  • Contributor
  • Posts: 10
protection from noise in a long wire
« on: January 16, 2021, 11:51:12 pm »
I have a simple circuit: a pushbutton connected to a microcontroller with a pull up resistor.
[attach=1]
I want to add another pushbutton pararell to the first one, like this:
[attach=2]

However, I need to use a wire that is ~10m long, and it is acting like an antenna. My question is: what is the simple solution to limit any noise affecting the microcontroller?
I can't replace the cable and I can't attach anything at the second pushbutton's end of the cable (it's installed with almost no access), so I can't upgrade to RS-485 or any similar serial connection.
Will a low pass filter be enough? Or maybe I need some protection diode? I'd love to learn more, but I don't even know what I am looking for.
 

Offline viperidae

  • Frequent Contributor
  • **
  • Posts: 305
  • Country: nz
Re: protection from noise in a long wire
« Reply #1 on: January 17, 2021, 12:13:03 am »
How much current can you afford while the button is being held down?

A lower value pull up should help.

A capacitor between the input and ground will act as a low pass filter.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 2373
  • Country: us
Re: protection from noise in a long wire
« Reply #2 on: January 17, 2021, 01:06:57 am »
I'm wondering if something simple like this would work:

[attachimg=1]

The switch would close the connectors at the left end of the circuit.

The output is taken at the collector of the NPN. It will be inverted, but that's easily handled in a microcontroller. The collector resistor shouldn't be too large - I would think that lower provides more noise immunity if needed.

And here's a PNP version if one end of your switch must be connected to your GND:

[attachimg=2]
« Last Edit: January 17, 2021, 01:35:56 am by ledtester »
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 7983
  • Country: gb
Re: protection from noise in a long wire
« Reply #3 on: January 17, 2021, 10:40:03 am »
I'm wondering if something simple like this would work:

[attachimg=1]

The switch would close the connectors at the left end of the circuit.

The output is taken at the collector of the NPN. It will be inverted, but that's easily handled in a microcontroller. The collector resistor shouldn't be too large - I would think that lower provides more noise immunity if needed.

And here's a PNP version if one end of your switch must be connected to your GND:

[attachimg=2]

I think it would still need a Base-Emitter resistor and probably capacitor to avoid noise pickup.
Regards, Chris

"Victor Meldrew, the Crimson Avenger!"
 
The following users thanked this post: ledtester

Offline fisz

  • Contributor
  • Posts: 10
Re: protection from noise in a long wire
« Reply #4 on: January 17, 2021, 02:24:33 pm »
I've always thought that a bigger value pull-up (like 10k) won't do any harm, but what you're telling me is that lower value pull-up is better? Am I thinking correctly, bigger pull-up makes the circuit more sensitive to noise? Well, that actually makes sense...
 

Offline Paul Rose

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
Re: protection from noise in a long wire
« Reply #5 on: January 17, 2021, 02:34:33 pm »
Am I thinking correctly, bigger pull-up makes the circuit more sensitive to noise?

Correct.
The lower the pull-up resister, the "harder" it is to pull down, and you want to prevent "false" pull down due to noise.

Just pay attention to how much current will flow when the switch is closed ( 5v divided by pullup R), and make sure it isn't crazy.   1K would give you 5 milliamps.

Edit:
You could also wind a few turns of the whole cable through a ferrite toroid (or use a few clamp on ferrite) to  suppress common mode noise.  This works even better if pair of wires in the cable is twisted ( because it makes it more likely that noise pickup is actually common mode),



« Last Edit: January 17, 2021, 02:38:13 pm by Paul Rose »
 
The following users thanked this post: fisz

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
  • Recovering Electrical Engineer
Re: protection from noise in a long wire
« Reply #6 on: January 17, 2021, 06:19:24 pm »
https://palomar-engineers.com/wp-content/uploads/20150125_103738.jpg

wind a few turns of your switch pair on torroid and a small capacitor across the input.
Instead of the torroid savlage the clip-on lump off an old VGA cable.

If you've got a lot of spare wire wind the switch pair into a coil say 100mm in diameter -10 turns. Still, always put a small cap across the switch.
 
The following users thanked this post: fisz

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 19607
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: protection from noise in a long wire
« Reply #7 on: January 18, 2021, 12:51:13 am »
No need for a CMC, just a resistor or ferrite bead will do.  Put that in series, towards the switch.  Then put a filter cap on the inside, say 1nF or more.  Add clamp diodes or zener/TVS for ESD protection.  Finally, one more series resistor, say 100 ohms, to the logic pin.  Optionally, add a schmitt trigger inverter/buffer between switch and MCU, to ensure it doesn't see any indeterminate signal levels (this is probably not necessary, check MCU datasheet to see if it has schmitt trigger inputs on port pins already).

The RC or LC filtering, dampens resonances on the cable and filters noise away from the circuit.  This is necessary both to get a stable signal, and to prevent rectification by diodes (which, given enough RF noise, will cause an indeterminate voltage level).  The diodes are added to absorb large bursts of noise, such as ESD.  The outer resistor basically doesn't count, for ESD purposes -- a direct hit will put 5kV+ on the wire, jumping the resistor effortlessly -- this will be clamped by the protection device to maybe 10s of volts, which is still a lot for the MCU pin (and there's lots of amperes behind it as well), so a series resistor finishes things up nicely.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: fisz

Offline fisz

  • Contributor
  • Posts: 10
Re: protection from noise in a long wire
« Reply #8 on: December 07, 2021, 12:23:01 pm »
No need for a CMC, just a resistor or ferrite bead will do.  Put that in series, towards the switch.  Then put a filter cap on the inside, say 1nF or more.  Add clamp diodes or zener/TVS for ESD protection.  Finally, one more series resistor, say 100 ohms, to the logic pin.

Sorry for bringing up such an old topic, but I'm afraid I don't follow what you said. Maybe you could provide a schematic?
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 19607
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: protection from noise in a long wire
« Reply #9 on: December 07, 2021, 04:25:57 pm »
Sure, something like this:



Uh, with a pullup in there somewhere, or internal from the MCU pin is fine too.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: fisz

Offline Etesla

  • Regular Contributor
  • *
  • Posts: 135
  • Country: us
Re: protection from noise in a long wire
« Reply #10 on: December 09, 2021, 03:56:43 am »
Am I the only one thinking the thing is just 10 cm away and you can probably get away with no modifications at all R = 10k or something, maybe put a 10nF ish cap across the switch at most? Maybe debounce the switch in software if you have the option too and are actually worried about it?
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 19607
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: protection from noise in a long wire
« Reply #11 on: December 09, 2021, 04:36:16 am »
10m in the OP, it's a pretty reasonable antenna.

If it's not as far, that may indeed be important!  I wouldn't mind just a capacitor for 10cm, as long as it's inside the same enclosure.  It should still have ESD stuff if it's touchable.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline EEEnthusiast

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: in
  • RF boards, Precision Analog, Carpentry
    • https://www.zscircuits.in/
Re: protection from noise in a long wire
« Reply #12 on: December 09, 2021, 05:44:04 am »
Use a coaxial cable, if cost is not a big concern. you could pull up some 75ohms cable for real cheap.
Making products for IOT
https://www.zscircuits.in/
 

Offline SoundTech-LG

  • Frequent Contributor
  • **
  • Posts: 713
  • Country: us
Re: protection from noise in a long wire
« Reply #13 on: December 09, 2021, 07:11:19 pm »
Use a coaxial cable, if cost is not a big concern. you could pull up some 75ohms cable for real cheap.

Except...  the OP already stated in his 1st post...

"I can't replace the cable and I can't attach anything at the second pushbutton's end of the cable (it's installed with almost no access), so I can't upgrade to RS-485 or any similar serial connection."
 

Offline tanveerriaz

  • Contributor
  • Posts: 24
  • Country: pk
Re: protection from noise in a long wire
« Reply #14 on: December 10, 2021, 04:08:27 am »
try use 5V reed relay
 
The following users thanked this post: fisz


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf