A library for the MQ2 sensor. Based on https://github.com/labay11 and http://sandboxelectronics.com/?p=165

Dependents:   mq2_example mq2_midtermproject ECE595_Group9_FinalProject mq2_example ... more

Files at this revision

API Documentation at this revision

Comitter:
azazeal88
Date:
Wed Nov 08 10:43:37 2017 +0000
Parent:
6:c0ebeb4b47b6
Commit message:
RL_VALUE has been changed to 1 to reflect the sensors that we have (ours are used in teaching). Default is commonly around 5K, but check RL for your specific application!

Changed in this revision

MQ2.h Show annotated file Show diff for this revision Revisions of this file
--- a/MQ2.h	Fri Oct 06 08:58:43 2017 +0000
+++ b/MQ2.h	Wed Nov 08 10:43:37 2017 +0000
@@ -3,7 +3,7 @@
 
 #include "mbed.h"
 
-#define RL_VALUE                    5                                           //define the load resistance on the board, in kilo ohms
+#define RL_VALUE                    1                                           //define the load resistance on the board, in kilo ohms
 #define RO_DEFAULT                  10                                          //Ro is initialized to 10 kilo ohms
 #define RO_CLEAN_AIR_FACTOR         9.83f                                       //RO_CLEAR_AIR_FACTOR=(Sensor resistance in clean air)/RO, which is derived from the chart in datasheet
 #define CALIBARAION_SAMPLE_TIMES    5                                           //define how many samples you are going to take in the calibration phase