Skip to content

Task 01: Processing Pressure Sensor Data

Michael Bleier edited this page Jul 10, 2024 · 2 revisions

Connect your computer to the USB-C port of the Arduino in the Sensor Cube. Sensor messages are send over the serial port in JSON format. One JSON message per line. Every message/command must be followed by a line break.

The Sensor Cube includes a Bosch BMP280 pressure and temperature sensor:
https://www.bosch-sensortec.com/products/environmental-sensors/pressure-sensors/bmp280/

  1. Inspect the examples printSerialData and serializeHeartbeat.
  2. Another available sensor message is pressure_raw:
{"msg":"pressure_raw","stamp":0,"seq":0,"temperature":21.53,"pressure":98009}
  1. The pressure unit is Pascal.
  2. The message can be enabled by writing the following command to the serial port:
{"messages":["pressure_raw"]}
  1. Write a program that reads the pressure sensor messages and computes the altitude.

    On Wikipedia you can find a formula from the National Oceanic and Atmospheric Administration (NOAA) for directly converting atmospheric pressure in millibars (mb) to pressure altitude in feet (ft): https://en.wikipedia.org/wiki/Pressure_altitude

Clone this wiki locally