"The first and only Arduino library where MQ Sensors combine with Data Science"




if r_squared >= 0.9995:
print("R-squared value for {gas name} is above 0.9995, plotting against first and last values.")
x0, y0 = x[0], y[0]
xn, yn = x[-1], y[-1]
b = np.log10(yn/y0) / np.log10(xn/x0)
a = 10**(np.log10(yn) - b * np.log10(xn))
b2 = np.log10(yn) - b * np.log10(xn)
b2_rounded = round(b2, 4)
a_rounded = round(a, 4)
b_rounded = round(b, 4)
The first formula is determined according to all points (OldCurve.py, OldCurve), while the second formula is determined according to the first and last point. Therefore, in order to collect them all in the same formula and to increase the accuracy rate, we used the method in the second formula and took the logarithm (if R^2 = 1 (%100) always: logm = valueb, logb = log10(valuea)) for slopes greater than 99.95% and collected them all in the first formula, thus we increased the accuracy rate without having to use 2 different formulas (Regression.py, NewCurve).
Therefore, we need to make a transition according to the formula:

In data graphs, the x-axis is given as ppm and the y-axis is given as ratio.



STATUS 1: MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9, MQ-135, MQ-136, MQ-137 [Almost All & Standart]
STATUS 2: MQ303A, MQ303B, MQ307A, MQ309A [A Models & B Models]
STATUS 3: MQ-131_LOW, MQ131 [MQ131 Models]

"The first and only Arduino library series where Gas Sensors and Geiger Counter combine with Data Science"
Library | Scope |
---|---|
MQDataScience | MQ2, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, MQ9, MQ131_LOW, MQ131_HIGH, MQ135, MQ136, MQ137, MQ138, MQ214, MQ216, MQ303A, MQ303B, MQ306A, MQ307A, MQ309A Gas Sensors |
TGSDataScience | TGS2600, TGS2610, TGS2611 TGS2620, TGS2612, TGS2442, TGS2201, TGS4161, TGS8100, TGS813, TGS822, TGS2602, TGS6812 Gas Sensors |
MG811DataScience | MG811 Gas Sensor |
SP3S-AQ2DataScience | SP3S-AQ2-01 Gas Sensor |
RadioactiveDataScience | Geiger Counter |