Wiring Looms

Putting the motors to one side, as they are provisioned by an independent battery pack through the motor controller, everything we connect to the Raspberry Pi will need its own power and data connections. If we were to give everything its own power and data pins on the Pi we would run out of options very quickly.

The solution to this is to share pins. If you know a little about electric circuits, and in particular Ohm's law (V = I*R), you will know that you can parallelise your power circuits. Every parallel power connection is provided with the same voltage (5V) but shares the current. As long as you have enough current available to share out among all your current drawing components everything will be tickety-boo.

To work out the current requirements of all your sensors connected in parallel, simply add together their individual current requirements. If this comes to less than the current available on your circuit you're in business.

Our plan was to run all the I2C sensors off the 5V rail of the Pi, powered by a good (2A output) power bank. We asked Pimoroni about the current draw of its Breakout Garden sensors just to be sure that our idea wasn't crazy.

We asked whether there was a limit to what the 5V rail on the GPIO could deliver and were told that it will deliver whatever the Raspberry Pi doesn't need for its own needs over the 5V rail.

We knew that unless we weren't running compute intensive operations or full colour touchscreen HATs (such as Pimoroni's HyperPixel) the Raspberry Pi would happily tick along on around 1A (allowing for demand peaks), leaving plenty of spare current for our I2C needs.

To provide all our I2C sensors with 5V power we created a wiring loom with electrical terminal strips (aka "chocolate block" in the electrical trade). This allows us to wire up to 5 separate I2C sensors into independent output terminals that are all connected to a single pair of 5V and GND Raspberry Pi pins.

We can use exactly the same principle to share data connections off the same default I2C bus pins on the Raspberry Pi's GPIO.

The following diagram illustrates this plan.

This is quite a time consuming and fiddly process to cut, strip and screw lots of short connecting wires into the terminal blocks. We will need one of these wiring looms for each robot for I2C sensor power. One of our team members found it useful to make use of some dead time on a train to wire all of these up for us.

It is also possible to provision a second I2C bus on the Pi using spare GPIO pins. There is an Instructibles guide that shows you how to do this. We might choose to do this for the motor controller and pan-tilt HAT (also I2C) leaving the default I2C bus exclusively for the Pimoroni Breakout Garden sensors and OLED screen.

comments powered by Disqus