Structure the firmware
CubeMX-generated hardware initialization remains in C while the application layer is written in modular C++. CMSIS-RTOS v2 tasks separate heartbeat, room-data generation, and serial transmission responsibilities.
My current build combines an STM32 NUCLEO-L476RG, real-time task scheduling, sensor interfaces, UART telemetry, and a live Python dashboard into one end-to-end embedded system.
Project overview
The Room Environmental Monitor is an in-progress embedded system for measuring temperature, humidity, pressure, light, and motion. The firmware already builds and runs with simulated room data, a FreeRTOS task architecture, message-queue communication, and USART2 telemetry. On the computer side, Python receives the data, logs it to CSV, detects board resets, and renders a live Matplotlib dashboard.
Engineering approach
CubeMX-generated hardware initialization remains in C while the application layer is written in modular C++. CMSIS-RTOS v2 tasks separate heartbeat, room-data generation, and serial transmission responsibilities.
roomDataTask produces structured RoomData messages and places them in a FreeRTOS queue. serialTask receives each message and transmits a scaled CSV record through USART2 at 115200 baud.
Python tools monitor the serial stream, log measurements to CSV, display a live Matplotlib dashboard, and identify a board reset when the sample counter returns to zero.
The next milestone is the BME280: solder its header, enable I2C1 on PB8 and PB9, scan for address 0x76 or 0x77, confirm the chip ID, then replace simulated environmental values with real readings.
Technical highlights
FreeRTOS tasks with CMSIS-RTOS v2
Room-data message queue
USART2 telemetry through ST-LINK virtual COM
Python CSV logging and live dashboard
Planned staged bring-up of eight hardware modules
What I learned
The project is teaching me to build an embedded system incrementally: establish a reliable software architecture first, define and verify the data path, and then bring up one physical sensor at a time without breaking working behavior.