A secure environmental sensor node built around the STM32H5 microcontroller platform. This project implements hardware-based security features to collect, authenticate, and log sensor data, serving as a reference design for embedded security applications in IoT and industrial systems.
- Multi-Sensor Environmental Monitoring: Temperature, humidity, and barometric pressure sensing via Bosch BME280.
- Hardware Security Implementation: Utilizes STM32H5 TrustZone and Secure Manager for cryptographic operations.
- Secure Data Logging: Signed data storage to microSD card with integrity verification.
- Dual Connectivity: Wi-Fi and Ethernet interfaces for flexible deployment.
- Development-Friendly: Full STM32CubeIDE project with configuration tools.
This project requires the following hardware components:
| Component | Model / Specification | Purpose / Notes |
|---|---|---|
| Main Controller | STM32H573I-DK Discovery Kit (STM32H573IIK3Q MCU) | Core development board with Arm® Cortex®-M33, TrustZone®, touchscreen, Wi-Fi, and microSD slot. |
| Environmental Sensor | Bosch BME280 Breakout Module (I2C/SPI) | Measures temperature, humidity, and barometric pressure. |
| Power/Programming | USB 2.0 Type-C to Type-A Cable | Provides power and the debug/programming connection. |
| I2C Pull-up Resistors | 2 x 4.7 kΩ Resistors | Required for reliable I2C communication on the SDA and SCL lines. |
| Data Storage | microSD Card (≥ 8 GB recommended) | For secure logging of sensor data using a filesystem (e.g., FATFS). |
| Prototyping | Breadboard & Jumper Wires | For easy integration of pull-up resistors and other peripheral connections. |
The primary sensor connection is made via the board's Arduino-compatible header (CN7).
| Signal | STM32H573I-DK Pin (CN7) | BME280 Pin | Notes |
|---|---|---|---|
| I2C1_SDA (Data) | PB9 | SDA | Requires a 4.7 kΩ pull-up resistor to 3.3V. |
| I2C1_SCL (Clock) | PB8 | SCL | Requires a 4.7 kΩ pull-up resistor to 3.3V. |
| 3.3V Power | 3.3V output | VCC / VIN | Must use 3.3V. Do not connect to 5V. |
| Ground | GND | GND | Common ground reference. |
The firmware is structured to leverage the STM32Cube ecosystem:
- Hardware Abstraction Layer (HAL): STM32CubeH5 drivers for peripheral management.
- Security Layer: STM32Trust TEE Secure Manager with TrustZone isolation for critical operations.
- Sensor Layer: Dedicated driver for the BME280 sensor.
- Storage Layer: FATFS middleware for file operations on the microSD card.
- Application Layer: Main control logic integrating sensing, security, and logging.
- IDE: STM32CubeIDE (v1.14.0+)
- Firmware Package: STM32CubeH5 MCU Package.
- Terminal Emulator: (e.g., PuTTY, Tera Term,
screen) for serial debug output.
- Clone & Import:
Open STM32CubeIDE and import the project from the
git clone https://github.com/yourusername/secure-iot-sensor-h573.git
firmware/directory. - Build the Project: Use the
Project → Build Allcommand (or Ctrl+B). - Connect Hardware: Power the board via USB-C and ensure the ST-LINK debugger is recognized.
- Flash the MCU: Use the
Run → Debugcommand to program the board. Press 'Resume' to start execution.
- Open your serial terminal software and connect to the board's Virtual COM Port.
- Configure the terminal for 115200 baud, 8 data bits, no parity, 1 stop bit (8N1).
- On startup, the system will output initialization status and begin printing sensor readings.
- Follow the serial menu prompts to configure network credentials if using Wi-Fi/Ethernet transmission.
This project demonstrates key hardware security features of the STM32H5:
- Secure Boot: Established via the immutable root-of-trust (ST-iROT).
- TrustZone®: Isolates cryptographic key handling and signing operations in the Secure World.
- Cryptographic Acceleration: Leverages hardware accelerators for AES, HASH, and random number generation (RNG).
- Secure Storage: Protects cryptographic keys within dedicated, hardware-isolated areas.
STM32H5_Secure_Sensor_Node/
├── firmware/ # Source code and IDE project
│ ├── Core/
│ │ ├── Inc/ # Application header files
│ │ ├── Src/ # Application source files
│ │ └── Secure/ # TrustZone Secure World code
│ ├── Drivers/
│ │ ├── STM32H5xx_HAL_Driver/ # HAL drivers
│ │ └── BME280/ # Sensor driver
│ ├── Middlewares/ST/ # FATFS middleware (for microSD)
│ └── STM32CubeIDE/ # IDE-specific project files
├── hardware/
│ ├── datasheets/ # Component datasheets
│ └── schematics/ # Connection diagrams
├── docs/ # Additional documentation
└── README.md # This file
- STM32H573I-DK Official Page: User manual, schematics, and getting started guides.
- BME280 Datasheet: Sensor specifications and interface details.
- STM32CubeIDE Documentation: IDE user guide and tutorials.
This project is published under the MIT License. See the LICENSE file in the repository for details.