Now, it's time to think about the software needed to implement the desired functioning, that is, checking the gas concentrations, logging them, and eventually activating the alarms. We need the following:
read_sensors.php) that periodically scans all the sensors and then logs their data into a database.
monitor.php) that reads the sensors' data, checks them against preset thresholds, and then sets some internal status.
write_actuators.php) that enables the alarms according to the previously saved status.
The following diagram shows the situation:
The core of the ...