System Sketch

The project hardware is based on a Raspberry PI. It uses the GPIO pins to communicate with the sensors. In this example, an AM2320 and a TMP36 are connected but it can easily be adapted to other sensors.

In addition, an LED and a button are connected to the Raspberry PI to manage alarm. When one is raised, the LED is turned on and when the button is pressed, the alarm is reset.

System sketch
System sketch

Services Structure

In this project, multiple services are interconnected. While the core of the project runs on a Raspberry Pi 4 through a Python script, the data and alarms are sent to other services for analysis.

All sensors value and triggered alarms are stored in a Mongo database to keep an historical record and every 15s, the data are sent to ThingSpeak for MATLAB analysis. For real-time processing, the data are sent to an MQTT broker, allowing multiple services to subscribe to data of interest with low latency. A data analysis python script can be used to process data from MQTT (real time) or the Mongo database.

Services Structure
Services structure