Project in progress
TGS4161 CO2 Research

TGS4161 CO2 Research

Use the cheap Fiagro TGS4161 Sensor to monitor CO2

  • 5,767 views
  • 11 comments
  • 21 respects

Components and supplies

5v boost regulator
to stabilize the input USB voltage to 5.1v
×1
TGS4161 + TLC271C opamps
×4
Ard nano
Arduino Nano R3
for the logic
×1
Esp01
Everything ESP ESP8266 ESP-01
to upload the data online for analytics (very rough but i like it :) http://co2meter-vlast3k.appspot.com/testCharts.html?last=60
×1
K30 CO2 Sensor
to verify the readings
×1
2.2" TFT display
to make some readings without going online
×1

About this project

Some months ago i started researching the TGS 4161 sensor, which is quite affordable (< 30 eur, for single unit), in order to use it to monitor CO2 Levels.

The spec sheets are available here: http://www.netzmafia.de/skripten/hardware/Datenblaetter/Gassensoren/TGS4161Dtl.pdf and here: http://www.sos.sk/a_info/resource/c/figaro/tgs4161.pdf

I think the first one gives more information.

Currently I am evaluating how accurate is the sensor and whether it is possible to make it give consistent results. I've bought a dozen of those sensors and built an evaluation board to check how they work. This is how it looks like:

My TGS4161 Evaluation board

What you see (from left to right)

  • 5v boost regulator to stabilize the input USB voltage to 5.1v
  • 4x TGS4161 + TLC271C opamps
  • Arduino Nano for the logic
  • ESP8266 - to upload the data online for analytics (very rough but i like it :) http://co2meter-vlast3k.appspot.com/testCharts.html?last=60 )
  • K30 CO2 Sensor - to verify the readings
  • 2.2" TFT display - to make some readings without going online

So far I've identified few things that i would like to share with other having the same goal.

Accuracy: If used correctly - the sensor is VERY accuarte. I am comparing it to my K30 CO2 (which is rated ~3% accuracy) and I can tell that response times and readings are within 5% difference. Yet this is true only in case the TGS 4161 is correctly calibrated and used.

The following section lists my findings in this area up to now.

  1. The sensor has a very high impedance, so an Opamp is needed to read it and feed the voltage to arduino. The spec sheet suggests TLC 271. It comes with two varieties B and C. B is a more precise one. I've bought the two kinds but still have not been able to make a difference in their results.
  2. According to the formula in the spec sheet small changes in voltage, e.g. +/-4mv, result in +/-15% of the value. This is why it is very important to make accurate readings. The ADC of arduino is not very accurate, so what i do is to sample the input for 5000ms, each 100ms, and then take an average reading. (also some sources suggest to discard the first reading, so i do this as well)
  3. Since both the arduino voltage, and the TGS 4161 output are quite sensitive to the input voltage, it is important to have a stabilized voltage independent of the power supply. For this - i power it using an USB cable (4.5 - 5.2 v), then using a diode, reduce the input voltage to <4.5v, and then using a boost regulator, boost it to 5.10v (this is how much the regulator is giving)
  4. I had an issue with noise, which gave quite fluctuating readings, so i put two big electrolytic caps on both the USB input, and directly on the Arduino. This seemed to have helped a bit.
  5. Initial calibration is pretty important. According to the sheet the difference in output between 400 and 500 ppm, is 6 mv. Which on higher ppm equals to 1800-2200 ppm. My research so far shows that the CO2 levels outside are around 400 ppm (~17:00, when the trees have converted most CO2 to O2, and raises to ~430 in the morning). In an occupied house, the value seldom drops below 500ppm, regardless of ventilation. In an occupied office, when left over the weekend, the indoor CO2 Levels reach outside levels over the weekend.
  6. Temperature dependency - according to the spec sheet - to get an accurate reading the temperature has to be considered as well. Yet up to now i have not yet spent time in monitoring this.
  7. Warm-up time - According to the spec sheet, the sensor needs 12+h of initial preheat team, and then after cooling and again heating it is usable in less than 30 minutes. Up to now i have not been able to verify this. I tried with 4 sensors, and it took them more than 10 days pre-heat time, during which time their mv@400ppm was rising with ~3ppm per day. Now they seem to be stable. Yet if i cut the power for 30 minutes, then it takes ~12 hours to reach the previous output 

It is still work in progress. I will be posting more updates once I find out more details. My ultimate goal is to make it running stable and make a very simple and cheap device so that everybody could monitor the indoor CO2 levels (if desired :) ). 

I started Kickstarter campaign for this, so let's hope the trial will be successful.

Code

Code samplesC/C++
I'am not yet complete with writing the code
//coming soon

Schematics

Overview photo
This is how the Evlauation board looks like
Eval%20board

Comments

Similar projects you might like

OH HAI! on Windows 10 IoT Core

Project in progress by BuddyC

  • 12,730 views
  • 3 comments
  • 48 respects

IoT arduino ESP Garage Door opener (UD)

Project in progress by David Smerkous

  • 11,183 views
  • 6 comments
  • 16 respects

Mapping Household Temperature Flow with Cheap Sensors

Project in progress by Andrew Jawitz

  • 46,395 views
  • 15 comments
  • 126 respects

Zoned Climate Control with MediaTek's LinkIt™ Smart 7688

Project tutorial by BuddyC

  • 7,716 views
  • 5 comments
  • 18 respects

Measuring CO2 Levels aka "The Sleepiness Multiplier"

Project tutorial by Brian Carbonette

  • 5,972 views
  • 8 comments
  • 16 respects

IR Controller for Air Conditioner

Project in progress by BuddyC

  • 32,648 views
  • 8 comments
  • 23 respects
Add projectSign up / Login