Skip to main content

Quick Start

Connect the breakout over Qwiic, install the library, and print the gas concentration the cell measures, in parts per million (PPM).

You program the controller connected to this breakout. The breakout itself is not flashed: its ATtiny404 runs factory firmware.

The board is 3.3 V only. It has no regulator, so the header's 3V3 pins and both Qwiic connectors share one 3.3 V supply. Do not connect 5 V.

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, GND and the board's I2C bus (SDA1 and SCL1), so the one cable powers the board and connects it.

NULA DeepSleepSoldered Electrochemical Gas Sensor Breakout (Qwiic)
Qwiic connectorQwiic connector
Wiring diagram: the NULA DeepSleep connected to the Soldered Electrochemical Gas Sensor Breakout (Qwiic) with a Qwiic cable

The board ships at I2C address 0x30, the address the example below uses.

Without Qwiic: wire the header​

The board is not breadboard compatible. Solder the included header pins and wire the top header to your controller's 3.3 V supply, ground and I2C pins. Use SDA1 and SCL1: this example talks to the ATtiny404 bridge at 0x30, which is on SDA1 and SCL1. SDA2 and SCL2 are the bus between the ATtiny404 and the two analog chips; only the direct-address examples wire the controller there.

NULA DeepSleepSoldered Electrochemical Gas Sensor Breakout (Qwiic)
GNDGND
3V33V3
IO8SDA1
IO9SCL1
Wiring diagram: the NULA DeepSleep connected to the Soldered Electrochemical Gas Sensor Breakout (Qwiic): GND to GND, 3V3 to 3V3, IO8 to SDA1, IO9 to SCL1

2. Install the library​

Install Electrochemical Gas Sensor Soldered from its GitHub repository.

🔗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​

Open bridgeBoard from the library's examples, select your board and port, and upload it. It talks to the ATtiny404 bridge at address 0x30 and prints a reading every 2.5 seconds.

The sketch uses the carbon monoxide preset, SENSOR_CO. If your cell measures another gas, change it to that gas's preset before uploading: SENSOR_NO2, SENSOR_SO2, SENSOR_O3, SENSOR_NO, SENSOR_H2S, SENSOR_NH3 or SENSOR_CL2.

Two of the sketch's comments do not match this board. The address is set with the ADDRESS switch on the top of the board, not with jumpers on the back, and it ships at 0x30. LMPEN is not tied to GND: it goes to the header and to the ATtiny404, and the library does not drive it. The comment that mentions "legacy boards with 0x49/0x4A/0x4B" means boards read at those addresses, where the library talks to an ADS1115 directly instead of to the bridge. This board answers at 0x30 to 0x37. Where the comments speak of the new ATtiny404 bridge board, they mean a board with the ATtiny404 bridge, which is what this board has.

Select Board
bridgeBoard.ino
/**
**************************************************
*
* @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);
}

🔗Open the complete example

examples/bridgeBoard at commit c4df54b

→

4. Check the result​

Open the Serial Monitor at 115200 baud. When the board answers, the sketch prints:

Serial MonitorAutoscrollShow timestampNewline115200 baud
Message (Enter to send message to the board)
Sensor initialized successfully!
Sensor reading: 0.30045 PPM
Sensor reading: 0.30838 PPM
Sensor reading: 0.32838 PPM
Sensor reading: 0.30712 PPM

A new reading line arrives every 2.5 seconds: Sensor reading: , the concentration with five decimals, and PPM. A negative result 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. The sketch stops there; fix the connection, then press reset.

5. If it does not work​

Continue with Troubleshooting and retry this smallest example after each change.