A few months back, Raspberry Pi brought out a very very nice little case for the Pi Zero, including 3 different front plates one of which accepts the Sony Pi camera. After several minutes measuring the internal dimensions, I reckoned I could just about fit the parts for a HAB tracker inside, and came up with this:
Just add batteries.
That one was for 434MHz, and I wanted another for 868MHz, so I thought I’d document the build in case anyone else wants to make one.
First, you need these parts for the build:
- Raspberry Pi Zero or Zero W
- Pi Zero case
- Pi Sony Camera
- Some solid core hookup wire
- UBlox GPS with chip antenna from Uputronics
- LoRa module from Uputronics
- SD card 8GB or larger
Plus a soldering iron, solder, wire cutters and a Dremel with cutting disc. I assume that you also have the parts required to power and operate a Pi Zero (all the Zero suppliers provide kits). For a flight, you will also need 3 Lithium AAA or AA cells, flexible hookup wire, plus Styrofoam or similar to enclose and protect the tracker.
If you are new to soldering, practice on something else first! We are going to solder wires directly to the Pi GPIO holes, plus those on the radio and GPS boards, which isn’t the most delicate soldering operation ever but may be daunting for those with no soldering experience.
First, cut 4 short lengths of the solid-core wire, and solder to the Pi Zero as shown (making sure that the wires are on the top of the board!).
I’ve left a very short piece of insulation on the bottom-right wire, but you can remove that completely if you wish.
Next, bend the two top-right wires out of the way, and fold over the leftmost wire and cut to the length shown – this wire will connect to the Vcc hole (top one) on the GPS.
The next part is moderately fiddly: Push the short wire on the left into the Vcc hole, and then push the GPS module over the short bottom-right wire so that this wire goes through the GND hole on the GPS module:
Then push the GPS module down flat on top of the SD socket on the Pi, and solder those 2 wires (Vcc and GND) on the GPS module:
Those last 2 wires can now be bent round and connected to the GPS; the wire in the right of the above photo (Tx on the Pi) above goes to the RXD hole whilst the other (Rx on the Pi) goes to the TXD hole:
Cut the wires to length, bare the ends, push slightly into the holes then solder them.
That’s the GPS sorted.
This is the radio module for communication with the ground. This has a few more connections to make, and is a bit more fiddly.
First, place wires in these holes as shown, and solder them in place:
Be sure to use the correct holes, by counting from the right edge of the Pi Zero; don’t do it relative to any components because those can vary in position (the Zero and Zero W have the CPU in a different position, for a start!).
Now add 3 bare wires as shown:
The next step is optional. We need to provide some mechanical security for the radio, to keep if slightly away from the Pi so nothing gets shorted. This could be a double-sided sticky pad or, as here, a 4th solid wire but this time soldered directly to a capacitor on the Pi. If that sounds daunting, use the pad! Here’s the wire, ‘cos that’s how I roll:
Once soldered, remove the insulation.
Now it’s time to place the LoRa module on those 3/4 bare wires:
If you are using a sticky pad, place it now, on the underside of the LoRa module, then push the module down so it’s stuck to the Pi.
If instead you are using the 4th wire, push the LoRa module down but maintain a 1-2mm gap between it and any components on the Pi.
Then cut to length and solder them to the LoRa module.
Now we can cut each of the other wires to length and solder them to the LoRa module:
Until we have the tracker completely soldered together:
Using a Dremel or similar with cutting disc, cut a slot in the case for the GSM module to poke out. This will take some trial-and-error till the module fits comfortably.
Then drill a hole in the opposite end, in line with the corner pin on the LoRa module. The hole diameter needs to be wide enough to push a wire through it.
Connect the short flat camera cable (which came with the case) to the Pi, then insert in the case.
Cut a piece of wire to length (164mm for 434MHz), bare and tin and few mm at one end, insert through the hole and solder to the corner pin on the LoRa module. Finally, connect the camera to the cable, push fit the camera into the lid, and close the lid on the case.
First, follow the standard instructions to build a standard PITS SD image.
We then need to modify the configuration file (/boot/pisky.txt) to tell it that we are using this tracker instead of a standard PITS tracker. Here’s a sample pisky.txt file to work with:
payload=CHANGEME disable_monitor=N frequency=434.250 baud=300 camera=Y low_width=320 low_height=240 high=2000 high_width=640 high_height=480 image_packets=4 enable_bmp085=N external_temperature=1 logging=GPS,Telemetry Disable_RTTY=Y info_messages=2 gps_device=/dev/ttyS0 full_low_width=640 full_low_height=480 full_high_width=2592 full_high_height=1944 full_image_period=60 LORA_Frequency_1=434.200 LORA_Payload_1=CHANGEME LORA_Mode_1=1 LORA_DIO0_1=23 LORA_DIO5_1=29
The lines in bold are important:
- Disable_RTTY=Y – this disables RTTY (we don’t have a PITS RTTY transmitter)
- gps_device=/dev/ttyS0 – this specified that we have a serial GPS not I2C as on PITS
- LORA_Frequency_1=434.200 – this sets the frequency of our LoRa module
- LORA_Payload_1=CHANGEME – you must set this to a name for your flight
- LORA_Mode_1=1 – this sets LoRa mode 1 which is the only usually used for SSDV
- LORA_DIO0_1=23 – this specifies the Pi pin we connected the LoRa DIO0 pin to
- LORA_DIO5_1=29 – this specifies the Pi pin we connected the LoRa DIO5 pin to
You will need to have or make a LoRa gateway to receive transmissions from your tracker.
You will also need to provide a power supply to the tracker. This can be any USB powerbank with enough capacity, however the batteries may stop working if they get cold during flight. An alternative is a powerbank that takes AA cells, in which case you can use Eneergizer AA Lithiums. Finally, and this is the option you will want for a lightweight payload, simply solder 3 Energizer Lithium cells directly to the 5V/GND pads on the Pi.