Let's Make Robots!

Energy reduction?


New code works well, but the motor moves slowly.


New power source plug in, code working = Nothing

Ok, time to order this one: http://www.robotshop.com/adafruit-motor-shield-kit-arduino-8.html


Hello, my first bot is having some issues with the energy management, I think.

Here: http://letsmakerobots.com/node/28206

Now, I've attached the servo to the pin 5 and grounded to the top GND of the arduino board ( next to pin 13). The motor is connected to the motor controller v3. and I have a blinking LED. The problem is that the servo takes all the energy( 9v battery) and the motor moves very slowly.

I will definitely appreciate any help.Cheers.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I don't understand what you have arduino pins 8, 9, 10, 11, and 12 connected to. And, your servo sweep routine looks a bit wacky. You first tell it to go from 0 to 119 and then tell it to sweep from 80 to 0. You might be better off to have a pair of constants, one for MINSERVOPOS and one for MAXSERVOPOS.

pin 8, 9 = motor 1

pin 10, 11 = motor 2 ( not used)

pin 12 = LED

The servo code is just the example from the arduino library, but your suggestion seems right. Thanks.

would be to get rid of or at least comment out anything to do with pin10 and pin11. You aren't using it so it doesn't need to be included. Second, of the h-bridges I know about one typically sends a HIGH and a LOW for one direction and a LOW and a HIGH for the reverse of that direction. From the program you showed, you send HIGH on both pins in the backward and forward routines. Your motor should not move at all, ever. In fact, it should be locked in place, reasonably.

If I get rid of pin 10 and 11 for some reason the motor shield stops working. LOW in the 'backwards part' makes no difference.

Pin 10 and 11 must be connected to the motor drivers enable pins then, Just pull these pins high for continued operation.

How about you tell us what shield you have?

Hello, ok according to the internet it should be the motor shield v3( manufacterer sadi.net). A link:


And this is mine:


There is even code on that site. :)

In the code provided at that site there is no mention of pins 8 or 9, only 10, 11, 12, and 13. Based on the code the site provides, 12 and 13 control the direction of the connected motor and 10 and 11 require a pwm signal to control the speed of that direction.

If I read the code on the site correctly, you should have been able to lift it from beginning to end and get your bot to move forward and backward. Rather than paste the code I will just paste the link http://blushingboy.net/p/motorShieldV3/page/Example-DC-motor/

For Example:
To get a motor to move full speed in one direction you would need to put a high on pin 12 and then for full speed a high on pin 10, add a delay of a second or two and your creation should move either forward or backward depending on how the motor is wired. If you wanted to slow the motor down, you would instead use analogWrite on pin 10 with a value between 0/LOW and 255/HIGH.

Many thanks. I'm new to robotics programming despite that I'm a C programmer. Testing now!

The code works, but still needs more power. The servo takes all the energy.