Setting up the software
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:
- A periodic procedure (
read_sensors.php
) that periodically scans all the sensors and then logs their data into a database. - A periodic procedure (
monitor.php
) that reads the sensors' data, checks them against preset thresholds, and then sets some internal status. - A periodic procedure (
write_actuators.php
) that enables the alarms according to the previously saved status.
The following diagram shows the situation:
The core of the ...
Get BeagleBone: Creative Projects for Hobbyists now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.