0% found this document useful (0 votes)
16 views

Detailed Industrial IoT Gateway PPT

The project involves designing an IIoT Gateway using STM32 for real-time environmental monitoring, specifically utilizing an AHT25 sensor for temperature and humidity data. The data is processed by an STM32 Nucleo F446RE and transmitted to the ThingsBoard cloud via MQTT for visualization and alerting. Future enhancements include AI for predictive analytics and support for additional sensors.

Uploaded by

uday151999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Detailed Industrial IoT Gateway PPT

The project involves designing an IIoT Gateway using STM32 for real-time environmental monitoring, specifically utilizing an AHT25 sensor for temperature and humidity data. The data is processed by an STM32 Nucleo F446RE and transmitted to the ThingsBoard cloud via MQTT for visualization and alerting. Future enhancements include AI for predictive analytics and support for additional sensors.

Uploaded by

uday151999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

STM32 to MQTT Cloud

Integration Project

Final Project Report


Objective
• Design an IIoT Gateway for real-time
environmental monitoring
• Use STM32 to process sensor data
• Transmit data to cloud for visualization &
alerting.
System Overview
• Sensor Layer: AHT25 (Temp & Humidity)
• Processing Layer: STM32 Nucleo F446RE
• Communication: UART (direct STM32 to
RuggedBoard)
• Cloud Layer: ThingsBoard via MQTT
• Edge Gateway: RuggedBoard A5D2X
Hardware Components
• STM32 Nucleo F446RE
• AHT25 Temperature & Humidity Sensor
• RuggedBoard A5D2X
• Ethernet Module
Software Components
• STM32CubeIDE & STM32CubeMX
• Embedded C (STM32), Python (Gateway)
• MQTT Protocol
• ThingsBoard Cloud Platform
Flow of Operation
• 1. AHT25 collects temp & humidity
• 2. STM32 reads via I2C, formats data
• 3. Sends data via UART to RuggedBoard
• 4. RuggedBoard parses & publishes via MQTT
• 5. ThingsBoard visualizes in real-time
Cloud Integration (ThingsBoard)
• Data received via MQTT
• Custom dashboard for real-time display
• Alerts for threshold violations.
Sensor Initialization (STM32)
// AHT25 Sensor Initialization (STM32CubeIDE - main.c)
void AHT10_Init(void) {
uint8_t init_cmd[] = {0xE1, 0x08, 0x00};
if (HAL_I2C_Master_Transmit(&hi2c1, 0x38 << 1, init_cmd, sizeof(init_cmd),
HAL_MAX_DELAY) != HAL_OK) {
char msg[] = "Init Failed\r\n";
HAL_UART_Transmit(&huart2, (uint8_t*)msg, strlen(msg), HAL_MAX_DELAY);
}
}
Reading and Sending Sensor Data
// Read AHT25 sensor and send over UART
void Read_Temperature_Humidity(void) {
uint8_t trigger_cmd[] = {0xAC, 0x33, 0x00};
uint8_t data[6];
HAL_I2C_Master_Transmit(&hi2c1, 0x38 << 1, trigger_cmd, sizeof(trigger_cmd),
HAL_MAX_DELAY);
HAL_Delay(100);
HAL_I2C_Master_Receive(&hi2c1, 0x38 << 1, data, 6, HAL_MAX_DELAY);
float temp = (((((uint32_t)data[3] & 0x0F) << 16) | ((uint32_t)data[4] << 8) |
data[5]) / 1048576.0) * 200 - 50;
float hum = ((((uint32_t)data[1] << 12) | ((uint32_t)data[2] << 4) | (data[3] >> 4))
/ 1048576.0) * 100;
char buffer[64];
snprintf(buffer, sizeof(buffer), "Temp: %.2f C, Hum: %.2f %%\r\n", temp, hum);
HAL_UART_Transmit(&huart1, (uint8_t*)buffer, strlen(buffer), HAL_MAX_DELAY);
}
RuggedBoard Python MQTT Script
# Python Script on RuggedBoard - Publish via MQTT
import serial, json, re
from paho.mqtt.client import Client

client = Client()
client.username_pw_set("Your_Device_Token")
client.connect("demo.thingsboard.io", 1883, 60)
ser = serial.Serial("/dev/ttyS3", 115200, timeout=1)
pattern = re.compile(r"Temp: (\d+.\d+) C, Hum: (\d+.\d+)")

while True:
line = ser.readline().decode("utf-8").strip()
match = pattern.search(line)
if match:
temp, hum = match.groups()
payload = {"temperature": float(temp), "humidity": float(hum)}
client.publish("v1/devices/me/telemetry", json.dumps(payload))
Testing & Results
• Sensor data verified with debug UART
• UART communication tested for reliability
• Cloud dashboard shows accurate live data
Conclusion
• Efficient IIoT Gateway for industrial
monitoring
• Enables predictive maintenance and remote
access
• Scalable, reliable, and cloud-integrated
Future Enhancements
• AI for predictive analytics
• Multi-sensor support (vibration, gas, etc.)
• Mobile app integration
• Edge computing & control
Thank You
• Q&A Time
• Prepared by: Uday Singh

You might also like