You'll need the following parts to build a Raspberry Pi dashboard:
- Raspberry Pi - I recommend the Pi 2 since it has a bit more power and memory compared to a normal Pi, but the B+ or A+ would work great too. A Pi Zero might work but will be tricky to connect to the motor HAT. The older model B and A Pi with 26 pin GPIO adapter won't work with the motor HAT.
- LED Backpacks - This project is made to work with the following LED backpacks. Note that a Pi can control up to 7 LED backpacks (each with their own unique I2C address).
- 0.56" 4-digit 7 segment display
- 1.2" 4-digit 7 segment display
- Quad alphanumeric diplay
- Bicolor 24 segment bar graph
- Stepper & DC Motor HAT and automotive stepper gauge - You can control up to two automotive stepper gauges using the motor HAT. Grab a few pairs of Pi HAT standoffs to securely mount the HAT to the Pi.
- USB WiFi Dongle - Use a Pi-compatible WiFi dongle to easily get your Pi on a network. The dashboard can be controlled by any machine on the network that makes web requests to the Raspberry Pi.
- Raspberry Pi power supply - You need a 5V supply with micro USB connector that can source around 2 amps of current to power the Pi.
- 5V 2amp power supply - You'll want a separate power supply to drive the motors. This 2 amp supply should have enough current to handle a couple automotive steppers and the LED backpacks (see below). Grab the 2.1mm barrel jack to screw terminal adapter to make wiring to the supply easy.
- 3.3V regulator or buck converter - This is optional, but if you're driving more than about 3 LED backpacks you'll likely find the Pi can't supply enough current to them all. Use a 3.3V regulator like the LD1117-3.3 or a fancier 3.3V buck converter to drop the motor's 5V supply down to 3.3V for powering the LED backpacks. Grab a couple 10uF electrolytic capacitors if using the LD1117-3.3 regulator too.
- Female/Female jumper wires - If you solder male headers onto the LED backpacks then you'll want female/female wires to connect to each backpack. You could skip these and solder wires directly to the LED backpack terminals as an alternative.
- Breadboard and male/male jumper wires - For prototyping and connecting components together a breadboard and jumper wires will be very handy. Once everything is working you can solder components and wires to a perma-proto for a cleaner and more rugged setup.
- Soldering tools - You'll need to do a little bit of soldering to build this project. In particular you'll solder wires to terminals on the auto gauges, and solder LED displays and headers to the LED backpacks. If you're new to soldering be sure to follow the guide to excellent soldering and it will help to practice a bit on spare parts or other projects ahead of time.
- Wire - You need a bit of wire to solder to the terminals on the automotive gauges. I recommend the 26AWG silicone stranded wiring.
- Dry-erase foamboard or chalkboard foamboard - You can use almost anything as the base for your dashboard but dry erase or chalkboard foamboard is easy to cut and can be erased and reused easily.
- Sharp knife for cutting the foamboard. Be careful and use adult supervision when necessary.
- Electrical tape
Before you get started with the dashboard you'll need to first assemble and test the motor HAT & LED backpacks. Carefully follow each product's guide to assemble and test them:
In addition go through the following guide to install the Python LED backpack library and test using the backpacks from the Raspberry Pi:
For testing the auto gauge stepper motors with the motor HAT I found it easiest to solder wires directly to the four terminals on the back of the motor. Tin the terminals and the wires separately, then hold them against each other and flow the solder with the iron to make a firm connection.
Each 'column' of terminals is a separate coil of the stepper. Connect one column to a motor controller position like M1 and the other column to the other position on the terminal block like M2. The center GND pin of each stepper terminal will be unused.
Each LED backpack should be assigned a unique address so they can be connected to the Pi's I2C bus. Notice the 3 address solder pads on the bottom of the boards in the photo to the left. If you bridge a pad with solder it will enable that address bit. The address starts at 0x70, so the board on the left has address 0x76 (bits A1 and A2 are set, or 2+4=6) and the board on the right has address 0x71 (bit A0 is set, or 1).
It's very important that each LED backpack has a unique I2C address assigned by setting their address bits! If two devices happen to have the same address you'll see errors and unpredictable behavior.
Before moving on make sure you've tested each component individually by following it guide mentioned above! It's much easier to troubleshoot components when they're outside the assembled dashboard.
Use dry erase marker or chalk foamboard to build the dashboard. This will allow you to update and erase the labels to change what the dashboard displays.
Carefully trace the shape of each display and cut out an appropriate hole in the foamboard. Tape each display and motor to the dashboard.
For the automotive stepper gauges if your foamboard is thin (~1/4" thick) you can just poke a hole for the gauge shaft to stick through instead of cutting out a hole for the entire gauge.
Cover the HDMI port half of the Raspberry Pi with electrical tape if you don't have standoffs to hold the motor HAT. This will prevent HAT connectors from touching the Pi and shorting out.
If you do have Pi HAT standoffs use those instead to hold the Pi HAT and prevent it from touching the Pi.
Solder headers or wires onto the SDA, SCL, 3.3V, 5V, and GND pins (on the far right of the HAT, not shown) to allow connecting LED displays to the I2C bus.
Now wire up the auto gauge steppers to the motor HAT terminals as you did when testing them earlier.
Connect the 5V motor power supply to the positive (+) and negative (-) motor power terminals on the motor HAT.
For each LED backpack connect its clock (C) / SCL pin to the Pi's SCL header, and its data (D) / SDA pin to the Pi's SDA header.
If you're just using ~1-3 LED backpacks then you can power them directly from the Pi. Connect each backpack's negative (-) power header to the Pi's GND, and positive power (+) header to the Pi 3.3V power (NOT the 5V power!). However for the large 1.2" 7-segment backpack it works best with 5V power instead of 3.3V so connect its positive (+) header to the Pi 5V power. For the large 1.2" 7-segment and quad alphanumeric backpack connect their extra V_IO / Vi2c line to the Pi 3.3V power (NOT the 5V power!).
NOTE: If your 1.2" display doesn't seem to work when connected to 5V power there might be slightly too much difference between the 5V power and Pi's 3.3V I2C signal. Put a power diode in series before the 5V enters the display positive terminal (remember the striped side of the diode is the cathode/negative side and should face away from the positive 5V power) to slightly drop the 5V down to a level the display can better work with.
If you're using more than about 3 backpacks at once you might find the Pi can't supply enough power to drive them all at the same time. This might manifest as flakey dislays that don't show up with the i2cdetect command, or dimly lit LEDs that pulse and strobe visibly. In this case its best to use a dedicated 3.3V power supply to drive all the backpacks instead of the Pi's 3.3V supply. As mentioned in the parts you can use a 3.3V regulator to drop down the 5V motor power supply voltage to the 3.3V the LED backpacks need to operate. See the diagram below for an example of wiring a LD1117-3.3 regulator (and two 10uF electrolytic capacitors) to multiple LED backpacks:
Once assembled go through and carefully check each display and auto gauge can be controlled just as your tried in testing earlier. This will make sure you don't have any problems with connections, power, wiring, etc.
Finally label your dashboard with whatever metrics you'd like to display! A couple examples of dashboards are below:
Continue on to learn how to install and setup the software for the dashboard.