Skip to main content

Python module for reading CO2 concentration from a Senseair S8 sensor connected to a Raspberry Pi

Project description

Senseair S8 for Python

Python module for reading CO2 concentration from a Senseair S8 sensor connected to a Raspberry Pi

Connecting the Senseair S8 to your Raspberry Pi

Hook up the Senseair S8 to your Raspberry Pi using the following schematic:

Connection schematic

Image source: http://co2meters.com/Documentation/AppNotes/AN168-S8-raspberry-pi-uart.pdf

Module installation

pip install senseair-s8

Usage

As a module:

from senseair_s8 import SenseairS8

senseair_s8 = SenseairS8()
print(senseair_s8.co2())

From the command line:

python -m senseair_s8

Troubleshooting

  • This module expects the sensor to be connected to port /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')
  • Out of the box, /dev/ttyS0 is disabled on a Raspberry Pi, resulting in a permission denied-error. You can enable it by:
    1. Run sudo raspi-config
    2. Select Interfacting options
    3. Select P6 Serial
    4. Select No for login console
    5. Select Yes for serial port hardware
    6. OK, Finish, Reboot - Yes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

senseair_s8-0.0.11.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

senseair_s8-0.0.11-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file senseair_s8-0.0.11.tar.gz.

File metadata

  • Download URL: senseair_s8-0.0.11.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for senseair_s8-0.0.11.tar.gz
Algorithm Hash digest
SHA256 caef58f5e0f1db6cd949ae2dd08912066ee943a45d8ef1f0d0f97d46b0480f81
MD5 9bc8b041ebee57695abca401d85135fc
BLAKE2b-256 bcd530a9543e3b21a58ddcf51bdd09a1ce618d22e27e9ff51f28e0437edffa9c

See more details on using hashes here.

File details

Details for the file senseair_s8-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: senseair_s8-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for senseair_s8-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 5ed7e4f615ae5ae3da2fd5a7a2a901dd2e4ab2f7ca8e43207e7a430c9a9b7e3c
MD5 573441a73d39744dc75d5149b5e50c00
BLAKE2b-256 9ef8658028ec67bf1bd95342c8f85724bb73867b1e957fdc5d7f94243ab17151

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page