Figaro TGS2620 Sensor Calibration

Hello guys,

I need to calibrate Figaro TGS2620 sensor. Should i get Arduino Uno? How can I get the codes for TGS2620 calibration? I would appreciate your help. Thank you...

Do you have the calibration gases?

Hello Jim thanks for the immediate answer. Yes I will order ethanol calibration gases in different ppm ranges (there are these ranges available on internet: 150 ppm/260.5 ppm/130ppm/192 ppm/260 ppm in N2)

Here is the datasheet for the sensor. They seem to use 300ppm to do the calibrations.
Are you actually trying to measure gas concentrations or do you just want to make an alarm, meaning just detect when the ppm goes over some level.

Serija-TGS-2620.pdf (645.1 KB)

i need to calibrate it for the baker's yeast facility that i am working which is used for to detect gases like ethanol so the goal is not making an alarm

Well, I’ve have never used one of those sensors so I could not supply you with a ready made solution including hardware and software. An alarm can easily be done with an Uno but I have no experience in using that sensor for measuring gas concentrations.

Wait at least 24 hours to see if others can help.

Interesting project,

A quick google gave no code for this sensor, and little code for possible related sensors.
(I did not check if these are technical-look-alikes)

The blog might be useful as you might repeat the steps taken.

Hello, thank you for your answer. By using the datasheet and Python code on the blog I think I can create a code in Python, but I will choose the ethanol curve since that is the gas that I am interested in. Now i have to think about when calibrating it, how i am going to provide ethanol vapor. Videos with Arduino, I just only saw lighter to detect smoke or just simply air. Thank you...

Please let us know how your process continues and what your code looks like.

It will be useful for future users of the sensor.

Another document of a related sensor (not read it)

Throwed some estimated points from the TGS2620 datasheet in spreadsheet

Approximations of calibrate parameters PPM = a * pow(Rs/R0, b);

graph a b
methane 40326,4527 -2,4245189
CO 1354,64785 -1,7801573
ISO-butane 563,810190 -1,7098237
Hydrogen 358,088021 -1,8791876
Ethanol 320,799771 -1,5398176
Spreadsheet raw numbers 
f(x) = 40326,4526622636 x^-2,42451890362475
f(x) = 1354,64785299791 x^-1,78015730335775
f(x) = 563,810189715868 x^-1,70982365658289
f(x) = 358,088020604221 x^-1,87918756975433
f(x) = 320,799770799109 x^-1,53981762140293

Note: TGS2600/10 have other calibration numbers for same gases

@ryyyyy
Yesterday and today I wrote an initial version of an Arduino library (C++) for the TGS2620.

The library can be used with an internal ADC or an external one.

It is not tested with hardware however I expect it to work as it was not that complex.

If possible, please give it a try.

Hello Rob, thank you so much for your time. Yesterday I started to write the code on Python as well and I got this equation: 378.36x^-1.62. It is not finalized yet, but I will be trying your code with Arduino Uno and see if it works, and let you guys know.

Found with spreadsheet this formula for Ethanol which has different coefficients
f(x) = 320,799770799109 x^-1,53981762140293

The points I used

Ethanol
3,6 50
2 100
1 300
0,48 1000
0,2 4000

Which points did you use?

From the TGS2620 datasheet - Rs/Ro vs gas concentration ppm graph: for 100 ppm we have 2 Rs/Ro, 300 ppm = 1 Rs/Ro, 500 ppm = 0.7 Rs/Ro, 1000 ppm = 0.5 Rs/Ro, 3000 ppm = 0.3 Rs/Ro, 5000 ppm = 0.2 Rs/Ro. I wrote the python code as:
'from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import numpy as np

x = [2, 1, 0.7, 0.5, 0.3, 0.2]
y = [100, 300, 500, 1000, 3000, 5000]
popt, pcov = curve_fit(lambda fx,a,b: a*fx**-b, x, y)
x_linspace = np.linspace(min(x), max(x), 100)
power_y = popt[0]x_linspace*-popt[1]
plt.xlabel('rs/ro')
plt.ylabel('concentration (ppm)')
plt.scatter(x, y, label='data points', c= 'red', alpha = 0.5, s = 18)
plt.plot(x_linspace, power_y, label='power fit regression (smooth)')
plt.legend()
plt.show()
print('The regressions equation is {:.2f}x^-{:.2f}'
.format(popt[0],popt[1]))'
and it gave me that eqn.

Thanks, 2 points are the same.

Will make a note to check the values I extracted from the datasheet again.


update: created a GitHub issue for this

FYI,

Checked my library points and your points against the graph in the datasheet

Think the last two points are not 100% correct
and you could add the first point for 50 PPM
as that part of the working range was missing.

x = [2.3, 2, 1, 0.7, 0.5, 0.2, 0.19]
y = [50, 100, 300, 500, 1000, 4000, 5000]

Please check the FIGARO manual. The Sensor runs only in air.
Use Calibration Gas in air or use calibration gas with higher concen-
tration in nitrogen and dilute it with air. The sensor shows only the
"correct" concentration in air because it is a "half conducting (?)" sensor
which works only in the presence of about 20,9 % of oxygen, s.Figaro