Hi! I’m trying to control a servo (S3003) using an ultra sonic sensor (HC-SR04). When the servo is moving the input signal from the sensor gets very unstable, giving the motor the wrong positions, making it move even more, creating this bad feedback loop. I heard this can happen as the servo draws more current when it moves and that i should put i capacitor over the power to the servo. I tried this using different capacitors (100uF, 470uF, 1000uF) but it doesn’t help. I’m using a bench power supply set to 5V for the servo and the sensor and i’m powering the arduino via USB from my computer. Anyone know what causes this or have any tips on what to try next? I have attached i drawing of the circuit.
Thanks in advance!