Overview
*sniff* *sniff* ... do you smell that? There's no need to stick your nose into a carton of milk anymore, you can build a digital nose with the ENS161 Gas Sensor, a fully integrated MOX gas sensor. This is a very fine air quality sensor from the sensor experts at ScioSense, with I2C interfacing, so you don't have to manage the heater and analog reading of a MOX sensor. It combines multiple metal-oxide sensing and heating elements on one chip to provide more detailed air quality signals.
The ENS161 is an update to the popular ENS160 (the replacement for the popular, but now-discontinued CCS811.) The ENS161 has the same four-part gas sensor and I2C/SPI interface but with improved built-in eCO2 and TVOC algorithms plus a new Air Quality Index (AQI) output.
The ENS161 has a 'standard' hot-plate MOX sensor divided into 4 sections, as well as a small microcontroller that controls power to the plate, reads the analog voltage, and provides an I2C interface to read from. ScioSense provides an Arduino library with examples of reading the four raw resistance values and also the TVOC and eCO2, and a Python/CircuitPython library that can be used with Linux computers like the Raspberry Pi or our CircuitPython boards.
Please note, this sensor, like all VOC/gas sensors, has variability, and to get precise measurements you will want to calibrate it against known sources! That said, for general environmental sensors, it will give you a good idea of trends and comparison.
Another nice element of this sensor is the ability to set temperature and humidity compensation for better accuracy. An external humidity sensor is required and then the RH% is written over I2C to the sensor, so it can better calibrate the MOX sensor reading and reduce humidity/temperature-based variations.
Nice sensor right? So we made it easy for you to get right into your next project. The surface-mount sensor is soldered onto a custom-made PCB in the STEMMA QT form factor, making them easy to interface with. The STEMMA QT connectors on either side are compatible with the SparkFun Qwiic I2C connectors. This allows you to make solderless connections between your development board and the ENS161 or to chain it with a wide range of other sensors and accessories using a compatible cable. QT Cable is not included, but we have a variety in the shop
We've, of course, broken out all the pins to standard headers and added a 3.3V voltage regulator and level shifting to allow you to use it with either 3.3V or 5V systems, such as the Arduino Uno, or Feather M4.
Page last edited December 02, 2025
Text editor powered by tinymce.
Pinouts
The default I2C address is 0x53.
Power Pins
- VIN - this is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V.
- 3Vo - this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like.
- GND - common ground for power and logic.
I2C Logic Pins
- SCL (labeled SCK) - I2C clock pin, connect to your microcontroller I2C clock line. This pin is level shifted so you can use 3-5V logic, and there's a 10K pullup on this pin.
- SDA (labeled SDI) - I2C data pin, connect to your microcontroller I2C data line. This pin is level shifted so you can use 3-5V logic, and there's a 10K pullup on this pin.
- STEMMA QT - These connectors allow you to connectors to dev boards with STEMMA QT connectors or to other things with various associated accessories.
Address Pin
On the back of the board is one address jumper, labeled Addr. This jumper allows you to chain up to 2 of these boards on the same pair of I2C clock and data pins. To do so, you solder the jumper "closed" by connecting the two pads.
On the front of the board is one address pin, labeled SDO. Just like the jumper, this pin allows you to change the I2C address to connect multiple boards by connecting it to GND.
The default I2C address is 0x53. The other address option can be calculated by “subtracting” the Addr from the base of 0x53.
Addr sets the lowest bit with a value of 1. The final address is 0x53 - Addr which would be 0x52.
The table below shows all possible addresses, and whether the pin should be high (open) or low (closed).
SPI Logic Pins
- SCK - This is the SPI clock pin, it's an input to the gas sensor.
- SDO - This is the Serial Data Out pin, for data sent from the gas sensor to your processor.
- SDI - This is the Serial Data In pin, for data sent from your processor to the gas sensor.
- CS - This is the Chip Select pin, drop it low to start an SPI transaction. It's an input to the gas sensor.
Please note the libraries do not support the SPI interface.
Page last edited December 02, 2025
Text editor powered by tinymce.
CircuitPython and Python
It's easy to use the ENS161 with Python or CircuitPython, and the Adafruit_CircuitPython_ENS160 module. This module allows you to easily write Python code that allows you to read the ENS161 gas sensor. You can use this gas sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library.
CircuitPython Microcontroller Wiring
First, wire up an ENS161 to your board exactly as shown below. Here's an example of wiring a Feather RP2040 to the ENS161 with I2C using one of the handy STEMMA QT connectors:
-
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)
You can also use standard 0.100" pitch headers to wire it up on a breadboard:
-
Board 3V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCK/SCL (yellow wire)
- Board SDA to breakout SDI/SDA (blue wire)
Python Computer Wiring
Since there's dozens of Linux computers/boards you can use, below shows 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 to the gas sensor using I2C and a STEMMA QT 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)
Finally here is an example of how to wire up a Raspberry Pi to the gas sensor using a solderless breadboard:
-
Pi 3V to breakout VIN (red wire)
-
Pi GND to breakout GND (black wire)
-
Pi SCL to breakout SCK/SCL (yellow wire)
- Pi SDA to breakout SDI/SDA (blue wire)
Python Installation of ENS160 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-ens160
If your default Python is version 3, you may need to run pip instead. 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 ENS160 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 folders and file:
- adafruit_bus_device/
- adafruit_register/
- adafruit_ens160.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
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) 2022 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
import time
import board
import adafruit_ens160
i2c = board.I2C() # uses board.SCL and board.SDA
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
ens = adafruit_ens160.ENS160(i2c)
# Set the temperature compensation variable to the ambient temp
# for best sensor calibration
ens.temperature_compensation = 25
# Same for ambient relative humidity
ens.humidity_compensation = 50
while True:
print("AQI (1-5):", ens.AQI)
print("TVOC (ppb):", ens.TVOC)
print("eCO2 (ppm):", ens.eCO2)
print()
# new data shows up every second or so
time.sleep(1)
In the example, the gas sensor is instantiated on I2C. Then, in the loop, AQI, TVOC and eCO2 readings are printed to the REPL every second.
Page last edited December 02, 2025
Text editor powered by tinymce.
Arduino
Using the ENS161 gas sensor with Arduino involves wiring up the sensor to your Arduino-compatible microcontroller, installing the ENS160 library and running the provided example code.
Wiring
Wire as shown for a 5V board like an Uno. If you are using a 3V board, like an Adafruit Feather, wire the board's 3V pin to the ENS161 VIN.
Here is an Adafruit Metro wired up to the ENS161 using the STEMMA QT connector:
-
Board 5V to breakout STEMMA VIN (red wire)
-
Board GND to breakout STEMMA GND (black wire)
-
Board SCL to breakout STEMMA SCL (yellow wire)
- Board SDA to breakout STEMMA SDA (blue wire)
Here is an Adafruit Metro wired up using a solderless breadboard:
-
Board 5V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCK/SCL (yellow wire)
- Board SDA to breakout SDI/SDA (blue wire)
Library Installation
You can install the ENS160 - Adafruit Fork library for Arduino using the Library Manager in the Arduino IDE.
Click the Manage Libraries ... menu item, search for Adafruit ENS160, and select the ENS160 - Adafruit Fork library:
// SPDX-FileCopyrightText: 2021 Sciosense
//
// SPDX-License-Identifier: MIT
/***************************************************************************
ENS161 - Digital Air Quality Sensor
This is an example for ENS161 basic reading in standard mode
Updated by Sciosense / 25-Nov-2021
***************************************************************************/
#include <Wire.h>
int ArduinoLED = 13;
#include "ScioSense_ENS160.h" // ENS160 library
ScioSense_ENS160 ens160(ENS160_I2CADDR_1);
/*--------------------------------------------------------------------------
SETUP function
initiate sensor
--------------------------------------------------------------------------*/
void setup() {
Serial.begin(115200);
while (!Serial) {}
//Switch on LED for init
pinMode(ArduinoLED, OUTPUT);
digitalWrite(ArduinoLED, LOW);
Serial.println("------------------------------------------------------------");
Serial.println("ENS161 - Digital air quality sensor");
Serial.println();
Serial.println("Sensor readout in standard mode");
Serial.println();
Serial.println("------------------------------------------------------------");
delay(1000);
Serial.print("ENS161...");
ens160.begin();
Serial.println(ens160.available() ? "done." : "failed!");
if (ens160.available()) {
// Print ENS160 versions
Serial.print("\tRev: "); Serial.print(ens160.getMajorRev());
Serial.print("."); Serial.print(ens160.getMinorRev());
Serial.print("."); Serial.println(ens160.getBuild());
Serial.print("\tStandard mode ");
Serial.println(ens160.setMode(ENS160_OPMODE_STD) ? "done." : "failed!");
}
}
/*--------------------------------------------------------------------------
MAIN LOOP FUNCTION
Cylce every 1000ms and perform measurement
--------------------------------------------------------------------------*/
void loop() {
if (ens160.available()) {
ens160.measure(true);
ens160.measureRaw(true);
Serial.print("AQI: ");Serial.print(ens160.getAQI());Serial.print("\t");
Serial.print("TVOC: ");Serial.print(ens160.getTVOC());Serial.print("ppb\t");
Serial.print("eCO2: ");Serial.print(ens160.geteCO2());Serial.print("ppm\t");
Serial.print("R HP0: ");Serial.print(ens160.getHP0());Serial.print("Ohm\t");
Serial.print("R HP1: ");Serial.print(ens160.getHP1());Serial.print("Ohm\t");
Serial.print("R HP2: ");Serial.print(ens160.getHP2());Serial.print("Ohm\t");
Serial.print("R HP3: ");Serial.print(ens160.getHP3());Serial.println("Ohm");
}
delay(1000);
}
Upload the sketch to your board and open up the Serial Monitor (Tools -> Serial Monitor) at 115200 baud. You should see that the sketch has found your connected I2C ENS161 gas sensor. Then, sensor readings for AQI, TVOC, eCO2 and the raw resistance values of the four hot plates in the sensor are printed to the Serial Monitor every second.
Page last edited December 02, 2025
Text editor powered by tinymce.
WipperSnapper
What is WipperSnapper
WipperSnapper is a firmware designed to turn any WiFi-capable board into an Internet-of-Things device without programming a single line of code. WipperSnapper connects to Adafruit IO, a web platform designed (by Adafruit!) to display, respond, and interact with your project's data.
Simply load the WipperSnapper firmware onto your board, add credentials, and plug it into power. Your board will automatically register itself with your Adafruit IO account.
From there, you can add components to your board such as buttons, switches, potentiometers, sensors, and more! Components are dynamically added to hardware, so you can immediately start interacting, logging, and streaming the data your projects produce without writing code.
If you've never used WipperSnapper, click below to read through the quick start guide before continuing.
First, wire up an ENS161 to your board exactly as shown below.
Here's an example of wiring a Feather ESP32 V2 (HUZZAH32) to the ENS161 with I2C using one of the handy STEMMA QT connectors, or wiring up the pins using a breadboard and jumper cables:
-
Board 3V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCK (SCK/SCL - yellow wire)
- Board SDA to breakout SDI (SDI/SDA - blue wire)
Usage
Connect your board to Adafruit IO Wippersnapper and navigate to the WipperSnapper board list.
On this page, select the WipperSnapper board you're using to be brought to the board's interface page.
If you do not see your board listed here - you need to connect your board to Adafruit IO first.
On the device page, quickly check that you're running the latest version of the WipperSnapper firmware.
The device tile on the left indicates the version number of the firmware running on the connected board.
- If the firmware version is green with a checkmark - continue with this guide.
- If the firmware version is red with an exclamation mark "!" - update to the latest WipperSnapper firmware on your board before continuing.
Next, make sure the sensor is plugged into your board and click the I2C Scan button.
You should see the ENS161's default I2C address of 0x53 pop-up in the I2C scan list.
First, double-check the connection and/or wiring between the sensor and the board.
Then, reset the board and let it re-connect to Adafruit IO WipperSnapper.
With the sensor detected in an I2C scan, you're ready to add the sensor to your board.
Click the New Component button or the + button to bring up the component picker.
Adafruit IO supports a large amount of components. To quickly find your sensor, type ENS161 into the search bar, then select the ENS161 component.
On the component configuration page, the ENS161's sensor address should be listed along with the sensor's settings.
The Send Every option is specific to each sensor's measurements. This option will tell the Feather how often it should read from the ENS161 sensor and send the data to Adafruit IO. Measurements can range from every second to every 24 hours.
For this example, set the Send Every interval to every 30 seconds.
Your device interface should now show the sensor components you created. After the interval you configured elapses, WipperSnapper will automatically read values from the sensor(s) and send them to Adafruit IO.
It can take a while for the ENS161 to start reporting usable data, the datasheet suggests 1hour, and up to 48hours on first run to become stable. Subsequent runs will stabilise after around 3minutes.
To view the data that has been logged from the sensor, click on the graph next to the sensor name.
Here you can see the feed history and edit things about the feed such as the name, privacy, webhooks associated with the feed and more. If you want to learn more about how feeds work, check out this page.
Page last edited December 02, 2025
Text editor powered by tinymce.
Downloads
Page last edited December 02, 2025
Text editor powered by tinymce.