troyka-mq2

vasily/troyka-mq2/troyka-mq2

The library allows you to work with a sensor of a wide range of gases. It is suitable for detecting H2, LPG, CH4 or Smoke. Calibration is required for the sensor to work correctly. Calibration occurs 60 seconds after the start of work. If the voltage of the ADC is different from 5 V, you must specify the supply voltage of the ADC
troyka-mq2
@/troyka-mq2
The library allows you to work with a sensor of a wide range of gases. It is suitable for detecting H2, LPG, CH4 or Smoke. Calibration is required for the sensor to work correctly. Calibration occurs 60 seconds after the start of work. If the voltage of the ADC is different from 5 V, you must specify the supply voltage of the ADC
PORTport
Analog port to read from sensor. Should start with `A` to succeed.
AVCCnumber
Supply voltage of the analog part of the microcontroller.
R0number
Sensor resistance in clean air.
UPDpulse
Triggers new read
Tnumber
Calibration timeout
troyka-mq2
LPG
CH4
SMOK
H2
OK
ERR
PORT
AVCC
R0
UPD
T
ERRpulse
Fires if update failed. E.g. `PORT` is not an ADC port.
OKpulse
Fires on reading complete. Start after calibration is complete.
H2number
The value of H2 in the air in ppm.
SMOKnumber
The value of smoke in the air in ppm.
CH4number
The value of CH4 in the air in ppm.
LPGnumber
The value of LPG in the air in ppm.
To use the node in your project you should have the vasily/troyka-mq2 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.