Install the SGP4x Driver -------------------------- .. include:: driver-installation.rst Use the SensorBridge on Windows ------------------------------- 1. Install the driver for the `Sensirion SEK-SensorBridge`_: .. code-block:: console python -m pip install sensirion-shdlc-sensorbridge 2. Connect the SEK-SensorBridge to your PC over USB. If the SEK-SensorBridge is not detected by your system, follow the `SensorBridge FTDI Driver Installation`_. 3. Connect the SGP4x sensor to the SEK-SensorBridge. 4. Run an example script in the activated virtual environment. By default, the script assumes that the SensorBridge is connected to the ``COM1`` serial port. If a different port is used, specify it with the ``--serial-port`` parameter: .. code-block:: console python example_sensorbridge_sgp40.py --serial-port .. _Sensirion SEK-SensorBridge: https://developer.sensirion.com/product-support/sek-sensorbridge/ .. _SensorBridge FTDI Driver Installation: https://sensirion.github.io/python-shdlc-sensorbridge/sensor-bridge-installation.html Example script SGP40 ~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: ../example_sensorbridge_sgp40.py :language: python Example script SGP41 ~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: ../example_sensorbridge_sgp41.py :language: python Use the Linux I²C Driver ------------------------ On Linux systems, the sensor can alternatively be accessed directly through the Linux user-space I²C driver. 1. Connect the SGP4x sensor to an I²C port of your system, for example I²C port 1 of a Raspberry Pi. 2. Run an example script in the activated virtual environment. By default, the script assumes that the sensor is connected to ``/dev/i2c-1``. If a different port is used, specify it with the ``--i2c-port`` parameter: .. code-block:: console python example_linux_sgp40.py --i2c-port Example script SGP40 ~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: ../example_linux_sgp40.py :language: python Example script SGP41 ~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: ../example_linux_sgp41.py :language: python