Another goal of NUTS is trying to promote aerospace/STEM topics among other students. Last fall we participated in "Researchers Night" at NTNU, which is used to promote STEM education among high school students. A lot of institutes and organizations show up at Researchers Night with really flashy displays, such as flamethrowers or slightly violent chemical reactions.
At our disposal we had a vacuum chamber, a DC-motor, space-grade and regular solar panels, and several Thunderboard Senses. Showing off how marshmallows behave in vacuum, and how the DC motor behaves when connected to the different solar panels might be interesting enough in and of itself. However we decided to add some Thunderboards to spice it up a bit.
Using a budding implementation of MicroPython for Thunderboard Sense (which will be released soon), we brainstormed and programmed a small sensor network for our stand, simulating logging telemetry data from our satellite. The Thunderboards were utilized as follows:
I have embedded two video. The first one gives a short overview over the entire project, while the second shows the setup in action, logging data from the vacuum chamber.
Our stand was a great success! We got several people standing around for up to half an hour discussing intricacies of satellite development as well as giving us an opportunity to talk more about the satellite radio link.
At last I want to brag a bit about how neat this code turned out with MicroPython, and how MicroPython really was ideal for bringing up a project like this in such a short time. The code for reading data from the IMU and transmitting it ended under 40 LOC.
from tbsense import * from radio import * from math import sqrt rdio = Rail() i = IMU(gyro_scale = IMU.GYRO_SCALE_2000DPS, gyro_bw = IMU.GYRO_BW_12100HZ) def float_to_pkt(flt): integer = int(flt) decimal = round(flt, 3) - integer decimal = int(decimal*1000) ret = bytearray(6) ret = (integer >> 24) & 0xFF ret = (integer >> 16) & 0xFF ret = (integer >> 8) & 0xFF ret = integer & 0xFF ret = (decimal >> 8) & 0xFF ret = decimal & 0xFF return ret def loop(): meas = i.gyro_measurement() meas = sqrt((meas**2)+(meas**2)+(meas**2)) pkt = float_to_pkt(meas) rdio.tx(pkt) delay(200) def init(): rdio.init() rdio.channel(MODE_IMU) i.init() delay(2000) init() while True: loop()
What is the hardware for MicroPython?
I used MicroPython on the Thunderboard Sense, which uses the EFR32 Mighty Gecko. However I am currently unable to release the binary or the code for that implementation, but it will be available in due time.
If you are just interested in testing out MicroPython I recommend you check out the official home page of MicroPython, where you can test it out live at this site. Note that this runs on a pyboard, which is based upon STM32.
Your code example looks very promising.
Is there a way to get your current implementation of Micropython for EFR32 ?
Any plan to post it in the official Micropython repository or in a separate one ?