Skip to main content

Grove - Formaldehyde sensor


Grove Formaldehyde Sensor can detect formaldehyde around 0~1000 ppb with low cross-sensitivity to alcohol and high stability of 6 years lifetime. Built-in RHT sensor ensures it maintains fine performance under different temperatures and humidity and it transmits data through UART and I2C ports.

Features

  • Low cross-sensitivity to alcohol
  • Standard formaldehyde measurement range: 0 ~ 1000 ppb
  • Long-term stability and 6 years’ service lifetime
  • Patented electrochemical cell with anti-dry technology
  • I2C/UART interface with lifetime-calibrated output
  • Maintain performance under different temperatures and humidity: compensated via Sensirion RHT sensor

Specification

ParameterValue/Range
Supply voltage range3.3V or 5V
Measurement range0 to 1,000 ppb
Response time<2 min
Limit of detection<20 ppb
InterfaceI2C / UART
Formaldehyde accuracy±20 ppb or ±20% of measured value, whichever is larger

Platforms Supported

ArduinoRaspberry
caution

The platforms mentioned above as supported is/are an indication of the module's software or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Getting Started

note

If this is the first time you work with Arduino, we highly recommend you to see Getting Started with Arduino before the start.

Play With Arduino

Hardware

  • Step 1. Prepare the below stuffs:
Seeeduino V4.2Base ShieldGrove-Formaldehyde Sensor
enter image description hereenter image description hereenter image description here
Get One NowGet One NowGet One Now
  • Step 2. Set the button on the Grove-Formaldehyde Sensor to the "1" position.

  • Step 3. Plug Grove - Base Shield into Seeeduino and set Grove-Formaldehyde Sensor to I²C port of Grove-Base Shield
  • Step 4. Connect Seeeduino to PC via a USB cable.

note

If you don't have Grove Base Shield, it still can be directly connected Grove-Formaldehyde Sensor to Seeeduino as below.

SeeeduinoGrove-Loudness Sensor
5VRed
GNDBlack
SDAWhite
SCLYellow

Software

tip

Also you can download the lib directly by searching Sensirion I2C SFA3X in the library manager.

#include <Arduino.h>
#include <SensirionI2CSfa3x.h>
#include <Wire.h>

SensirionI2CSfa3x sfa3x;

void setup() {

Serial.begin(115200);
while (!Serial) {
delay(100);
}

Wire.begin();

uint16_t error;
char errorMessage[256];

sfa3x.begin(Wire);

// Start Measurement
error = sfa3x.startContinuousMeasurement();
if (error) {
Serial.print("Error trying to execute startContinuousMeasurement(): ");
errorToString(error, errorMessage, 256);
Serial.println(errorMessage);
}
}

void loop() {
uint16_t error;
char errorMessage[256];

delay(1000);
int16_t hcho;
int16_t humidity;
int16_t temperature;
error = sfa3x.readMeasuredValues(hcho, humidity, temperature);
if (error) {
Serial.print("Error trying to execute readMeasuredValues(): ");
errorToString(error, errorMessage, 256);
Serial.println(errorMessage);
} else {
Serial.print("Hcho:");
Serial.print(hcho / 5.0);
Serial.print("\t");
Serial.print("Humidity:");
Serial.print(humidity / 100.0);
Serial.print("\t");
Serial.print("Temperature:");
Serial.println(temperature / 200.0);
}
}
  • Step 4. In this program, Seeeduino can monitor the formaldehyde gas concentration, air humidity and temperature data in real-time. By opening the 'Serial Monitor', the results should be like:

Play With Raspberry Pi

Hardware

  • Step 1. Prepare the below stuffs:
Raspberry piGrove Base Hat for Raspberry PiGrove-Formaldehyde Sensor
enter image description hereenter image description hereenter image description here
Get One NowGet One NowGet One Now
  • Step 2. Plug the Grove Base Hat for Raspberry Pi into Raspberry Pi.
  • Step 3. Connect Grove-Dust Sensor to I²C port of Grove Base Hat for Raspberry Pi.
  • Step 4. Connect the Raspberry Pi to PC through a USB cable.

Software

  • Step 1. Follow Setting Software to configure the development environment of Resberry Pi.

  • Step 2. Download the Grove-Formaldehyde Sensor Library and unzip it to the Raspberry Pi.

  • Step 3. Navigate to the demos' directory. The following command can monitor the concentration of formaldehyde, humidity and temperature.

cd ~/raspberry-pi-i2c-sfa3x-master
make
./sfa3x_i2c_example_usage
tip

In this wiki we use the path ~/embedded-sfa3x-main/i2c instead of /home/pi/Desktop/embedded-sfa3x-main/i2c, you need to make sure Step 2 and Step 3 use the same path.

Here is the sfa3x_i2c_example_usage.c code.

#include <stdio.h>  // printf

#include "sensirion_common.h"
#include "sensirion_i2c_hal.h"
#include "sfa3x_i2c.h"

/**
* TO USE CONSOLE OUTPUT (PRINTF) IF NOT PRESENT ON YOUR PLATFORM
*/
//#define printf(...)

int main(void) {
int16_t error = 0;

sensirion_i2c_hal_init();

error = sfa3x_device_reset();
if (error) {
printf("Error resetting device: %i\n", error);
return -1;
}

uint8_t device_marking[42];
error = sfa3x_get_device_marking(&device_marking[0], sizeof(device_marking));
if (error) {
printf("Error getting device marking: %i\n", error);
return -1;
}
printf("Device marking: %s\n", device_marking);

// Start Measurement
error = sfa3x_start_continuous_measurement();
if (error) {
printf("Error executing sfa3x_start_continuous_measurement(): %i\n",
error);
}

for (;;) {
// Read Measurement

int16_t hcho;
int16_t humidity;
int16_t temperature;

sensirion_i2c_hal_sleep_usec(500000);

error = sfa3x_read_measured_values(&hcho, &humidity, &temperature);

if (error) {
printf("Error executing sfa3x_read_measured_values(): %i\n", error);
} else {
printf("Measurement:\n");
printf(" Formaldehyde concentration: %.1f\n", hcho / 5.0f);
printf(" Relative humidity: %.2f\n", humidity / 100.0f);
printf(" Temperature: %.2f\n", temperature / 200.0f);
}
}

error = sfa3x_stop_measurement();
if (error) {
printf("Error executing sfa3x_stop_measurement(): %i\n", error);
}

return 0;
}

success

If everything goes well, the following results can be displayed like:

pi@raspberrypi:~/Downloads/embedded-sfa3x-main/i2c $ ./sfa3x_i2c_example_usage
Device marking: 211117825F073B80
Measurement:
Formaldehyde concentration: 0.0
Relative humidity: 70.19
Temperature: 27.41

You can quit this program by simply press ++ctrl+c++.

Upgradable to Industrial Sensors

With the SenseCAP S2110 controller and S2100 data logger, you can easily turn the Grove into a LoRaWAN® sensor. Seeed not only helps you with prototyping but also offers you the possibility to expand your project with the SenseCAP series of robust industrial sensors.

The IP66 housing, Bluetooth configuration, compatibility with the global LoRaWAN® network, built-in 19 Ah battery, and powerful support from APP make the SenseCAP S210x the best choice for industrial applications. The series includes sensors for soil moisture, air temperature and humidity, light intensity, CO2, EC, and an 8-in-1 weather station. Try the latest SenseCAP S210x for your next successful industrial project.

Loading Comments...