DC Motors (Motor Shield) and sensor not working properly with ext. power supply

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!


Perhaps the motor current is too high in the moment the motor starts. This could bring supply voltage down for a moment. You can try with a electrolyte capacitor in parallel to your battery.

Another point: Are your batteries new or old?


Elektrix, thank you very much for your help.

I think you are right about the motor current when the motor is starting (It may be too high). I will follow your advise and use an electrolyte capacitor in parallel to my battery (and I also will change my batteries just in case).

As long as I am using 5 AA batteries (7.5V), What capacitor value should I use?

Thank you very much :)

You may also try 6 AA batteries to give you more voltage headroom. I have always used 6.

What is the current requirement of the motors? Alkaline cells have much higher internal resitance than LiPo or NiMH. They are only suited to low current motors.

put the capacitor simply on the 5 or 3.3 volt of the arduino. this will filter enough, the capacitor on the 12 volt will not work.

Hi "Joe Mcd" and "Shooter"... Thank you very much for your replies.

I do not know the current requirement of the motors - I used motors from an old RC car, so I do not have specifications. I will try to run some tests to figure it out.

I am using the same batteries (Alkaline) I was using when it was a RC car. Maybe using 6 AA batteries to have more voltage headroom (as Joe Mcd suggested) could be a good idea :)

Shooter, thanks for this tip (Putting the capacitor on the 5V) ... I am going to try it out.

Again, thank you very, very much guys!!!