-
Notifications
You must be signed in to change notification settings - Fork 0
Software
Charles Zhou edited this page Apr 20, 2023
·
4 revisions
The onboard transmitter uses the following sensors to gather data:
- VL53L0X: Time-of-flight sensor
- BMP388: Pressure sensor
- LSM6DS33: Accelerometer, gyroscope, and magnetometer
SkyNet consists of two main parts:
- Hardware components (onboard transmitter and receiver) written in C++ using standard Arduino practices.
- Ground software written in TypeScript using Node.js, Rust, and Tauri.
- The transmitter interfaces with sensors via I2C, collects data, and sends the data in a package via LoRa following the specified package format.
- The receiver reads the data package, appends the package RSSI, and prints it out via serial.
- The ground software reads the serial printout, parses it into a JSON structure, and plots and displays the data.
[Onboard Transmitter] [Receiver] [Ground Software]
Sensors (LoRa) (Tauri App)
| | |
v v v
+----------------+ +----------------+ +----------------+
| Interface with | | Read data | | Read serial |
| sensors via |------>| package & |------>| printout |
| I2C & collect | | append RSSI | | |
| data | | | | |
+----------------+ +----------------+ +----------------+
| |
v v
+----------------+ +----------------+
| Print data | | Parse into |
| package via | | JSON structs |
| serial | | |
+----------------+ +----------------+
|
v
+----------------+
| Plot & display |
| data |
+----------------+
The program logic is implemented in the loop function, which executes continuously and performs the following tasks:
-
Initialize the program and sensors using the setup function.
-
Check the current state of the transmitter and perform appropriate actions based on the state:
-
IDLE
: Check if the rocket should be armed and send sensory states. If an arm command is received, change the state to ARMED. -
ARMED
: Check if the rocket has launched. If launched, change the state to LAUNCHED. -
LAUNCHED
: Gather data from sensors and transmit it wirelessly to the ground station. Check if the rocket has landed. If landed, change the state to RECOVERY. -
RECOVERY
: Send GPS coordinates and wait for recovery.
-
-
Wait for a specified amount of time before rerunning the loop.
Data, mostly floats, is sent byte by byte using a uint8_t array for the LoRa library to transmit. The transmitted data is then reconstructed back to float. Time-of-flight (ToF) data is the only exception and is uint8_t. The package payload size is 49 bytes.
tof_data, bmp.temperature, bmp.pressure, bmp.readAltitude(SEALEVELPRESSURE_HPA), accel_event.acceleration.x, accel_event.acceleration.y, accel_event.acceleration.z, gyro_event.gyro.x, gyro_event.gyro.y, gyro_event.gyro.z, mag_event.magnetic.x, mag_event.magnetic.y, mag_event.magnetic.z
Package RSSI