G2's Blog

A Rocket Telemetry System

February 13, 2024

In preparation for competing in Battle of the Rockets 2024 with my university rocket club, I was tasked with creating a telemetry system to meet the requirements for the Deployable Sensor Payload event. In this event, the goal is to launch a rocket to a height of between 1000 and 1,500 feet (300 - 460 meters), and transmit data to a ground station in real time during the whole flight. The requirements also state a minimum update rate of the telemetry of 2 Hz (2 times per second).

The materials the club had available for this event included multiple Adafruit Feather RP2040's with built-in LoRa radios, which was great because I had worked with the RP2040 chip pretty extensively in the past, and used it in my own personal projects. My telemetry design is based around both the limitations and strengths of the proprietary LoRa protocol, in that it has quite long range and is relatively robust, but has low bitrate and can suffer from data loss with long transmissions. Because of this, the packet size has been kept as small as possible, I have been able to fit all the required data in 28 bytes, but with variable integer encoding this will probably be reduced further in practice. The packet design looks something like the following Rust struct:

Packet {
    time: Time {    // 10:13:23.132831
        hours: 10,
        minutes: 13,
        seconds: 23,
        microseconds: 132831,
    },
    lat: 40730610,  //  40.730610°
    lon: -73935242, // -73.935242°
    alt: 2209,      // 2,209 meters
    temp: 10,       // 10°C
    pres: 7949,     // 794.9 millibars
    accel: Accel {
        x: 1,       // 0.1g
        y: 2,       // 0.2g
        z: 13,      // 1.3g
    },
};

Because the packet is small enough, using a spreading factor of 7 on the LoRa transmitter at 500khz bandwidth should result in a data rate of approximately 40-50 Hz, which far exceeds the requirements for the competition. Additionally, the design of the packet should be future-proof for any further designs which may wish to utilize it for a low cost and long range omnidirectional telemetry system.

The code is written in Rust, utilizing the Embassy project which I talked about in the previous post. I am writing it to be as robust as possible, in case of sensor failure or faulty wiring it will not crash or lock up, ensuring at least some of the data are returned to the ground station. Speaking of the ground station, the receiver will use another RP2040 Feather with possibly a directional antenna and a Raspberry Pi 4B for processing and displaying the data on a screen to meet the requirement that data must be displayed as text in real time, and extra points for a graph, which the Pi should be able to handle easily. The current plan is to write the display code in Python which will take in data from the Feather via a serial connection.

If you are interested in this project, the full code is available on the club's GitHub:

https://github.com/UNL-Husker-Rocketry/sensor-payload-2024