measuring motor noise with a DS203

I have a project with a DC gear motor, and some limit switches, all of which are fed to my arduino with a 6 conductor cable about 6 feet long. The DC motor opens & closes a door, which triggers the microswitches. I'm having trouble with false detection on the limit switches. My arduino is using internal pull ups on the pins monitoring the limit switches, but the motor running must be causing some kind of noise, and the 6 foot length of cable which feeds the little motor, and the limit switches is not twisted pairs. I put a 0.1uF cap on the motor itself which greatly helped, but I still get misfires on the limit switch. I'm going to swap out my cable to a cat5 cable with twisted pairs, which I hope will fix the problem.
Incuded is a photo are my setup.

My main question: I have a pocket DS203 scope, and would like to learn more about using it. I would think that I could measure the noise by connecting it to the motor terminals? I'm kinda at a loss to know how to set it's settings. I've googled for tutorials on such, but am coming up short. The DC motor is a 12 volt motor. If anyone has a DS203 and could advise on some basic settings to test this out I'd really appreciate it.

(mod edit)

ps. also, I know it's the 6 foot cable with both limit switch and motor wire in it, because if I disconnect the limit switch wire from my arduino terminal block, the problem ceases.

Is it shielded cable (preferably twisted pair with multi usage cables)
Also preferable is a seperate shielded cable for the motor / voltage carrying wires.

Not too sure the dso will help too much but you could monitor the switch line to see how much noise is on there and if you can spot any false noise capable of doing a trigger.

It wasn’t a shielded or twist cable. I swapped it out for a cat5 cable, using a pair for the motor, and a pair for each limit switch and now I get no false triggers.

You've now learnt why you never route motor wiring alongside sensor wiring in the same cable...

You may be able to salvage the situation with enough capacitance to ground on the sensor wires
at the Arduino end though.

Using separate pairs in the CAT5 is clearly helping, but until you look at the signals on a high-speed
'scope you won't know how iffy or not it is... 10nF -- 100nF to ground on the limit switch pins will
add a considerable extra margin.

Thanks. Yes cat5 has helped but like you say I’d really like to know how iffy it is. I will try my scope on the limit switch pin. That is obvious now - I was trying to use it on the motor lines to pick up noise. I’d like to experiment with it some without using cat5 or the caps to see the difference.

The power lines often generate a surge and it is the signal lines that can pick up that surge and translate it in some cases into something else.

Ferrites / caps etc. take a good chunk of that noise OUT of the circuits as does the twisted pair.

See here also for a better description.

Thanks for that helpful link!

Yea swap "encoder" for switch or any other signal device.
Same difference.

For digital pins detecting switches, or buttons, the normal way I always do it is by using internal pull ups, and have the button switch closed to ground. Would it be ok/a good idea to always put 0.1uF caps on on these lines, right on my custom PCB’s?

Going to refer you here as it gives you so many options and covers your issue really well.

It is my GOTO page for these sorts of issue :smiley:

ballscrewbob:
Going to refer you here as it gives you so many options and covers your issue really well.

It is my GOTO page for these sorts of issue :smiley:

Ah, I wondered about the internal pull-up being a little weak, so adding an external 1K pull-up will also be on my PCB’s from now on. Thanks again.