Experimenting with Gas Sensors and Arduino

Sensors

We have 4 different Gas Sensors on our web shop: MQ-2, MQ-3, MQ-7 and MQ-135.

All they work on same principle: sensor element is heated and it’s conductivity change with the gas concentration.

The heater require 5V and have 31 ohm resistance, so your power supply should provide 200mA of current for the sensor.

Sensor have both analog and digital output, the analog output is 0-5V, the digital output is frequency related to the output value.

MQ-2 is sensor of LPG, Propane, Methane and Hydrogen gas and can be used for domestic gas leak alarms
MQ-3 is sensor of Alcohol and Benzine and can be used for breath analizer
MQ-7 is sensor of Carbon monoxide CO and can be used for car gases analizer
MQ-135 is sensor of NH3, NOx, Alcohol, Benzine, Smoke, CO2 and can be used for quality of air analizer

We did some experiments today with all four sensors connecting them to OLIMEXINO-32U4 (Arduino Leonardo compatible).

The sensors have 4 pins: AO – Analog Output, DO – Digital output, GND, VCC-5V

MQ-1 MQ-2

OLIMEXINO-32U4 should be switched to work on 5V.

Three wires are used: AO from sensor to A0 of Arduino, VCC from sensor to 5V, GND from sensor to GND of Arduino.

The sketch is simple:

int sensorPin = A0;
int sensorValue = 0;
void setup() {
 Serial.begin(9600);
 pinMode(sensorPin, INPUT);
}
void loop() {
 sensorValue = analogRead(sensorPin);
 Serial.println(sensorValue);
}

It reads the sensor value and print it on Serial terminal.

Note that when sensor are power up they need about 1 minute to settle, in this time the heater heats up the sensor.

We experimented with Isopropile alcohol, Benzine, Lighter Gas, human breath of two different persons 🙂

Here is the measured data:

MQ-2 normal air output  100
     Isopropile alcohol 540
     Ligther Gas        760
     Benzine            450
     Breath1            150
     Breath2            140
MQ-3 normal air output 180
     Isopropile alcohol 800
     Lighter Gas        400
     Benzine            700
     Breath1            220
     Breath2            270
 
MQ-7 normal air output  150
     Isopropile alcohol 750
     Lighter Gas        900
     Benzine            800
     Breath1            170
     Breath2            160
MQ-135 normal air output 130
      Isopropile alcohol 700
      Lighter Gas        760
      Benzine            450
      Breath1            150
      Breath2            140

the results are:

MQ-2 shows good sensibility to Lighter Gas

MQ-3 detects well Isopropile alcohol and Benzine

MQ-7 detects well Isopropile alcohol, Lighter gas and Benzine

MQ-135 detects well Isopropile alcohol, Lighter gas

Experimenting with low power modes and Arduino

Image

Tero Koskinen recently did interesting experiments exploring how low power he can go with Arduino. http://arduino.ada-language.com/saving-power-with-avr-ada.html

He made setup with 5 boards to test:

  • original Arduino Duemilanove
  • original Arduino UNO
  • Olimexino-328 clone
  • Arduino DIY PTH kit from Sparkfun
  • Diavolino from Evil Mad Scientist

He correctly shut down all not used peripherials, Brown-Out-Detection, slowed down the CPU speed and used Power Saving modes.

the results were:

Device Current
Duemilanove 7.50mA
UNOr3 18.10mA
Olimexino-328 4.00mA
Sparkfun PTH Kit 7.60mA
Diavolino 0.50mA

 

Diavolino have nothing but the AVR so obviously is winner with this setup with only 0.5mA consumption.

Wait if there is no power regulator where these 0.5mA go when AVR is put in low power mode?

Looking at the schematic  you can see R1 RESET pullup 10K resistor which is connected to 5V -> 5V/10K = 0.5mA the whole consumption is taken by R1!!!

 

Then let’s see OLIMEXINO-328 the second place with 4mA (outch!) this board is promoted by OLIMEX as SUPER DUPER LOW POWER BOARD then why these bad results? Where these  4mA go?

The answer is obvious: Tero is powering OLIMEXINO-328 by the POWER JACK.

In our design we assume if the power come from the power jack it’s unlimited and we can waste it as much as we need – charging Lipo (if attached) etc.

So these 4mA are taken from the DCDC in the input.

If Tero wanted to see how OLIMEXINO-328 shines in low power he should have powered the board by the battery connector. When the power is applied to battery OLIMEXINO-328 is very humble and will need less 20 micro ampers 0.02 mA to operate!

How this is done? If we look at the schematic we will see that there is no RESET pull-up, but the RESET is done by tricky circuit with R12/R13/SD5/C7/C8 this schematic have zero consumption but still perform RESET functionality.

Also unltra-low-power LDO which needs just 3 micro amps to operate MCP1700T-3302E/MB is used for power regulator.

This makes possible complete Arduino to may keep working while consuming less 20 micro amps.

What 20 micro amps consumption means? If you use our standard LiPo 1400 mAh battery your board can work 70 000 hours or 3 years!

The other boards: Sparkfun kit 7.6 mA, Duemilanove 7.5mA and UNO 18.1 mA just use cheap voltage regulators which take this current, but it’s OK they have not been designed to be low power.

What is the conclusion: with right setup (powering from battery) OLIMEXINO-328 is the lowest power Arduino solution on the market! When we add to the low power the industrial temperature operation range -25+85C and the possibility to work with any input voltages from 9 to 30VDC, OLIMEXINO-328 is the most sophisticated board with many features while keeping the price reasonable.