I just spent nearly an hour trying to track down the reason for a shaky analog signal. I thought maybe my pot had been damaged, or the Arduino, or my USB port as I'd had an overcurrent trip due to a wiring mistake a week before.
It turned out to be the 24 gauge wire out of some network cable I'd used to connect the top and bottom 5V and ground buses on the breadboard. My breadboard doesn't quite hold that thin wire tightly enough. So the miniscule 20mA draw from the two motor coils and the slight shaking of the board from the motor motion was enough to keep making and breaking contact.
I feel stupid for taking that long to figure it out.
The solution (short term) was to use some premade jumpers that are stranded wire with short pieces of what look like 20 gauge solid wire soldered onto the ends. I bypassed all of the 24 gauge jumpers, and now it is down to 1 bit of noise, which is what I'd expected. Now I can use software to smooth out the 1 bit of noise.
As one becomes more comfortable/proficient with electronics and something goes wrong the mind can race away with a multitude of technical reasons for a problem but sometimes/often it turns out to be the most basic thing that is the cause.
For home-made hookup wire use 0.6mm--0.7mm diameter solid-core. That's thicker than CAT5/6 (0.5 mm)
Dupont style header pins are 0.64mm for comparison, which is why 0.5mm won't work in them.
A quality breadboard should handle it though, its designed for all sizes of component lead, unless its
been stretched with thicker wire before - its common for the ground/power busses to get stretched in
my experience, so you normally have to choose a good socket by trial/error.
BTW cheap chinese breadboards are usually more trouble than they are worth - often only 5 connections
per strip instead of the much more useful 6, often sockets and holes in the plastic aren't aligned, and
the sockets themselves tend to jam due to rough edges.
The only thing worse is coloured breadboards - impossible to see where the wires go! Avoid the temptation!
Yes, cheap breadboard. Although it is fine with the thicker wire.
I still have a couple of the first white protoboards from Radio Shack in the late '70s early '80s. They are fine with the thinner wire, but they cost a LOT more, especially when you take inflation into account.