I am using two DC Motors (Controlled by an Arduino Motor Shield) and one ultrasonic sensor (HC-SR04) in one project. Everything is working fine when my Arduino is connected to my computer’s USB.
However, it does not work properly when using an external power supply. I have used 5 AA batteries (7.5V). I connected the battery pack to Vin and Gnd of the Arduino Motor Shield (See the picture bellow). Motors are connected to Channel A and Channel B.
My sensor, connected to Arduino 5V pin, is giving wrong measures when motors are working (According to specifications the sensor needs 15mA, enough for Arduino connected to 7.5V, right?).
Thanks in advance!