Users Examples

Please post any examples you would like to share with other PicoBorg owners here :)

GeekyTim's picture

Finally got my PicoBorg all connected up to the wheels last night, and it works! However, it works too well - it is far too fast for what I want to do with it. The Pi is running from its own rechargeable battery, and the two wheel motors from 4 AA batteries. I'm no electronics expert, so I would like some advice to slow it down. Perhaps I could use a couple of resistors between the PicoBorg and the motors? I was thinking of some potentiometers so I can try and match the speed of the two motors so it goes in a straight line. Any advice?

GeekyTim's picture

Using RemoteKeyBorg it's manageably slower. But it turns, so I think the potentiometers would be a good idea.

piborg's picture

The size of the additional resistance will control how much slower the wheels turn by lowering the voltage across the motors.

It does seem like potentiometers would be good, that way you can indeed tune the two motors so they run at the same speed (if they do not already), but also you can set him to run at different speeds depending on what you want to do with him.

Great idea :)

GeekyTim's picture

I tried a couple of potentiometers, but they were to large, I think - the motors either worked or didn't.

So I wanted to try resistors. I tried 100ohm, which slowed the motors down quite a bit, but they became REALLY hot. I'm not sure what amps are drawn by the two motors from a 6v battery pack, but perhaps it's too large for my little 1/4w resistors?

As I mentioned above, I am VERY new to electronic circuits.

GeekyTim's picture

Or, I could simply use a two AA battery pack! That works for me :-) Off to eBay!

piborg's picture

No worries, learning new things always take time and mistakes.

The separate battery pack is a good idea, it will mean the motors will not draw from the Raspberry Pi's power source, which it is very picky about!

In case you were still interested in your previous experiment:

In this case 1/4 W resistors are outside tolerance and they will get hot.

If we assume a worst case scenario (such as a stalled motor):
Motor resistance = 0 Ω
Resistor resistance = 100 Ω
Battery voltage = 6 V

Resistor voltage will be all 6 V (since the motor is providing no resistance)
V = I × R
I = V / R
I = 6 / 100
I = 0.06

Power across each resistor:
P = V × I
P = 6 × 0.06
P = 0.36

Therefore each resistor will be consuming ~ 1/3 W at the worst case, somewhat in excess of 1/4 W.
The problem is the smaller the resistance is, the more power they will consume.

A simpler reference equation for this would be:
P = V² / R
P = (6 * 6) / 100
P = 36 / 100
P = 0.36

See here for more detail.

GeekyTim's picture

A thought I had for my PiCarD - forward and reverse. There are 4 ports on the PicoBoard, so I was wondering whether I could use two for forward, and two for backward - connected to the same motors. I think I would need to have diodes on all the wires to stop feedback when the motors were turned on in one direction. Do you think that would work?

Tim (Noob to electronics)

piborg's picture

Hi Tim,

You can use two relays per motor with a picoBorg to get both directions.

Just make sure to use NC to ground on both sides, or when you restart the Pi, your motors will move!

A relay capable of providing 1-2 Amps or more should be fine.

GeekyTim's picture

To act like a two-way switch? And you wouldn't get any feedback to the PicoBoard as I would be using relays. Good idea.

GeekyTim's picture

Would something like this do?

piborg's picture

Did you mean to attach a link?

piborg's picture

That looks like it would work, the way the input logic is connected it would seem like you could even operate it directly from the Raspberry Pi (i.e. no PicoBorg).

Having said that, without being able to see the schematic for the board we cannot guarantee what it is capable of, but our best guess is that it would behave as intended.

piborg's picture

To give you a heads up, tomorrow we will be placing some Omron relays on the accessories page for people who wish to drive PicoBorg powered robots either forward / backward or with motors which require more power than PicoBorg is able to provide.

GeekyTim's picture

For the Tri, XLo etc!

GeekyTim's picture

...but it won't do what I want. As all it does is switch a circuit on and off, so I would need 4 relays for just one motor - one pair for one way, one for the other. I have therefore purchased the relays from you which I can wire up just as I want.

Hey guys!

Me and my friend are building a Rpi powered drinks robot. We are using small dc pumps from china and a picoborg. All of this should go together pretty easily as soon as we get Raspbian running on the Pi. Our question is how to connect two picoborgs to one raspberry pi. I have seen this done here ( so its possible. I mean there are plenty of gpio pins left, but i have no idea on what pins to use and so on. Is there a way to do this without having to do modifications to the boards? And what pins should we use? (apart from 4, 18, 8 and 7 which are already used by the picoborg. Any suggestions?

piborg's picture

The easiest way to do this if you do not mind wiring would be to connect a second one to different GPIO pins on the Raspberry Pi, perhaps by soldering wires between the two PicoBorgs.

The pins you would need to connect are one of the grounds (GND, pin 6 for example) between the two PicoBorgs, and GPIO 4, 18, 8, and 7 (pins 7, 12, 24, and 26) to four unused GPIO pins on the PicoBorg connected to the Raspberry Pi.
(see the schematic:, or eLinux: for the GPIO header layout)

The main thing with picking pins will be to avoid any that you may want for other tasks and any in use with other boards.
If you are not using any other boards on the GPIO header we would suggest using GPIO 22, 23, 24, and 25 (pins 15, 16, 18, and 22).
If you are using other boards then they will use other pins themselves which you would need to avoid, for example LedBorg uses GPIO 22 so maybe use GPIO 10 (pin 19) instead.

You will want to add some new drive definitions as well, driven the same way the current four are if you use the script code we provide to drive the new GPIO pins for the second PicoBorg.

That sounds awesome! Thank you for the fast answer!
We don't plan on using the gpio pins for any other than the two borgs. The only thing i didn't quite understand was the part about connecting to gnd. We plan on connecting the two borgs with som female to male jumpers and just having the borg mounted to some plate next to the pi. By doing this i have to connect 5 jumpers connecting the borg to the pi, right? 4 gpio pins and 1 gnd?

piborg's picture

That sounds right, do not forget to connect the main V+ and GND connections on both PicoBorgs to the power supply :)

Subscribe to Comments for "Users Examples"