In this tutorial we will see , how we can interface MQ135 Gas Sensor with Aries v2.0 Board.

MQ135 Gas Sensor Module

MQ135 Gas Sensor is an air quality sensor for detecting a wide range of gases, including NH3, NOx, alcohol, benzene, smoke and CO2. The gas sensing material used in the MQ135 gas sensor is tin dioxide (SnO2), which has low conductivity in clean air.

When SnO2 semiconductor layer is heated at high temperature, oxygen is adsorbed on the surface. In clean air, electrons from the conduction band in tin dioxide are attracted to oxygen molecules. This form an electron depletion layer just below the surface of SnO2 particles and forms a potential barrier. As a result, the SnO2 film becomes highly resistive and prevents electric current flow.

In the presence of alcohol, however, the surface density of absorbed oxygen decreases as it reacts with the alcohols; which lowers the potential barrier. Electrons are then released into the tin dioxide, allowing current to flow freely through the sensor.

Specifications:

  • Power Supply : 2.5V ~ 5.0V
  • Module Dimension: 40.0mm * 21.0mm
  • Mounting holes size: 2.0mm

Circuit Diagram:

Connections:

MQ135 Gas Sensor ModuleARIES V2 board
VCC+3.3V
AOUTA1
GNDGND
Connection pins of MQ135 Gas Sensor Module & ARIES v2.0 Board

Now, for powering up the ARIES v2 board via USB port of a Laptop/Desktop/PC and burning the code into the ARIES v2 board, we have to use a micro USB type B to USB type A cable. The cable should be connected to UART0 port of the ARIES v2 board, and the Laptop/Desktop/PC should be preinstalled with VEGA SDK and Toolchain.

Procedure:

After setting up the toolchain and SDK path environments, clean the executable using the make clean command.

cd examples/adc/mq3_gas_sensor_demo/
make clean

Build the example program for the MQ135 sensor by using the make command

make 

Before transferring the built program to the board, ensure that you have connected the UART0 connector of the board to the PC.

Open a new terminal, execute the following command

sudo minicom aries

Now you can see the minicom terminal opened and the board UART terminal is ready.

Press CTRL+A and then press S to enter the file sending menu and select xmodem by pressing Enter.

In the next window, select the mq3_gas_sensor_demo.bin file to be transferred with the Space bar , By pressing the Enter, the transfer process starts.

Wait until the process is completed , After completing the transfer the program will start to execute.

Output:

As we know the MQ-135 Gas sensor can detect gases like Ammonia (NH3), sulfur (S), Benzene (C6H6), CO2, and other harmful gases and smoke , Similar to other MQ series gas sensor, this sensor also has a digital and analog output pin. We can set the threshold value according to the Sensor , by bringing the alcoholic material nearby to this sensor the level of these gases go beyond a threshold limit in the air and the digital pin goes high & we will get the output as “Alcohol Detected” with Red LED(built-in) ON , otherwise the output as “Alcohol Free” with a Green LED(built-in) ON.

Leave a Reply

Your email address will not be published. Required fields are marked *