Skip to content

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:

  1. Peel off 2 wires from the bunch of ribbon cables.
  2. Cut to 11 cm in length measuring from the female side.
  3. Shorten LED leads to 3 and 6 mm respectively, making sure to leave a length difference.
  4. Shorten resistor leads to 3 mm on each side
  5. Cut 2.5 mm heat shrink tube to size, a couple of mm longer than resistor span
  6. Solder resistor to shorter LED lead using flux
  7. Strip one wire in strand
  8. Hold LED and resistor next to strand so that tip of stripped wire is level with bottom of LED
  9. Cut other wire so that its end is level with bottom end of resistor body
  10. Strip said wire
  11. Flux and tin wire tips
  12. Push 2.5 mm heat shrink tube over shorter wire, 1 mm heat shrink tube over longer wire
  13. Solder short wire end to open resistor lead using flux
  14. Solder longer wire to open LED lead using flux
  15. Push heat shrink tubes up against LED
  16. Use heat gun to shrink tubes

Once you are done with these steps you should have something that looks like this:

Assembled LED

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:

  1. Divide short ribbon into strands of 4 wires each
  2. Remove male ends
  3. Strip insulation from individual wires
  4. Apply flux and tin to stripped wire tips
  5. Push heat shrink tubes over wire tips
  6. Hold PCB components down and screw holes facing away
  7. 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.
  8. Clamp board into third hand or similar without tinned ends slipping out of holes
  9. Prop up wire strand from below to keep ends inserted
  10. Flux holes with ends
  11. Solder tinned tips to holes
  12. Using flush cutters, snip off solder and wire tips protruding past bottom of PCB
  13. Re-melt solder in holes for smoother surface
  14. 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: Assembled Accelerometer

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:

  1. Cut ribbon to 13.5 cm length, removing both male and female ends
  2. Divide into strands of 4 wires each
  3. Peel individual wires apart at each end to about 3 cm
  4. Strip insulation from individual wires
  5. Flux and tin wire tips
  6. Push about 1.25 cm of heat shrink tube over each wire, continuing up as much as the wire allows
  7. If necessary, bend USB A pins to be at right angle to connector and parallel to each other
  8. Flux and tin pins
  9. Starting with a center pin, solder a tinned wire end to each pin
  10. Push up heat shrink tubes against pins and apply heat gun to shrink
  11. Flux and tin micro USB pins (only one of the pins on the two-pin side needs connecting, refer to diagram above)
    USB Connector Diagram
  12. Attach wires to pins according to diagram above
  13. Push up heat shrink tubes against pins and apply heat gun to shrink
  14. 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:
USB Connector USB Connector Close 1 USB Connector Close 2

Assembly

  • Remove waveshare from packaging, take styrofoam protector off GPIO pins and turn board upside down. This is what you should see: Waveshare
  • Slide sim connector to the right to open:
    Waveshare SIM Connector
  • Thread male end of sim extender through bracket as shown:
    Waveshare connecting to SIM extender 1
  • Pull male end through further, then feed into bracket as shown:
    Waveshare connecting to SIM extender 2
  • Close bracket on connector, making sure that sim male end fits into connector cutouts, then slide top bracket to the left to secure
    Waveshare connecting to SIM extender 3
  • Remove pi from packaging, turn upside down and insert micro SD card with OS image into card slot as shown:
    Raspberry Pi with SIM
  • 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.
    Raspberry Pi and Waveshare attaching
  • 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
    Raspberry Pi and Waveshare attached
  • 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
    Raspberry Pi and Waveshare attached
  • Connect Pi and waveshare USB ports through cable as shown. Note that cable may look different from image
    Connected Raspberry Pi and Waveshare
  • 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: setting ngrok 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.

  1. Thread two M2 nuts each onto 2 M2 x 10mm screws. Attach fan to case using top two fan housing screw holes
  2. Put an M2 nylon washer each onto 2 M2 x 5mm screws. Attach SIM extender to case using top two extender screw holes
  3. Put an M2 nylon washer each onto 2 M2 x 6mm screws. Attach accelerometer to case using top two accelerometer screw holes
  4. 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.