SensorValue = sensorValue / 500.0 //Take average of readings SensorValue = sensorValue + analogRead(A0) //Add analog values of sensor 500 times Without the presence of other gases, or in fresh airįloat sensor_volt //Define variable for sensor voltageįloat RS_air //Define variable for sensor resistanceįloat sensorValue //Define variable for analog readings ![]() The resistance of the sensor at a known concentration This example is for calculating R0 which is ![]() This has to be done in clean air (without any gasses). Example conversion codeįor calibration with a known concentration you can use the following code. The example has been programmed in the arduino coding language. This example can be found here and has not been tested. An example for a conversion from analog values to ppm values can be found below. Other technical specifications can be found here along with data for a conversion formula from resistance to gas concentrations. If a lower voltage is used, the heathing element inside the sensor will not work correctly and the received values will be incorrect. ![]() The supply voltage for the sensor is 5 V. The converted value can be used in calculations to get the ppm value of the detected gas. The sensor itself returns a analog voltage that can be converted using an ADC, for more information see this link. For detecting methane gas the MQ-4 is a good choice.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |