I am trying to drive a motorized potentiometer from an Arduino Nano. The Arduino reads the pot’s resistance using analogRead() and then drives the motor using a TB6612FNG motor driver until the measured resistance matches the desired value (within a certain epsilon of course). A 10V DC converter powers the motor driver and is also connected to the Arduino Vin.
When connected to my PC via USB cable everything works flawlessly with me moving the pot to the desired values. As soon as I unplug the USB cable the circuit becomes highly unreliable, with analog values fluctuating a lot and correspondingly the motor jittering around the set position. I was trying to get a better idea of what the induced noise looks like, but of course as soon as I connect my oscilloscope’s ground lead to the circuit ground the problem goes away.
Things I have tried:
- increase distance between motor and sensor leads
- adding 220uF electrolytic caps between Vin/Gnd and 5V/Gnd
- adding 0.1uF ceramic caps between the above points as well as the motor leads
None of these things have made a difference. What are some other recommendations?
Motor specs here (10V DC, max. 0.8A, 10kOhm max resistance):
TB-6612 breakout board: