- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
04-02-2017 03:04 PM
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:
- Glued to the DC motor, transmitting gyroscope data from the IMU.
- Inside the vacuum chamber transmitting pressure.
- Transmitting the light-level with the light-sensor.
- Sampling the sound-level with the microphone.
- A master that could tune into transmissions from either of the other Thunderboards, logging the output to screen and also showing how much the slave deviated from "normal" status by using the RGB LEDs.
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()
05-27-2017 06:22 AM
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.