Unexpected Limit Switch Noise

Working on a new art installation using stepper motors.

I thought it would be cool to have a 6 strand cable connecting the (four wire) steppers and limit switches in one casing.

This has turned out to be a very bad idea. Even though I have proper pull-down resistors there is a lot of noise in the wire when moving the steppers.

The wire is about 12 feet long, 18Gauge, heavily insulated.
It is a little late in the construction to source new cable to separate the limit switches.

Not sure if it is the length of the wire, or sending lots of power through the other wires or both.
I am considering writing some hack code to sift through the incoming noise. Any suggestions?

I have a CNC with 3 steppers.
I kept the crash limit switches in a different cable bundle and have nervier had any noise problems
Limit switches are normally closed too ground.

12 feet is 3.6 meters.
That is enough for a tight coupling between the motor wires and the switch wires. No doubt about that.

Can you make a drawing, how do you connect 6 wires to a 4 wire stepper motor and still have enough wires for more than one switch?
Are you mixing a ground signal ?

Does that cable have pairs of wires that are closer to each other, like in a twisted pair ? Use the most paired ones for the stepper coils.

You can add capacitors at the limit switches and at the Arduino. For example 10nF. Perhaps even a LC or RC filter.
I would consider a current of 20mA normal in this situation for the switches. That means that your pulldown (or pullup) resistor could be as low as 270 ohm. I think 470 ohm is a good value, could you try that ?

I agree with LarryD: limit switches are normally closed to ground. Can you change it ?

Some filtering in software is always good with switches. Perhaps a filter that averages the switch input during 10ms.

This is how I have it wired up now.

Each wire in the 6 wire pair is the same.

They are pulled-down, to Ground, with a 10KOHM resistor.

When the switch is depressed, it will read a TRUE value more precisely, but still with a little bit of noise.

I have been trying to take multiple samples but I worry about that interfering with the objective of an "instant" limit switch.

I like the Capacitor Idea, I will try that one when I am back at my shop. (In disney world now, working in my hotel room)

Caltoa:
Can you make a drawing, how do you connect 6 wires to a 4 wire stepper motor and still have enough wires for more than one switch?

Each 6 - pair wire is connected to 1 stepper motor(4 wires) and 1 switch (2 wires).

I then bought fancy 6-pin connectors to keep everything nice and clean.

I am not in a good position to split these apart.

LarryD:
Limit switches are normally closed too ground.

Do you mean that the switch be pulled-UP and connect to Ground when closed? How would this be more efficient?

Under normal conditions the contact of the switch is closed.
If one side of the switch is connected to GND/0V and the other side is connected to an input pin and a pull-up to +5V then (under normal conditions) the Arduino sees a solid 0 volts.
Noise will not effect this input.
When the micro switch opens under an alarm condition/position the Arduino sees +5 volts on the pin.

I wonder how the wires are woven in the cable.
The wobbling of the black cable could indicate some kind of pairing of wires, but I'm not sure.
Perhaps red and black belong to each other.
Can you have a closer look at that, it matters a lot... more than a lot.

The 10k pullup or pulldown resistor is very high in this situation. Try 470 ohm as I wrote.

Caltoa:
I wonder how the wires are woven in the cable.
The wobbling of the black cable could indicate some kind of pairing of wires, but I'm not sure.
Perhaps red and black belong to each other.
Can you have a closer look at that, it matters a lot... more than a lot.

The 10k pullup or pulldown resistor is very high in this situation. Try 470 ohm as I wrote.

There seems to be no order to the pairing of the wires. All of the wires revolve around a plastic-fiber core.

I will try different resistors and maybe some Caps and post an update in the next few days.

If they are woven around the core, they are closest to the next one. So use wires that are next to each other in the cable for a stepper coil.
It really matters a lot.