MovingRaspi is a project I had some times ago, and I've just decided to start. Project's goal is to motorize a Raspberry Pi and control it with an iPhone (or iPad, or iPod Touch). This third part is about the final assembly.
H-Bridge is a basic assembly to control motors rotation direction. You can see below how it looks:
To rotate the motor in one particular direction, you just have to activate two diagonally opposite transistors (i.a. Q1 and Q2, or Q3 and Q4). The reverse rotation direction, activate the two others. And to stop the motor, activate none of them. You can see below the two possibilities.
MCP23008 is a port expander chip. To drive two motors, each with its own H-Bridge, you need a total of height GPIO pins. As Raspberry Pi only have height of them, unless you disable some special features, you will be quickly blocked in the future. And tada !! here is the MCP23008 chip. It use none of the GPIO pins (it is connected to the Raspberry Pi with I2C pins, +3.3V or +5V pins, and ground pin) and gives you eight new GPIO pins, for a total of 16 GPIO pins. And for more important needs, you can add more MCP23008 chips, or MCP23017 chips, which provide sixteen GPIO pins for these latter.
To power MCP23008, you can choose between +3.3V line or +5V line. I choose the second one mainly because +3.3V power line is limited to a total of 51 mA, shared with all GPIO pins of the Raspberry Pi. +5V power line is limited to 700 mA minus Raspberry Pi power usage. With an headless Raspberry Pi (which needs about 400 mA), you get 300 mA for USB and +5V power line.
Electronic schema and breadboard assembly are shown below:
About breadboard assembly, it's made for BCU81 transistor, which is a ECB one (in front view, pins from left to right are Emitter, Collector, Base). For EBC transistors, a breadboard assembly is available on GitHub project page.
All sources and schemas for the project are available on GitHub.