IoT Based Toxic Gas Detection System

by uddin_bangladesh in Circuits > Arduino

2185 Views, 10 Favorites, 0 Comments

IoT Based Toxic Gas Detection System

gas_web_apps_diagram.jpg

Toxic gases have huge environmental effects. People are suffering several diseases due to them. Properly detection of toxic gas level is important for us. with this respect I develop this project for sensing the toxic gas level in our environment.

Toxic gases have huge environmental effects. People are suffering several diseases due to them. Properly detection of toxic gas level is important for us. with this respect I develop this project for sensing the toxic gas level in our environment.

Necessary Things

DSC_0548.JPG
  1. Linkit Smart Dou
  2. MQ Gas Sensors (MQ-3, MQ-2, MQ-7)
  3. Card Board
  4. Jumper Wire
  5. Thinger.io (Account)
  6. Arduino IDE
  7. Hot Glue Gun
  8. Soldering Iron
  9. Cutter knife


Building the System

DSC_0549.JPG
DSC_0560.JPG
DSC_0559.JPG
DSC_0558.JPG
DSC_0557.JPG
DSC_0556.JPG
DSC_0555.JPG
DSC_0554.JPG
DSC_0553.JPG
DSC_0552.JPG
circuit.png
  1. Make hole using cutter knife for placing gas sensors on it. Attached some hot glue on the sensors back side for fixing the sensors with the card board.
  2. Connect the sensors pin with linkit smart dou micro-controller by using proper pin diagram.
  3. Connect the GND and VCC pin of all the sensors.
  4. Place the micro-controller inside the card board and fixed it using hot glue.

If you want to add more sensors ..... you can add it.

Pin Diagram

Power up the linkit board via usb or usb power bank

MQ2 sensor

VCC --- 5V

A0 ------ A0 (linkit board)

GND ----- GND

MQ3 sensor

VCC --- 5V

A0 ------ A1 (linkit board)

GND ----- GND

MQ7 sensor

VCC --- 5V

A0 ------ A2 (linkit board)

GND ----- GND

All the VCC and Ground are connected with Linkit board's VCC and Ground.


Preparing Linkit Smart Dou

station_mode_9R4PKOV1ki.jpg
2018-05-20.png
2018-05-20 (1).png

By Default Linkit Smart7688 Duo is working in AP Mode but for this project we need to make it to Station Mode. Since we have a plan to use this board in arduino yun mode so, we need to do some configuration.

First, connect the board with your PC and Scan the Wifi Network and you will find the Network with the name of LinkIT *******; connect to it and open your browser and type this URL. http://mylinkit.local/ and you will see the login screen. First time put the password and click on save and then again login. After Login click on "Network" tab and then you will the following screen and select the Station mode. and then select your own wifi network and then enter your wifi password and click on "Configure & Restart". Now your board is connected with your own network.

For more details please follow the wiki of linkit smart dou board.

Now we need to configure the arduino yun bridge mode of linkit smart Dou.

From windows 10/7, open the putty terminal and write the ip address of the linkit smart dou board or write mylinkit.local.

After connecting putty with board execute the following commands to enable Bridge Mode.

# uci set yunbridge.config.disabled=’0’

# uci commit

# reboot

Now the board is ready for this project.

​Uploading the Arduino Source Code to Linkit Smart Dou

2018-05-19.png
2018-05-19 (1).png
2018-05-19 (2).png

• Open the Arduino IDE.

• To get the board manager you must go to File >> Preferences then, in the "Additional Boards Manager URLs" paste the link bellow: (check the figure)

http://download.labs.mediatek.com/package_mtk_lin...

Then, install the linkit smart dou board by going to Tools >> Board > Boards Manager... You can find it by scrolling down, or just typing linkit in the search box.(check the figure)

As you can see I have already installed it, but if you haven't make sure you do it by clicking the install button.

Now check whether the board is available or not, by click on Tools >> Board, and in Tools > Port. As seen here.(check the figure)

Now, you just write the code and upload by clicking upload button (******).

*****Uploading Firmware to linkit board

Before uploading the Arduino code to the board, make sure that your thinger.io lib for Adruino IDE is properly downloaded and your user name and credential is properly added. The Thinger.io dashboard visualizes the real time data after uploading the source code to the linkit board.

Setup the Thinger.io Platform

2018-05-20 (2).png
2018-05-20 (3).png
2018-05-20 (4).png

Thinger.io is a iot-cloud platform which is used here for streaming data from the device to cloud. It provides free streaming service up-to two devices. If you don't have any account please open an account.

For adding a new device, click on add device and then enter the name , description and your credential (credential is mandatory for connecting a device to thinger.io, you need to put this credential and device name as well as your user name on the Arduino source code for connecting the device to the cloud).

For creating a Dashboard for data visualization, you need to click on add dashboard then put the dashboard name and description. please refer thinger.io documentation for more details about dashboard, device and other services.

Uploading Firmware to linkit board

Before uploading the Arduino code to the board, make sure that your thinger.io lib for Adruino IDE is properly downloaded and your user name and credential is properly added.

The Thinger.io dashboard visualizes the real time data after uploading the source code to the linkit board.

Demo

Gas Detector System