Title: Wearable Tracking Device for Miners
By: sunnyiut
Design Challenge: Safe and Sound Wearables
Blog number: 10
Intro:
This blog is based on MSP432P401r and BME280 Environmental Sensor interface.
The BME280 Environmental Sensor will provide three different measurements.
- ambient temperature
- ambient relative humidity
- atmospheric pressure
According to my project proposal I have to design a wearable device mounted on the wrist of the Miners.
This wearable device consists of several sensors to collect environmental information.
In this blog post, I'll focus on
- the interfacing of the BME280 and the MSP432P401r MCU
- display the ambient temperature, humidity and pressure on TFT
- send data to PC UART for graphical representation [only one parameter at once]
- Sensors Boosterpack
- MSP432 Launchpad
- TFT Proto
- mikroplot [UART PC GUI]
Compiler:
MikroC pro for ARM - from MikroElektronika
Firmware:
Full source code and circuit diagram can be found in LIBSTOCK.
dependencies -
- BME280_Driver.c [weather click]
- BME280.c
- mikroplot UART.c [mikroplot]
- TFT
- TFT def
BME280 [BOOSTXL-SENSORS]:
BOOSTXL-SENSORS boosterpack carries BME280, an integrated environmental sensor from BOSCH.
It’s a small low power single chip sensor that measures temperature, pressure and humidity.
It communicates with the MSP432 Launchpad through I2C.
BME280 I2C address = 0x77
Interfacing:
Initialization parameters -
void BME280_INIT() { BME280_SetStandbyTime(BME280_STANDBY_TIME_1_MS); // Standby time 1ms BME280_SetFilterCoefficient(BME280_FILTER_COEFF_16); // IIR Filter coefficient 16 BME280_SetOversamplingPressure(BME280_OVERSAMP_16X); // Pressure x16 oversampling BME280_SetOversamplingTemperature(BME280_OVERSAMP_2X); // Temperature x2 oversampling BME280_SetOversamplingHumidity(BME280_OVERSAMP_1X); // Humidity x1 oversampling BME280_SetOversamplingMode(BME280_NORMAL_MODE); }
Configuration -
void BME280_config(){ BME280_ReadCalibrationParams(); //Read calibration parameters BME280_SetOversamplingPressure(BME280_OVERSAMP_1X); BME280_SetOversamplingTemperature(BME280_OVERSAMP_1X); BME280_SetOversamplingHumidity(BME280_OVERSAMP_1X); BME280_SetOversamplingMode(BME280_FORCED_MODE); while(BME280_IsMeasuring()); BME280_ReadMeasurements(); }
Circuit Diagram:
MSP432P401r with BME280 TFT display connection
Output:
The output of BME280 is pretty stable.
For indoor experiment, it gives the following readings -
- ambient temperature = 30.6 'C
- relative humidity = 79.8 %
- atmospheric pressure = 100.1 KPa
I have sent these data [one parameter at a time] to PC GUI for plotting.
I have used 'mikroplot' to graphically represent continuous 8 seconds readings.
Temperature -
Humidity -
Pressure -
That's the end of this blogpost. In my next blog, I'll interface the TMP007 temperature sensor and display the output data on TFT.
Top Comments