Quick Start
Connect the breakout over Qwiic, install the library, and print the carbon monoxide concentration in ppm every 2.5 seconds.
You program the controller connected to this breakout. The breakout itself is not flashed: its ATtiny404 comes with its firmware and handles the gas cell's front end and ADC for you.
The board runs from 3.3 V only. It has no regulator, so the header 3V3 pins
and both Qwiic connectors share one 3.3 V supply. Do not connect 5 V.
- Arduino
- MicroPython
1. Connect the breakout board
Plug a Qwiic cable into either Qwiic connector on the board and into the Qwiic
connector on your controller. Each Qwiic connector carries 3V3, SDA, SCL
and GND, so the one cable powers the board and connects I2C.
| NULA DeepSleep | Soldered Electrochemical CO Gas Sensor Breakout (Qwiic) |
|---|---|
| Qwiic connector | Qwiic connector |
Without Qwiic: header wiring
Solder the included header pins and wire the top header pins directly to your
controller's 3.3 V supply, ground and I2C pins. Use SDA1 and SCL1: SDA2 and SCL2
are the board's internal bus between the ATtiny404 and the sensor chips.
The table and diagram show one example controller, whose default I2C pins are GPIO 8 (SDA) and GPIO 9 (SCL). On another controller, use its own I2C pins.
| NULA DeepSleep | Soldered Electrochemical CO 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.
🔗Electrochemical Gas Sensor Arduino library
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
Open bridgeBoard from the library's examples, select your board and port,
and upload it. It creates the sensor with the CO cell's preset, SENSOR_CO, at
the board's default address 0x30, and prints a reading every 2.5 seconds.
/**
**************************************************
*
* @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);
}
On this board, the address is set with the three-switch ADDRESS DIP switch on the top
side, at the top left, not with jumpers on the back, and the default 0x30 needs
no change. LMPEN is pulled to GND through 10 kΩ rather than wired straight to
it; either way, you connect nothing to it.
🔗Open the complete example
examples/bridgeBoard at commit c4df54b
4. Check the result
Open the Serial Monitor at 115200 baud. In clean air, a run on this board shows:
Sensor initialized successfully!
Sensor reading: 0.29553 PPM
Sensor reading: 0.32187 PPM
Sensor reading: 0.29429 PPM
Sensor reading: 0.30653 PPM
After that, a new line arrives every 2.5 seconds: Sensor reading: , the CO
concentration in ppm with five decimals, and PPM. The library never reports
a negative concentration: a result below zero is printed as 0.00000.
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
The module's example opens I2C bus 0 with SCL on pin 22 and SDA on pin 21.
Change the pin numbers in the example if your controller's Qwiic connector or
the pins you wire are elsewhere.
Plug a Qwiic cable into either Qwiic connector on the board and into the Qwiic
connector on your controller. Each Qwiic connector carries 3V3, SDA, SCL
and GND, so the one cable powers the board and connects I2C. The diagram
shows one example controller; the pin note under it is for that board.
| NULA DeepSleep | Soldered Electrochemical CO 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: header wiring
Solder the included header pins and wire the top header pins directly to your
controller's 3.3 V supply, ground, and the pins you set in the example. Use SDA1 and
SCL1: SDA2 and SCL2 are the board's internal bus.
The table and diagram show one example controller, whose default I2C pins are GPIO 8 (SDA) and GPIO 9 (SCL). On another controller, use its own I2C pins and set the same numbers in the example.
| NULA DeepSleep | Soldered Electrochemical CO 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
🔗Electrochemical Gas Sensor 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
module needs three files on the board: ElectrochemicalGasSensor.py,
lmp91000.py and ads1115.py.
3. Run the first example
This is the module's electrochemical-bridgeBoard.py example. It opens I2C,
creates the sensor at the board's default address 0x30, and prints a reading
every 2.5 seconds.
Before you run it, change SENSOR_O3 to SENSOR_CO in the import line and
in the ElectrochemicalGasSensor(...) line. SENSOR_O3 is the module's
preset for the ozone cell, so getPPM() would convert with that cell's
sensitivity and zero. This board carries the SGX-4CO carbon monoxide cell, and
the module's preset for it is SENSOR_CO.
# 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)
On this board, the address is set with the three-switch ADDRESS DIP switch on the top
side, at the top left, not with jumpers on the back, and the default 0x30 needs
no change. LMPEN is pulled to GND through 10 kΩ rather than wired straight to
it; either way, you connect nothing to it.
🔗Open the complete example
Examples/electrochemical-bridgeBoard.py at commit 623e1e6
4. Check the result
In clean air, a run on this board shows in the shell:
Electrochemical Gas Sensor - ATtiny Bridge Board Example
Sensor initialized successfully!
Sensor reading: 0.31492 PPM
Sensor reading: 0.29677 PPM
Sensor reading: 0.30840 PPM
Sensor reading: 0.31346 PPM
After that, a new line arrives every 2.5 seconds: Sensor reading: , the
concentration in ppm with five decimals, and PPM. A result below zero is
printed as 0.00000.
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.