Reason of this project
The MQ4 discover the concentration of gas and outputs analog value which can be transforming to digital measure. The value of the digital estimate will be 10 byte long and range from 0 to 1022. The project permit the user to adjust the hazardous level for leakage based on the same digital measure. When the value adjusts by the user matches with that of the value distinguish by the sensor, it supplicates the alarm. The MQ4 sensor can be measured by joining a load resistance of steady value with the sensor.
Gas Sensor Interfacing with Arduino
The whole project is constructing on Arduino. The program code managing the project is developed on Arduino.
MQ4 Gas Sensor
Sensor measuring formula:
The sensor measures the compression of leaked gas according to the following formula
Concentration = 1036.5*R^-2.392
Where concentration is LPG in ppm
R is the ratio of the resistance of sensor which is the resistance at 1000ppm at 20 Celsius and 60% humidity.
Rs = (1020/ADC-DATA-1)*RL
Rs is the resistance of the sensor
Digital reading varies from 0 to 1020
RL is load resistance varies from 10K to 40K.
Therefore, for a fixed RL, the reading is proportionate to the concentration of gas.
How the project works?
- Setting the sensitivity level: When the gadget is switched ON. Some starting messages are displayed on the LCD and after 3 seconds the user is impelled to adjust the sensitivity level. The user can raise the sensitivity level in increments of 200,300,400 and 500 by pushing one switch. On pushing the switch the value for allusion increases then decreases frequently.
- Monitoring Gas Concentration: Once the allusion value is set, the program code on Arduino keeps eyes on the analog value peruse from the MQ4 sensor. The device is programmed to peruse current sensor reading as analog value and transform it to a digital form. The digital measure is differentiating with the user defined allusion value in an infinite loop.
I hope you consider this guide useful.
Share this post those friends that also love electronics! You can communicate me by leaving a comment. Thanks.
gas sensor pinout circuit arduino simulation