Skip to content

This library calculates slopes of gas sensors (MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9, MQ-131_low/high, MQ-135, MQ-136, MQ-137, MQ-138, MQ-214, MQ-216, MQ303A, MQ303B, MQ306A, MQ307A, MQ309A). Ceates data science visualization applications featuring 4D Slope Estimation with 3D MQ Graph Simulation.

License

Notifications You must be signed in to change notification settings

abcdaaaaaaaaa/MQDataScience

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQSpaceData v5.1.5

MQDataScience What can be create?

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

1) Advanced Data Science System for Regression Calculations

MQ-135_gas_curves

2) Ppm Analysis of Different Model Gases

MQ303A_Ppm_Analysis

3) Formulated Correction Coefficients depending on Temperature and Humidity

MQ-135_correction_coefficient

4) 3D Surface Diagram for MQ-135 Gases

MQ135_CO2_3D)

5) Slope Estimation in Time-Dependent 4D Space

4D_Slope_Estimation

4D Axis Features:

4dformullas

Ppm Formullas

log

loghello)

image1 image2
    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).

y = ax^b --> ppm = a×ratio^b

Therefore, we need to make a transition according to the formula:

image3

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

V = I × R

image4
image5

Calculate Ratio

image6

Ratio for Sensors

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]

Inclusion of Correction Factor

ppmlast

STEL Limit For Gases

STEL_LIMIT_FOR_GASES

SuggestedRL For MQ Sensors

suggestedRL

Check out all our DataScience libraries under the SpaceData series!

"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

For detailed explanation, You can also check out the github Wiki Page!

You can access the library's article Here!

About

This library calculates slopes of gas sensors (MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9, MQ-131_low/high, MQ-135, MQ-136, MQ-137, MQ-138, MQ-214, MQ-216, MQ303A, MQ303B, MQ306A, MQ307A, MQ309A). Ceates data science visualization applications featuring 4D Slope Estimation with 3D MQ Graph Simulation.

Topics

Resources

License

Stars

Watchers

Forks