Quick Start
Plug the breakout into your controller with a Qwiic cable, install the library and read the SO2 concentration in ppm. The board answers at I2C address 0x30 as shipped.
You program the controller connected to this breakout. The breakout itself is not flashed.
The board runs from 3.3 V only. It has no regulator, so the headers and both Qwiic connectors share one 3.3 V supply.
- Arduino
- MicroPython
1. Connect the breakout board
Plug a Qwiic cable into your controller's Qwiic connector and into either Qwiic connector on the breakout. The cable carries 3.3 V, GND and I2C.
| NULA DeepSleep | Soldered Electrochemical SO2 Gas Sensor Breakout (Qwiic) |
|---|---|
| Qwiic connector | Qwiic connector |
Without Qwiic: breadboard wiring
Solder the included header pins and wire the four pins of the top header that carry the main I2C bus. Use the SDA1 and SCL1 pins, not SDA2 and SCL2.
| NULA DeepSleep | Soldered Electrochemical SO2 Gas Sensor Breakout (Qwiic) |
|---|---|
| GND | GND |
| 3V3 | 3V3 |
| IO8 | SDA1 |
| IO9 | SCL1 |
2. Install the library
Install Electrochemical Gas Sensor Soldered from its GitHub repository as a ZIP library.
🔗Electrochemical Gas Sensor Soldered
Verified Arduino library at commit c4df54b
Tip: downloading from GitHub. On the library's GitHub page, click the green Code button and choose Download ZIP, then add it in Arduino IDE with Sketch → Include Library → Add .ZIP Library....
3. Run the first example
This is the library's bridgeBoard example, which talks to the breakout at address 0x30. The library picks how to talk to the board from that address: 0x30 to 0x37 is this board's on-board microcontroller.
- Copy the sketch into the Arduino IDE.
- Change
SENSOR_COtoSENSOR_SO2in the line that createssensor.SENSOR_SO2is the library's preset for the SGX-4SO2 cell on this board. - Upload it and open the Serial Monitor at 115200 baud.
The listing is the library's file at the pinned commit, apart from a few comment-only lines, which name the connector by an older name or link to other Soldered products, and are left out. Where its comments say to set the address with jumpers, on this board the address is set by the ADDRESS switch (0x30 as shipped), and the address jumpers JP2 to JP4 stay as shipped. Where they say LMPEN is hardwired to GND, on this board LMPEN is pulled to GND by a 10 kΩ resistor and also runs to the on-board microcontroller (see Hardware Details).
/**
**************************************************
*
* @file bridgeBoard.ino
* @brief See how to init a sensor on the new ATtiny404 bridge board revision,
*
* To successfully run the sketch:
* - Set the desired address using the jumpers on the back of the board
* (address = 0x30 + jumper offset, giving a range of 0x30-0x37)
* - Run the sketch and open serial monitor at 115200 baud!
*
* Note: on this board revision, LMPEN is hardwired to GND, so there's
* no configPin argument to pass - the constructor's third argument
* is ignored whenever the address falls in the bridge range (0x30-0x37).
*
*
* @authors @ soldered.com
***************************************************/
// Include the required library
#include "Electrochemical-Gas-Sensor-SOLDERED.h"
// Any additional boards on the same bus just need a different jumper setting
// (0x30-0x37), same as twoSensors.ino does for legacy boards with 0x49/0x4A/0x4B.
ElectrochemicalGasSensor sensor(SENSOR_CO, 0x30);
void setup()
{
Serial.begin(115200); // For debugging
// Init the breakout
if (!sensor.begin())
{
// Can't init? Notify the user and go to infinite loop
Serial.println("ERROR: Can't init the sensor! Check connections and jumper address!");
while (true)
delay(100);
}
Serial.println("Sensor initialized successfully!");
}
void loop()
{
// Make the reading
double reading = sensor.getPPM();
// If PPB is more relevant for your sensor, you can use:
// double reading = sensor.getPPB();
// Print the reading with 5 digits of precision
Serial.print("Sensor reading: ");
Serial.print(reading, 5);
Serial.println(" PPM");
// Wait a bit before reading again
delay(2500);
}
4. Check the result
The Serial Monitor first confirms that the board answered. After that, a new Sensor reading: line follows every 2.5 seconds, with the SO2 concentration in ppm to five decimal places. A run in clean air looked like this:
Sensor initialized successfully!
Sensor reading: 0.00282 PPM
Sensor reading: 0.00315 PPM
Sensor reading: 0.00292 PPM
Sensor reading: 0.00290 PPM
The library never reports a negative value: anything below zero is printed as 0.
If you see ERROR: Can't init the sensor! Check connections and jumper address! instead, the board did not answer at 0x30.
5. If it does not work
Continue with Troubleshooting and retry this smallest example after each change.
1. Connect the breakout board
Plug a Qwiic cable into your controller's Qwiic connector and into either Qwiic connector on the breakout. The cable carries 3.3 V, GND and I2C.
| NULA DeepSleep | Soldered Electrochemical SO2 Gas Sensor Breakout (Qwiic) |
|---|---|
| Qwiic connector | Qwiic connector |
The example sets SDA to pin 21 and SCL to pin 22. On the NULA DeepSleep, change them to 8 (SDA) and 9 (SCL), the board's I2C pins shown in the diagram.
Without Qwiic: breadboard wiring
Solder the included header pins and wire the four pins of the top header that carry the main I2C bus.
| NULA DeepSleep | Soldered Electrochemical SO2 Gas Sensor Breakout (Qwiic) |
|---|---|
| GND | GND |
| 3V3 | 3V3 |
| IO8 | SDA1 |
| IO9 | SCL1 |
The example sets SDA to pin 21 and SCL to pin 22. On the NULA DeepSleep, change them to 8 (SDA) and 9 (SCL), the board's I2C pins shown in the diagram.
2. Install the module
After installing the mpremote package, install the library on your board using the following command:
mpremote mip install github:SolderedElectronics/Soldered-ElectrochemicalGasSensor-MicroPython-Library
Or, if you're running a Windows OS:
python -m mpremote mip install github:SolderedElectronics/Soldered-ElectrochemicalGasSensor-MicroPython-Library
🔗Soldered ElectrochemicalGasSensor MicroPython Library
Verified MicroPython module at commit 623e1e6
Tip: downloading from GitHub. Without mpremote, open the module's .py
file on GitHub and click Download raw file, then open it in Thonny and use
File → Save as... → MicroPython device to copy it onto the board.
This library needs three files on the board: ElectrochemicalGasSensor.py, ads1115.py and lmp91000.py.
3. Run the first example
This is the library's electrochemical-bridgeBoard.py example. It creates the I2C bus on GPIO 22 (SCL) and GPIO 21 (SDA) and talks to the breakout at address 0x30.
- Open the example in Thonny.
- Change
SENSOR_O3toSENSOR_SO2in both places: theimportline and the line that createssensor.SENSOR_SO2is the library's preset for the SGX-4SO2 cell on this board. - If your board's Qwiic connector uses other pins, change the numbers in the
I2C(...)line. - Run the script.
The listing is the library's file at the pinned commit, apart from a few comment-only lines, which name the connector by an older name, link to another Soldered product or name a controller board in the connecting diagram, and are left out. Where its comments say to set the address with jumpers, on this board the address is set by the ADDRESS switch (0x30 as shipped), and the address jumpers JP2 to JP4 stay as shipped. Where they say LMPEN is hardwired to GND, on this board LMPEN is pulled to GND by a 10 kΩ resistor and also runs to the on-board microcontroller (see Hardware Details).
# FILE: electrochemical-bridgeBoard.py
# AUTHOR: Fran Fodor @ Soldered
# BRIEF: Single sensor PPM reading example for the ATtiny404 bridge board revision,
# which allows daisy-chaining multiple boards on one I2C bus.
# LAST UPDATED: 2026-07-23
# Connecting diagram:
#
# Qwiic------------------------>Qwiic
#
# Note: on this board revision, LMPEN is hardwired to GND, so there's no
# config_pin to set - it's ignored whenever adc_addr falls in the bridge
# range (0x30-0x37). Set the desired address using the jumpers on the back
# of the board before powering it on.
from machine import I2C, Pin
import time
from ElectrochemicalGasSensor import ElectrochemicalGasSensor, SENSOR_O3
# Initialize I2C
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
# (address = 0x30 + jumper offset, giving a range of 0x30-0x37).
# Any additional boards on the same bus just need a different jumper
# setting, same as twoSensors.py does for legacy boards with 0x49/0x4A/0x4B.
sensor = ElectrochemicalGasSensor(SENSOR_O3, i2c, adc_addr=0x30)
# -------------------------------------------------------------------------
# Setup
# -------------------------------------------------------------------------
print("Electrochemical Gas Sensor - ATtiny Bridge Board Example")
if not sensor.begin():
print("ERROR: Can't init the sensor! Check connections and jumper address!")
while True:
time.sleep_ms(100)
print("Sensor initialized successfully!")
# -------------------------------------------------------------------------
# Main loop
# -------------------------------------------------------------------------
while True:
reading = sensor.getPPM()
# If PPB is more relevant for your sensor, use:
# reading = sensor.getPPB()
print("Sensor reading: {:.5f} PPM".format(reading))
time.sleep_ms(2500)
🔗Open the complete example
electrochemical-bridgeBoard.py at the pinned commit
4. Check the result
The Thonny shell first shows the example's title and confirms that the board answered:
Electrochemical Gas Sensor - ATtiny Bridge Board Example
Sensor initialized successfully!
After that, a new Sensor reading: line follows every 2.5 seconds, with the SO2 concentration in ppm to five decimal places. Values below zero are printed as 0.
5. If it does not work
Continue with Troubleshooting and retry this smallest example after each change.