Babyshark Open-source Hardware Documentation:
NOTE: the code to run on the hardware is kept here
Bill of Materials
Below are the materials used by the Cal-ITP team to construct the original Baby Shark. These materials are not requirements, rather they are suggestions. So long as the end product meets the product goals and is completed at a low cost, modifications are allowed and encouraged.
Item # | Component | Units | Unit cost | Notes |
---|---|---|---|---|
1 | Raspberry Pi 4 GB | 1 | $59.54 | Open source hardware |
2 | SIM7600A-H 4G HAT | 1 | $78.58 | Make sure that you are choosing the correct region for this product |
3 | Cooling Fan | 1 | $3.60 | |
4 | 470 Ohm resistor | 1 | $0.84 | |
5 | Ribbon cables 8inch, 4-wire strand | 1 | $0.86 | |
6 | Accelerometer | 1 | $7.35 | |
7 | SIM Extender | 1 | $19.60 | |
8 | 15mm M2 nylon spacer | 4 | $0.16 | |
9 | 25mm flathead M2 screw | 4 | $0.14 | |
10 | 5mm flathead M2 screw | 2 | $0.25 | |
11 | 4mm flathead M2 screws | 4 | $0.25 | |
12 | 6mm flathead M2 screws | 4 | $0.13 | |
13 | 1mm heat shrink tubes | 0.5 | $0.85 | Units is in feet |
14 | USB-C extender | 1 | $4.54 | |
15 | M2 nylon washer | 20 | $0.04 | |
16 | SD card | 1 | $8.62 | |
17 | Raspberry pi power connector | 1 | $10.60 | Open source hardware |
18 | uxcell USB 2.0 Type A Male Socket Connector Jack Port | 1 | $0.62 | |
19 | WEIJ 20 Pcs Micro USB Male Type B 5-Pin Jack Port Solder Connector | 1 | $0.71 | |
20 | LED | 1 | $0.46 | |
Total: | $197.75 |
Pre-Fabrication
1. LED
Components include (numbers correspond to Bill of Materials above):
- 01 - Raspberry Pi 4 GB
- 04 - 470 Ohm resistor
- 05 - Ribbon cables 8inch, 4-wire strand
- 13 - 1mm heat shrink tubes
- 20 - LED
To assemble the LED, go through the following steps:
- Peel off 2 wires from the bunch of ribbon cables.
- Cut to 11 cm in length measuring from the female side.
- Shorten LED leads to 3 and 6 mm respectively, making sure to leave a length difference.
- Shorten resistor leads to 3 mm on each side
- Cut 2.5 mm heat shrink tube to size, a couple of mm longer than resistor span
- Solder resistor to shorter LED lead using flux
- Strip one wire in strand
- Hold LED and resistor next to strand so that tip of stripped wire is level with bottom of LED
- Cut other wire so that its end is level with bottom end of resistor body
- Strip said wire
- Flux and tin wire tips
- Push 2.5 mm heat shrink tube over shorter wire, 1 mm heat shrink tube over longer wire
- Solder short wire end to open resistor lead using flux
- Solder longer wire to open LED lead using flux
- Push heat shrink tubes up against LED
- Use heat gun to shrink tubes
Once you are done with these steps you should have something that looks like this:
2. Accelerometer
Components include (numbers correspond to Bill of Materials above):
- 01 - Raspberry Pi 4 GB
- 05 - Ribbon cables 8inch, 4-wire strand
- 06 - Accelerometer
- 13 - 1mm heat shrink tubes
Notes:
- Wire length = 9 cm
- Be sure to use 1 mm heat shrink tube
- Accelerometer ground (gnd) to pi gnd (6)
- Accelerometer vcc to pi 3v3 (1)
- Accelerometer sda to pi sda (3)
- Accelerometer scl to pi scl (5)
(numbers in parentheses correspond to pins on the Raspberry Pi’s general IO connector.)
To assemble the Acceleromter, go through the following steps:
- Divide short ribbon into strands of 4 wires each
- Remove male ends
- Strip insulation from individual wires
- Apply flux and tin to stripped wire tips
- Push heat shrink tubes over wire tips
- Hold PCB components down and screw holes facing away
- Stick tinned ends through two leftmost and two rightmost solder holes on the accelerometer board when it is oriented so that the components face the user and the holes face down.
- Clamp board into third hand or similar without tinned ends slipping out of holes
- Prop up wire strand from below to keep ends inserted
- Flux holes with ends
- Solder tinned tips to holes
- Using flush cutters, snip off solder and wire tips protruding past bottom of PCB
- Re-melt solder in holes for smoother surface
- Push up heat shrink tubes against PCB and shrink with heat gun
Once you are done with these steps you should have something that looks like this:
3. USB Connector between Raspberry Pi and Waveshare
Components include (numbers correspond to Bill of Materials above):
- 01 - Raspberry Pi 4 GB
- 02 - SIM7600A-H 4G HAT
- 05 - Ribbon cables 8inch, 4-wire strand
- 13 - 1mm heat shrink tubes
- 18 - Micro USB 2.0 Type A Male Socket Connector Jack Port
- 19 - WEIJ Micro USB Male Type B 5-Pin Jack Port Solder Connector
To assemble the Pi/Waveshare connector, go through the following steps:
- Cut ribbon to 13.5 cm length, removing both male and female ends
- Divide into strands of 4 wires each
- Peel individual wires apart at each end to about 3 cm
- Strip insulation from individual wires
- Flux and tin wire tips
- Push about 1.25 cm of heat shrink tube over each wire, continuing up as much as the wire allows
- If necessary, bend USB A pins to be at right angle to connector and parallel to each other
- Flux and tin pins
- Starting with a center pin, solder a tinned wire end to each pin
- Push up heat shrink tubes against pins and apply heat gun to shrink
- Flux and tin micro USB pins (only one of the pins on the two-pin side needs connecting, refer to diagram above)
- Attach wires to pins according to diagram above
- Push up heat shrink tubes against pins and apply heat gun to shrink
- Check if the cable is working by connecting the Raspberry Pi and the waveshare and running 'microcom -D /dev/ttyUSB2'. At prompt, enter 'at'. If the cable is correctly connected, waveshare will reply with 'OK'.
Once you are done with these steps you should have something that looks like this:
Assembly
- Remove waveshare from packaging, take styrofoam protector off GPIO pins and turn board upside down. This is what you should see:
- Slide sim connector to the right to open:
- Thread male end of sim extender through bracket as shown:
- Pull male end through further, then feed into bracket as shown:
- Close bracket on connector, making sure that sim male end fits into connector cutouts, then slide top bracket to the left to secure
- Remove pi from packaging, turn upside down and insert micro SD card with OS image into card slot as shown:
- Connect pi and Waveshare GPIO pins, being careful to properly align both banks. Don't insert pins all the way; leave 1mm of space. See step 8.
- Further connect boards using 4 M2 25 mm screws, 8 M2 nylon washers and 4 hex M2 nylon spacers, as shown. Then push GPIO pins in all the way
- Connect LTE cable to board MAIN and GPS cable to board GNSS as shown. There needs to be a clearly audible snap from each connector
- Connect Pi and waveshare USB ports through cable as shown. Note that cable may look different from image
- Connect LTE and GPS antennas, display, keyboard, mouse and power
- Boot up pi. There may be a message about resizing the root file system and then the screen may go and stay blank. If that happens, wait a few minutes, then unplug and restart the pi
- Go through the operating system (OS) setup process, make sure to configure a wireless network to join. Setup process may include substantial OS updates
- After updates complete, open up a terminal window and type:
mkdir projects
cd projects
git clone https://github.com/cal-itp/graas-hardware.git
cd graas-hardware
mkdir ~/tmp
cp setup-graas.cfg ~/tmp
- Edit
~/tmp/setup-graas.cfg
to populate unset values. Note: settingngrok
values is optional Note: check here for how to generate an ECDSA 256 signing key - In the opened terminal window type:
./setup.sh ~/tmp/setup-graas.cfg
- After pi reboots, log in with the password you set, open a terminal window and type
tf
. After you hit enter, you should see messages about sending GPS updates to the server if everything is set up right
Final Assembly
A 3D printed case was used to house the hardware. You can find a 3D .stl CAD model here.
Using the above case is not a requirement. However, the final product needs to be housed in a safe protective casing that does not pose a health or safety issue by exposing the internal components or by affecting the utility of the product.
- Thread two M2 nuts each onto 2 M2 x 10mm screws. Attach fan to case using top two fan housing screw holes
- Put an M2 nylon washer each onto 2 M2 x 5mm screws. Attach SIM extender to case using top two extender screw holes
- Put an M2 nylon washer each onto 2 M2 x 6mm screws. Attach accelerometer to case using top two accelerometer screw holes
- Attach USB-C extender to case using a glob of Kwik Weld or similar. Roughen plastic housing of extender with a few diagonal serrated knife cuts to provide better grip for the glue.