It's easy to use the SEN6x breakout with Python or CircuitPython, and the Adafruit_CircuitPython_SEN6x module. This module allows you to easily write Python code to read data from SEN6x sensors. The example below is written for a SEN66 sensor.
You can use this driver with any CircuitPython microcontroller board or with a computer that has GPIO and Python thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library.
Please note: this board does NOT come with a JST GH-compatible cable NOR a SEN6x sensor! You can pick up the cable here, and a SEN6x from DigiKey.

CircuitPython Microcontroller Wiring
First wire up the breakout to your board exactly as follows. The following is the breakout wired to a Feather RP2040 using the STEMMA connector:
-
Board STEMMA 3V to breakout STEMMA VIN (red wire)
-
Board STEMMA GND to breakout STEMMA GND (black wire)
-
Board STEMMA SCL to breakout STEMMA SCL (yellow wire)
- Board STEMMA SDA to breakout STEMMA SDA (blue wire)
- SEN66 sensor to breakout JST GH port
The following is the breakout wired to a Feather RP2040 using a solderless breadboard:
-
Board 3V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
- SEN66 sensor to breakout JST GH port
Python Computer Wiring
Since there are dozens of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, please visit the guide for CircuitPython on Linux to see whether your platform is supported.
Here's the Raspberry Pi wired with I2C using the STEMMA connector:
-
Pi 3V to breakout STEMMA VIN (red wire)
-
Pi GND to breakout STEMMA GND (black wire)
-
Pi SCL to breakout STEMMA SCL (yellow wire)
- Pi SDA to breakout STEMMA SDA (blue wire)
- SEN66 sensor to breakout JST GH port
Here's the Raspberry Pi wired with I2C using a solderless breadboard:
-
Pi 3V to breakout VIN (red wire)
-
Pi GND to breakout GND (black wire)
-
Pi SCL to breakout SCL (yellow wire)
- Pi SDA to breakout SDA (blue wire)
- SEN66 sensor to breakout JST GH port
Python Installation of SEN6x Library
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready!
Once that's done, from your command line run the following command:
pip3 install adafruit-circuitpython-sen6x
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!
CircuitPython Usage
To use with CircuitPython, you need to first install the Adafruit_CircuitPython_SEN6x library, and its dependencies, into the lib folder on your CIRCUITPY drive. Then you need to update code.py with the example script.
Thankfully, we can do this in one go. In the example below, click the Download Project Bundle button below to download the necessary libraries and the code.py file in a zip file. Extract the contents of the zip file, and copy the entire lib folder and the code.py file to your CIRCUITPY drive.
Your CIRCUITPY/lib folder should contain the following folder and file:
- adafruit_bus_device/
- adafruit_sen6x.mpy

Python Usage
Once you have the library pip3
installed on your computer, copy or download the following example to your computer, and run the following, replacing code.py with whatever you named the file:
python3 code.py
Example Code
If running CircuitPython: Once everything is saved to the CIRCUITPY drive, connect to the serial console to see the data printed out!
If running Python: The console output will appear wherever you are running Python.
# SPDX-FileCopyrightText: Copyright (c) 2025 Liz Clark for Adafruit Industries # # SPDX-License-Identifier: MIT # Example usage: import time import board import adafruit_sen6x # Initialize I2C i2c = board.I2C() # Create SEN66 instance sensor = adafruit_sen6x.SEN66(i2c) # Read sensor info print(f"Product: {sensor.product_name}") print(f"Serial: {sensor.serial_number}") # Check device status status = sensor.device_status print(f"Device {status}") # Optional: Configure sensor before starting # sensor.temperature_offset(offset=-2.0, slot=0) # Apply -2°C offset # sensor.voc_algorithm_tuning(index_offset=100) # Adjust VOC baseline # print(sensor.voc_algorithm) # Print VOC baseline # CO2 configuration examples: # sensor.co2_automatic_self_calibration = False # Disable ASC for greenhouses # sensor.ambient_pressure = 1020 # Set pressure in hPa # sensor.sensor_altitude = 500 # Or set altitude in meters # Start measurements sensor.start_measurement() # Wait for first measurement to be ready print("Waiting for first measurement...") time.sleep(2) print("-" * 40) # Read data continuously while True: if sensor.data_ready: # Check for errors before reading sensor.check_sensor_errors() # Read all measurements data = sensor.all_measurements() # Display values (None = sensor still initializing) print( f"Temperature: {data["temperature"]:.1f}°C" if data["temperature"] else "Temperature: initializing..." ) print( f"Humidity: {data["humidity"]:.1f}%" if data["humidity"] else "Humidity: initializing..." ) print(f"PM2.5: {data["pm2_5"]:.1f} µg/m³" if data["pm2_5"] else "PM2.5: initializing...") print( f"VOC Index: {data["voc_index"]:.1f}" if data["voc_index"] else "VOC Index: initializing..." ) print( f"NOx Index: {data["nox_index"]:.1f}" if data["nox_index"] else "NOx Index: initializing..." ) print(f"CO2: {data["co2"]} ppm" if data["co2"] else "CO2: initializing...") print("-" * 40) time.sleep(2)
First, the SEN66 sensor is recognized over I2C. Its product name, serial number and status are printed to the serial console. Then, in the loop, the temperature, humidity, PM2.5, VOC, NOx and CO2 measurements are printed to the console every two seconds. It does take a few seconds for the sensor to fully initialize to have all measurements read out.
Page last edited June 02, 2025
Text editor powered by tinymce.