LPG Detector With LinkIt One
by Pooja_Baraskar in Circuits > Microcontrollers
1003 Views, 4 Favorites, 0 Comments
LPG Detector With LinkIt One
The new IoT board LinkIt ONE co-designed by Mediatek and Seed Studios is an open source, high performance board for prototyping Wearables and IoT devices. It is a small board based on SoC that comes with onboard Wi-Fi, GSM and GPRS that makes it a powerful board for connected devices. The pin layout of the board is exactly similar to Arduino, making the development easy with many Arduino compatible shields and sensors. It comes at an affordable price of $ 59, you can get it from here.
Let us create a Gas Leakage detection system with LinkIt One and MQ5 Sensor. This system will help you to upgrade your safety standards and prevent accidents by detecting any gas leakage in your home.
Requirements
LinkIt One board
Grove MQ5 sensor
Buzzer
Grove MQ5 Sensor
The Grove - Gas Sensor(MQ5) module is useful for gas leakage detection (in home and industry). It is suitable for detecting H2, LPG, CH4, CO, Alcohol. Due to its high sensitivity and fast response time, measurements can be taken as soon as possible. The sensitivity of the sensor can be adjusted by using the potentiometer. The output voltage from the Gas sensor increases when the concentration of gas increases. Sensitivity can be adjusted by varying the potentiometer. Please note that the best preheat time for the sensor is above 24 hours.
Connections
1) Connect LinkIt One to your computer using a USB A to micro B cable.
2) Connect the MQ5 sensor into the A0 port of Grove Base Shield.
3) In the Arduino IDE, go to the Tools pull-down menu at the top, select Board, and make sure “LinkIt One” is checked.
4) Then pull down the Tools menu again, and select appropriate Serial Port.
5) Connect the Buzzer to D2 port of Grove Base Shield.
If you have multiple serial ports to choose from and aren’t sure which to choose, try unplugging the board from your computer and plugging the board back again to see which port gets added.
Code
int buzzer = 2;
int sensor = A0;
// The setup routine runs once when you press reset
void setup() {
pinMode(buzzer, OUTPUT); // Initialize the digital pin2 as buzzer output
Serial.begin(9600); // Initialize serial communication at 9600 bits per second
}
// The loop routine runs over and over again forever
void loop() {
var sensorValue = analogRead(sensor); // Read the input on analog pin 0 ('sensor')
Serial.println(sensorValue); // Print out the value on serial monitor
if (sensorValue > 200)
{
// If sensorValue is greater than 200
digitalWrite(buzzer, HIGH); }
else {
digitalWrite(buzzer, LOW);
}
}
Running the System
Click the Upload button on the tool bar. It may take a moment to compile and
upload to the board.
When it’s done, you’ll see the text “Done uploading” at the bottom.
Now with this system you will be able to detect any gas leakage in your home. Be careful while testing this system. Because of its low power consumption this system can be used in other applications like, smoke detection and various toxic gases by doing some modifications.