Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.71 KB

File metadata and controls

38 lines (25 loc) · 1.71 KB

CO2 monitor for Raspberry Pi and Tostmann CO2 monitor

Monitoring CO2 level and temperature using a Raspberry Pi and a Tostmann CFA CO2 Monitor.

A realtime clock is used to provide proper timestamps for the data in the csv file.

The script writes the data in CSV form to a daily file in the /home/pi/co2monitor folder.

An upload script is run by a cronjob to upload the data to a webserver. The hostname, username and password are stored in /etc/environment

Hardware

Setup

Follow https://thepihut.com/blogs/raspberry-pi-tutorials/17209332-adding-a-real-time-clock-to-your-raspberry-pi to setup the realtime clock.

A root cronjob has to be installed to make sure the USB device socket can be read by the pi user.

The script is run by systemd therefore co2monitor.service has to be copied to /etc/systemd/system/

When the co2monitor.service file is installed or changed it has to be reloaded:

sudo systemctl daemon-reload

The CO2 monitoring service can then be controlled via systemctl:

sudo systemctl enable co2monitor
sudo systemctl start co2monitor
sudo systemctl status co2monitor
sudo systemctl stop co2monitor
sudo systemctl restart co2monitor
...

Visualization

An index.html is provided for visualizing the CO2 data on the webserver