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:
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.
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.
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.
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".
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.com
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. sht4.setHeater(SHT4X_NO_HEATER); switch (sht4.getHeater()) { case SHT4X_NO_HEATER: Serial.println(F("SHT40 Heater turned OFF")); break; case SHT4X_HIGH_HEATER_1S: Serial.println(F("SHT40 Heater: High heat for 1 second")); break; case SHT4X_HIGH_HEATER_100MS: Serial.println(F("SHT40 Heater: High heat for 0.1 second")); break; case SHT4X_MED_HEATER_1S: Serial.println(F("SHT40 Heater: Medium heat for 1 second")); break; case SHT4X_MED_HEATER_100MS: Serial.println(F("SHT40 Heater: Medium heat for 0.1 second")); break; case SHT4X_LOW_HEATER_1S: Serial.println(F("SHT40 Heater: Low heat for 1 second")); break; case SHT4X_LOW_HEATER_100MS: Serial.println(F("SHT40 Heater: Low heat for 0.1 second")); break; }
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.
xkcd.com
Datasheet SGP40 Sensirion (pdf file)
Datasheet SHT40 Sensirion (pdf file)
Schematics Breakout Board BlueDot SGP40+SHT40 (pdf file)
xkcd.com