Limit Switch Noise!

I have Limit switch electrical noise. and I am looking for how to solve that.

I found that one.

Is that working that way? Is it true?

How do you know you have noise?

Input RC filtering is a conventional way to deal with noise.

However, the values will depend on what frequency you are trying to filter out.

As a reference, my CNC controller uses .22uf and 2.7K.

I don’t exactly know what frequency I wanna filter (cos i dont have a tool for it) but what i know is i am getting fasle limit alarms randomly.
and I am trying to find a solution for it. :thinking:

What about use ethernet cable?


is that a good solution for it ?

1 Like

Twisted pair is a good method of wiring sensors, especially over long distances.
I would add the filters as close to the Arduino as you can.

Also, consider…

In my experience noise like this is often the result of:

  • Poor grounding designs that daisy chain power and ground signals and the associated grounds associated with the sensors. Your drawing shows daisy chained grounding on the switches. I would run a twisted pair from each switch to the Arduino and connect all the signal grounds to a single point which in turn is connected to the Arduino ground plane.
  • Long runs that route near devices with electromagnetic radiation (motors, relays etc). The spindle motor is a stout source of radiation.

When I first installed limits, I had put protection in the wiring ‘nest’ as it was close to a birds nest… They are the blue ferrite cores that I looped the twisted pair through. I found I didn’t need them, but they are a cheap approach to suppressing rfi.

If I had this issue with mechanical switches, I’d run +5v to the NC position, no interference is strong enough to overcome a direct 5v connection. Ditch the r/c network. Ensure they are ‘break before make’ switches then you should be good.

I purchase some from Amazon, didn’t specify, but they were break before make.

Good luck


Not my experience at all… high-speed currents and poor grounding can shift both supplies and grounds at high speeds. This noise can be conducted and/or radiated noise. This is why filters are ideal for insuring that high-speed noise of whatever type is attenuated. None of this overcomes bad grounding.

Are you saying this because you think the contacts are arcing?

If there is anything that pulls the supply voltage down to an identifiable ‘low’ state, I’d expect the machine to reset.

If they don’t ‘break’ first then you could apply 5v to ground. It’s easy to check with a ohm meter between NO/NC connections.


1 Like
  1. Never run a data line or Vcc line without a return (ground, aka common) line right next to it.
  2. Use twisted pair for runs more than a few inches, Ethernet cable is good for that but it will not stand much flexing. So don’t run it through any cable chains.
  3. A capacitor across switch contacts means you are eroding the switch contacts, as the capacitor discharges. It also makes every switch radiate a little RFI as the switch closes.
  4. Lowering the value of the pullup resistor makes the data line more “stiff”, ie, lower impedance, and so less affected by nearby RFI pickup. 4.7k is rather high resistance for operation around motors pulsing currents in the range of several amperes. Try 470 ohms.
  5. Don’t daisy chain grounds and Vcc lines. Use star connections. In other words, don’t just loop one ground wire around to every switch. Each axis should have its own ground wire and data line, as a twisted pair.

I realize that drawing is a Fritzing pictorial, not necessarily how you will wire it. But I must mention that dressing the wires (ie, where you place them) is very important. As drawn, that entire outside loop of wire is just begging to pick up inductively from motor currents.


Most of these are viable suggestions for the issue. The shortest ‘wire’ will be less of a problem as it’s resonance is at a higher frequency, so keep them as short as possible. If you have a spindle, they draw lots of current. If possible figure out which switch is having the issue.

IMHO I think you need to reverse that…

They’ve used capacitors across points in cars forever (at least as long as we had points) to prevent arcing when the points open or ‘break’. The capacitor ‘looks’ like a short when the ‘switch’ opens and eliminates the arc, extending the life of the points.


Fyi: cat 5 “patch” cables use stranded wire so they can be put in cable chains.

Make it a good day!


No kidding? They are not single strand wires anymore or is it the “patch” nomenclature which is different from what I think of as typical CAT5 cable?

Not the same. With points in a distributor, current when the points close is due to discharge of the capacitor, but the capacitor/condenser is there to prevent a large voltage from appearing across the points as they open, due to inductive kickback. So the points still erode somewhat from discharging the condenser, but are saved from the much worse erosion that would happen from arcing across the points.

With this circuit, there is no inductive kick, so you aren’t looking at a trade-off. Just contact erosion from capacitor discharge as the switch contacts close. The points in a care are MUCH more robust than those in a microswitch or pushbutton.

1 Like

They are still not rated for continuous bending, such as you’ll find in a cable chain. For that, you want much more finely stranded wire.

Not rated, but… I’d expect cable chain to spread out the bending to not be sharp bends, and thus practically limit work hardening? I use stranded ethernet cable for my limit switches. I fold the strands back over the insulation at the end and crimp a small ferrule on so that there is no sharp bending load in the termination.

What kind of wire do you use?

1 Like

Test lead wire. Silicone insulated, 100 strands.

I tend to overbuild things…

I’ve used ribbon cable before, but the kind meant for dot matrix printers. The wire is more finely stranded than generic ribbon cable. Old IDE cables are too stiff.

1 Like

I have been using the stranded Cat5 for years in moving apps. without any challenges.

1 Like

I found this 4 wire cable in my house.
Is that shield around ?

Yes, that’s a shield. Note that the shield should be connected to ground only on one end, by the controller where you should have a single point to which all grounds are connected. Don’t use the shield as a return path for a switch, either.


What kind of filters ?
Like this??