STM32 Cansat

Status: Past Project (Nov 2020 – Feb 2021)

Electronic Systems

For the 2020/21 Manchester Cansat Competition, I worked in a team of 4 others at the Imperial College Space Society to develop a small "can sized satelite"(cansat) which would be deployed from a rocket or drone at 250m. It would be required to collect sensor data on its way down. I was the avionics lead and handled the sensors, PCB design, power systems and telemetry.

It was during this project where I moved away from Arduino to the STM32 ecosystem, and got exposed to many new things, greatly improving my firmware and hardware skills.

Overall project github: https://github.com/ImperialSpaceSociety/Cansat-2020-team-1

Avionics Requirements

CAD of the entire cansat (made by the rest of the team).

Chipset

Coming from the Arduino environment, I was tempted to use the ATmega ICs however I had recently bought a STM32 Bluepill (STM32f103CBT8) due to its performance for its very low price. This was the perfect project to get myself familiar with the STM32 ecosystem since I was sure I would use the STM32s again in the future.

I really liked the pin assignment page in STM32CubeIDE coming from using the Arduino IDE. Unfortunately I could not get the SD card working in the CubeIDE and eventually switched back to the Arduino IDE.

STM32CubeIDE visualiser.

Sensors

Thanks to the DIY maker community, dozens of sensor breakout boards were available. In the end, I decided to use the following breakout boards:

GY-91

This breakout board actually has the BMP-280 and the MPU-9250 ICs on the same board. An added bonus is the fact that the MPU-9250 actually houses two sensors inside it, being the AK-8963 and MPU-6500, a magnetometer and a 6DoF IMU respectively. 

(Thank you based InvenSense)

GY-91 breakout board. Essentially 10DoF.

I also had previously used the BMP-280 and the MPU-6050 (variant of the MPU-6500) in my previous rocketry project so I was familiar with their register maps and the way they output data.

The only new sensor would be the AK-8963 magnetometer.

Sensor Data Decoding

The GY-NEO6MV2, BMP-280 and MPU-6500 data decoding was relatively easy considering they are very popular sensors. All of them have many libraries and their datasheets go into more detail than I can possibly fit in this page. Useful libraries for the MPU-9250 [1] [2].

The main challenge was dealing with the magnetometer. To deal with the hard iron offsets, I wrote a small magnetometer visualiser program in Processing.

By rotating the sensor around and plotting the measurements, the offset can be calculated.

Unfortunately it takes a few minutes to get enough data points and requires manual input. It also doesn't correct for soft iron offsets.

Processing visualisation of magnetometer readings. Code at my github [3].

Power Delivery

Since we were not allowed to use lithium batteries, the only other solutions were using a combination of AA/AAA batteries or a 9V battery. The internal resistance of AA/AAA batteries were too high so I decided to use a 9V battery.

Power delivery plan and requirements. All current estimates are for continuous maximum usage. A generous 90% efficiency was chosen for the buck when it really should be around 80%.

LoRa Telemetry

Data Packet and LoRa Settings

First was to design our data packet:

Data packet structure according to competition requirements. 69 bytes long.

Next was to choose LoRa settings:

This allows the maximum bytes per second to be calculated with:

Time 2:04 of [4]. Channel has a great series on LoRa.

Now to calculate the number of packets requires us to calculate the size of the entire LoRa data packet:


Page 7 of [5].

Finally the packet rate can be calculated with:


Antennae and Link Budgets

With the LoRa settings above, a RX sensitivity minimum can be calculated:

Noise figure (NF) is fixed for each hardware implementation. For the SX1276, NF = 6 dB. From page 13 of [7].

Signal noise ratio (SNR) is a function of spreading factor and can be read off Table 13 from page 27 of [6].

Page 3 of [5].

PCB Antennae

Due to weight constraints, we had to use a PCB antennae. I attempted designing some with the program 4nec2 [8] but didnt end up with any usable ones.

In the end, it was a Texas Instruments application notes that saved me. DN035 [9] and DN038 [10] let me use one of their proven designs. Especially helpful was the CTIA OTA reports that gave the antennae gain in all directions at 868MHz.

Gain in all directions. Page 15 of [10].

Cheeked up helical antennae. Simulated in 4nec2.

Finally, the link budget can be calculated below in the excel table. Path loss is the signal drop due to distance and can be calculated using the free space path loss equation [11].

With distance (d) in km and frequency (f) in MHz.

From [11].

Excel calculator for link budget visualisation. Available on my GitHub [12]. A link budget of 24.2dB is present.

PCB Layout + Schematic

For the PCB, a simple 2 layer board of 1.0mm thickness was used. Component selection was from eBay and the parts that JLCPCB offer for assembly. My design allowed for existing modules (Buck converter, GPS, 10DoF Sensor, LoRa) to be soldered onto the board, giving more room to route traces underneath.

The PCB antennae is not very well located since there is a massive ground plane in the way.

Made using EasyEDA. Project files found here:

 https://oshwlab.com/tfang15532/2020-cansat

Not too sure if JLCPCB will allow me to get that free PCB antennae by hiding it inside the unused space underneath the GPS module.

Soldering and Testing

For testing purposes, I put the circuit together on a breadboard and later soldered it together with dot board.

Due to covid19, we were not able to physically attend gather for the competition and thus did not get to build our Cansat. In the end, we were judged on our design briefs, landing us fourth place.

Since there was no need for working prototypes, my interest in this project waned and I eventually stopped working on it since my other projects were becoming more interesting.

Overall it was a great project to get into more advanced electronics and the STM32 ecosystem.






Project github: https://github.com/ImperialSpaceSociety/Cansat-2020-team-1

Cansat and ground station.