Altium
Advance Projects

SGP30 Sensor with Arduino, eCO2 Sensor, Sensirion SGP30 Gas Sensor

SGP30 Sensor with Arduino:

SGP30 Sensor with Arduino, eCO2 Sensor, Sensirion SGP30 Gas Sensor- In this tutorial, you will learn how to use the SGP30 air quality sensor to display TVOC total volatile organic compounds and carbon dioxide equivalents (e) on the OLED display module. The SGP30 is a multiple gas and environmental sensor from the Adafruit. As in the previous projects we have already used environmental sensors like the MQ135 and DHT11 sensors; to measure the ammonia gas, temperature and humidity. This is another environmental sensor in which will measure some additional things like carbon dioxide and volatile organic compounds.


SGP30 sensor description:

The SGP30 sensor measures two different types of gases: volatile organic compounds (like hydrocarbons) and equivalent carbon dioxide.  This is a very fine air quality sensor made by the Sensirion to measure equivalent carbon dioxide and volatile organic compounds. It has I2C interfacing and fully calibrated output signals with a typical accuracy of 15% within measured values. If you are worried about the air quality or volatile organic compounds like benzene are getting in your house which can be dangerous to your health. Then the SGP30 is best sensor to monitor it. The SGP30 combines multiple metal-oxide sensing elements on one chip to provide more detailed air quality signals. This is a gas sensor that can detect a wide range of Volatile Organic Compounds (VOCs),  and is intended for indoor air quality monitoring. When connected to your microcontroller (running our library code) it will return a Total Volatile Organic Compound (TVOC) reading and an equivalent carbon dioxide reading (eCO2) over I2C.

SGP30 SENSOR



Carbon dioxide Equivalents:

When we are calculating the warming effect of the specific batch of gas we expressed the results in the unit carbon dioxide equivalents. As the gas warming effect is measured against the carbon dioxide therefore it is known as carbon dioxide equivalents. This enables us to compare different gases. In order to calculate warming effect of a gas we use the formula:

Where GWP is global warming potential for example if we are comparing the warming effect of 100 tonnes of methane and 10 tonnes of nitrous oxide so will perform the following calculations:

Methane:

Methane has global warming potential of 25 so by putting the values we will get:

Nitrous oxide:

For nitrous oxide the global warming potential is 298 so by putting the values we will get:

Now from the above calculation, we can conclude that 10 tonnes of nitrous oxide can produce more warming then 100 tonnes of methane. So this comparison is possible due to   equivalents which are standard unit of reference.

Volatile Organic compounds:

The volatile organic compounds are gases that are released in the air from various process and products. These gases can be dangerous to our health and can cause cancer. It can be found in both indoor and outdoor sources. In indoor sources it can be present in adhesives, paints, varnishes, air fresheners, cosmetics, fuel oil and in pressed wooden products etc. While in outdoor source it is present in wood burning, petroleum emissions and in industrial emissions etc. The excess of the Volatile organic compound can cause irritation to our eyes and can cause difficulty in breathing. We can prevent ourselves from these gases with a proper ventilation system.


Working of the SGP30 sensor:

The SGP30 has a ‘standard’ hot-plate MOX sensor, as well as a small microcontroller that controls power to the plate, reads the analog voltage, tracks the baseline calibration, calculates TVOC and eCO2 values, and provides an I2C interface. Unlike the CCS811, this sensor does not require I2C clock stretching. This sensor measures eCO2 (equivalent calculated carbon-dioxide) concentration within a range of 0 to 60,000 parts per million (ppm), and TVOC (Total Volatile Organic Compound) concentration within a range of 0 to 60,000 parts per billion (ppb). The SGP30 does have built in calibration capabilities, note that eCO2 is calculated based on Hydrogen concentration, it is not a ‘true’ CO2 sensor for laboratory use. Another nice element to this sensor is the ability to set humidity compensation for better accuracy. An external humidity sensor is required and then the RH% is written over I2C to the sensor, so it can better calculate the TVOC/eCO2 values.

Power Pins:

  • Vin – this is the power pin. Since the sensor chip uses 3V DC for logic, it consists of a voltage regulator on board that will take 3-5V DC and safely convert it down.
  • 1V8 – this is the 1.8V output from the voltage regulator
  • GND – common ground for power and logic

Data Pins

  • SCL – I2C clock pin, connect to your microcontrollers I2C clock line. Can use 3V

or 5V logic, and has a 10K pullup to Vin

  • SDA – I2C data pin, connect to your microcontrollers I2C data line. Can use 3V or

5V logic, and has a 10K pullup to Vin


Amazon Links:

Arduino

Gas Sensor SGP30

SSD1306 Oled display Module

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Circuit diagram for SGP30 Quality sensor with Arduino nano:

In order to connect the SGP30 sensor with Arduino we will make the following connections:

  • Connect the 3V of the Arduino Nano with the Vin of the SGP30
  • Connect the ground of the Arduino Nano with the ground of the SGP30
  • Connect the SDA pin of the SGP30 with the A4 of the Arduino Nano
  • Connect the SCL pin of the SGP30 with the A5 of the Arduino Nano

As we are display the data on the OLED so we will make the following connections:

  • Connect the VCC of the OLED with 3V of the Arduino Nano
  • Connect the Ground of the OLED with ground of the Arduino Nano
  • Connect the SDA pin of the OLED with A4 pin of the Arduino Nano
  • Connect the SCL pin of the OLED with A5 pin of the Arduino Nano

SGP30 SENSOR


Required library for SGP30 Sensor:

Now in order to install the library, first, we will open the library manager and install Adafruit SGP30 Sensor library.

SGP30 SENSOR

After installing the library we will open the SGP30test example

SGP30 SENSOR

I made several changes in order to be able to display the values on the Oled display module.



SGP30 Sensor Arduino code:

 

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

Back to top button
%d bloggers like this: