Python module for reading CO2 concentration from a Senseair S8 sensor connected to a Raspberry Pi
MIT License
Python module for reading CO2 concentration from a Senseair S8 sensor connected to a Raspberry Pi
Hook up the Senseair S8 to your Raspberry Pi using the following schematic:
Image source: http://co2meters.com/Documentation/AppNotes/AN168-S8-raspberry-pi-uart.pdf
pip install senseair-s8
As a module:
from senseair_s8 import SenseairS8
senseair_s8 = SenseairS8()
print(senseair_s8.co2())
From the command line:
python -m senseair_s8
/dev/ttyS0
. It was only tested using that port, but you can override this settings when initialising the sensor:sensair_s8 = SenseairS8(port='/dev/ttyS0')
/dev/ttyS0
is disabled on a Raspberry Pi, resulting in a permission denied
-error. You can enable it by:
sudo raspi-config