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.

So what does 'new code works well, but the motor moves slowly' really mean?

How slow is slow? Does it run any faster with the servo disconnected? Are you still using that 9V battery to power everything?

Runs faster with the servo disconnected. 9V battery still, but I'm waiting for a pack holder for the new batteries. Something that I want to mention is that with the usb cord plug in, the motor moves slowly as well. Cheers.

Both the power from a USB and from a 9V have limited current to supply. In fact, all voltage sources have limited current to supply. The trick is to be sure the power source you use can supply at least as much current as your circuit will instantaneously draw.

Motors and servos draw quite a bit of current, especially when they first start up. So it seems extremely likely that with your motor and servo running, you are trying to draw more current from your 9V and from USB than it is designed to give. BTW, this can damage your USB port, which you probably don't want to do.

I really think this is the source of your problem. When you get your battery holder in, try and see. Let us know how it works out.

Your problem is that a 9V battery has not a lot of current capacity. Try AA batteries or another source and you will see a difference.

I'll post the updated results with the new power source. Thanks.

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.

How about you tell us what shield you have?