9v battery to power two 3v motors??

I have bought the picoborg and two of these motors:
http://www.modmypi.com/electronics/motors-and-robotics/dc-motor-3v-inc.-... . Would I be able to run them off a 9v battery. At the moment, I don't have any money so hopefully I don't need a voltage regulator!

piborg's picture

Yes, you will be able to control those motors with PicoBorg and a 9V battery.

What you need to do is limit the maximum power output from the PicoBorg to 33%.
This can be done by using the software PWM functionality in wiringpi.

There is a PWM example for PicoBorg and a joystick here: JoyBorgPwm.
In order to change the maximum power you will need to alter the lines:

driveLeft = int(driveLeft * 100)

and

driveRight = int(driveRight * 100)

to use 33 instead of 100, so:

driveLeft = int(driveLeft * 33)

and

driveRight = int(driveRight * 33)

I have looked through the code that you have in the link and I don't see anything that corresponds to this in any way to the code that you posted enough. Would you be able to tell me which lines of code or is there a mistake above?

piborg's picture

The driveLeft line is number 132.
The driveRight line is number 139.

Subscribe to Comments for "9v battery to power two 3v motors??"