BlueDot SGP40+SHT40 Indoor Air Quality VOC Sensor


The SGP40 is Sensirion's new digital gas sensor designed for integration into air treatment devices and air quality monitors. The sensor provides a digital raw signal which is sensitive to most volatile organic compound (VOC) gases typically present in indoor environments. The signal is proportional to the logarithm of the resistance of the sensing material.


The raw signal from the SGP40 is processed by Sensirion's Gas Index Algorithm, which provides a VOC Index as a robust measure for indoor air quality. For improved accuracy, the Gas Index Algorithm reads the temperature and relative humidity measurements from the second sensor on this board, the SHT40 from Sensirion. This way, the Gas Index Algorithm adapts to environment conditions the sensor is exposed to.


The VOC Index is a value ranging from 1 to 500. The value 100 refers to the average indoor gas composition over the past 24 hours. While values between 100 and 500 indicate a deterioration, values between 1 and 100 inform about improvement of the air quality.


The temperature and humidity sensor SHT40 also contains a temperature-controlled micro hotplate, which can be used for self-decontamination. This is particularly useful for creep compensation caused by extended exposure to high humidity or environments with solvents present. 


Here are the board's main features:

  • High Repeatability. Typical repeatability of ±5 VOC Index points at 25°C and 50% relative humidity.
  • Temperature and Humidity Compensation. The measurements from the SHT40 are used by the Gas Index Algorithm to improve the accuracy of the VOC Index.
  • Wide Range Supply Voltage. The sensor operates from 1.8 V and 5.5 V at VCC, dispensing the need of voltage regulation. 
  • I2C Communication. Using the I2C communication protocol you need no more than two wires to transfer data from and to your board. 
Get your BlueDot BME280 Board at Amazon!

Technical Data

Technical Data from BME280 Sensor


The first step with the TMP117 Temperature Sensor Sensor is to solder the 6 pin header that comes along with the board. The easiest way to solder the board is to insert the header into a breadboard (long pins down) and solder the short pins to the board.

Assembly: Breakout Board with header pin
Assembly: Insert header pin into breadboard
Assembly: Solder BlueDot Board to header pin

Connecting via I2C

It is very easy to connect the SGP40 and the SHT40 sensors to the I2C bus. The first step is to connect the board to the power supply.

  • VCC Pin. Connect the VCC pin from the board to either 5V or 3.3V output from your Arduino. 
  • GND Pin. Connect the GND pin from the board to the GND from the Arduino.

Great! Now we need to connect the sensor to the I2C bus. The I2C communication uses basically two wires. The clock signal is generated by the Arduino and transferred to the sensor through the SCL line. The Arduino can send commands to the sensor using the SDA line. Just as well, all data from the sensor goes back to the Arduino through the SDA line. Because of that, the SDA line is bidirectional.

  • SDA Pin. Connect the SDA pin from the board to the SDA line on the Arduino. This corresponds to the pin A4 on the Arduino Uno.
  • SCL Pin. Connect the SCL pin from the board to the SCL line on your Arduino. This corresponds to the pin A5 on the Arduino Uno.
I2C Wiring for BlueDot BME280 Board

Installing Arduino Library

The BlueDot Library for the Arduino contains an example sketch to run the SGP40 and SHT40 sensors, and is based on the Adafruit libraries for both sensors.


You can download and install the library directly from the Arduino IDE. Just open the Arduino IDE and go to Sketch > Include Library > Manage Libraries... and search for the BlueDot on the Library Manager. You can find this library under the name "BlueDot SGP40 SHT40".

Arduino IDE: Opening Library Manager
Arduino IDE: Installing BlueDot BME280 library

Alternatively,  you can download the latest version of the library from the Github repository or just click on this link to get it directly from our Website!

xkcd: commented

Upload Example-Sketch

After installing the library we can open an example sketch. Just go to File > Examples > BlueDot SGP40 SHT40 and open the sketch SGP40_SHT40_Test.


At the start of the sketch you can make a few changes to your SHT40 setup, but you can upload and run your sketch without changes as well. 


The default setup for the SHT40 is to run all measurements with high precision.Changing the measurement precision affects the measurement duration, noise level and energy consumption of your sensor. If power consumption is not an issue for your application, just run the sensor with high precision.


   //Here we can configure the SHT40 Temperature and Humidity Sensor 
//First we set the measurement precision //There are three precision levels: High, Medium and Low //The precision levels direclty affect the measurement duration, noise level and energy consumption //On doubt, just leave it on default (High precision) sht4.setPrecision(SHT4X_HIGH_PRECISION);

switch (sht4.getPrecision()) { case SHT4X_HIGH_PRECISION: Serial.println(F("SHT40 set to High precision")); break; case SHT4X_MED_PRECISION: Serial.println(F("SHT40 set to Medium precision")); break; case SHT4X_LOW_PRECISION: Serial.println(F("SHT40 set to Low precision")); break;

The second setup allows you to activate the internal hotplate from the SHT40 sensor, as well as to adjust the temperature level and heating duration.


But why would you need to activate the hotplate in the first place? The SHT40 is a polymer-based capacitive sensor, which operates best between 5°C to 60°C and 20% and 80% relative humidity. When the sensor is permanently operating at in an environment with very high relative humidity, for example close to 90%, the measured value may slowly increase due to an offset.


You can correct this offset by activating the hotplate and shortly increasing the temperature from the SHT40. By periodically activating the hotplate you can eliminate any long-term offsets caused by high humidity. For more information, please consult Sensirions application note on the subject.


  // The SHT40 has a built-in heater, which can be used for self-decontamination.
  // The heater can be used for periodic creep compensation in prolongued high humidity exposure.
  // For normal operation, leave the heater turned off.


  switch (sht4.getHeater()) {
     case SHT4X_NO_HEATER: 
       Serial.println(F("SHT40 Heater turned OFF"));
     case SHT4X_HIGH_HEATER_1S: 
       Serial.println(F("SHT40 Heater: High heat for 1 second"));
     case SHT4X_HIGH_HEATER_100MS: 
       Serial.println(F("SHT40 Heater: High heat for 0.1 second"));
     case SHT4X_MED_HEATER_1S: 
       Serial.println(F("SHT40 Heater: Medium heat for 1 second"));
     case SHT4X_MED_HEATER_100MS: 
       Serial.println(F("SHT40 Heater: Medium heat for 0.1 second"));
     case SHT4X_LOW_HEATER_1S: 
       Serial.println(F("SHT40 Heater: Low heat for 1 second"));
     case SHT4X_LOW_HEATER_100MS: 
       Serial.println(F("SHT40 Heater: Low heat for 0.1 second"));

After starting the sketch, you will notice that the VOC Index will still be at zero. This is normal and only lasts for a few moments.

The VOC Index will slowly increase and after a few minutes will stabilize around 100. As mentioned earlier, values between 100 and 500 indicate a deterioration of the indoor quality and values below 100 indicate an improvement.

Get your BlueDot BME280 Board at Amazon!

xkcd: degrees


Schematics for BlueDot BME280 Board


Get your BlueDot BME280 Board at Amazon!

xkcd: lightsaber