LinkitONE Pollution Sensor

by ssarthak598 in Circuits > Arduino

804 Views, 12 Favorites, 0 Comments

LinkitONE Pollution Sensor

IMG_0840.JPG

Want to test the quality of air around you? Wana make your new science project or just have some fun? Got a LinkitONE board? Then you are at the right place!

Here i'll show you step by step how to interface a dust sensor with your LinkitONE.

What Do You Need?

IMG_0836.JPG

1) LinkitONE Board

2) Air quality sensor (i'm using MQ5)

3) micro-USB cable (for programming)

4) battery pack

Assembling the Parts

IMG_0839.JPG
IMG_0838.JPG

Now assemble all the parts together.

First of all, connect the jumper wires to the air quality sensor. Connect 3 wires to VCC, GND and AOUT pin of the sensor.

Now connect the sensor to the A0 pin of the board.

Pin connections:

AOUT - A0

VCC - 5V

GND - GND

Updating Board's Firmware

images.jpg

If your board's firmware is old, you'll need to update it to use it properly, so download the latest firmware updater from the Mediatek's website.

To update the Board's Firmware, open the "firmware updater" software that you installed in the last part in the previous step. Once open, Make sure that the switches on the board are in the right position for updating firmware; MS for the MS--UART, USB for the USB--Battery switch, and SPI for the SPI--SD switch. Plug your board into your computer, then click "Download". It will now begin downloading and installing the latest firmware for your board.

Writing Some Code

Capture1.PNG

The code is really simple here! There's nothing much!

We're just taking a analog reading from sensor about dist particles per cubic feet. We are first analyzing reading for 30 seconds and then giving back the readings.

CODE:

------------

int Sensor_Pin = A0;

void setup()

{ Serial.begin(9600);

}

void loop(){

int SensorReading = analogRead(Sensor_Pin);

Serial.print("Pollution level is");

Serial.print(SensorReading);

Serial.print("%");

Serial.println();

delay(250);

}

------------

Okay, so now burn this code to your board.

Testing It Out!

IMG_0842.JPG
Capture.PNG

Now test your device!

Just burn the code on your board from the previous step and then start! Open the serial monitor on the modem port of your Linkit. Carefully observe your readings. They update every 30 seconds. You can even plot a graph using opensource tools available online such as plotty or ubidots.

Final Touches

2010311173412258.jpg

Now build your own air quality box!

You made your own pollution sensor, but you can make a small box that you can carry anywhere you want and that can measure air quality as well!