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.
For setting up the development environment and getting familiar with LinkIt one, I highly recommend you to go through the previous articles of the series.
In India many accidents happens every year due to domestic gas leakage. LPG is a need of every household but it should be used carefully. 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. We will place a buzzer in the circuit, if the system detects any gas leakage it will alert us by playing the buzzer or even you can go one step further by adding mobile notifications on detection. LinkIt One has onboard GSM which will help us in sending SMS too, that we will see in upcoming parts.
Requirements
Figure 1: Equipments
- LinkIt One board
- Grove MQ5 sensor
- Buzzer
- Jumper cables
- USB cable
The sensor I am using in this article is MQ5 sensor from Seeed Studios. It has a Grove interfacing that means you need not to do breadboarding or any soldering as it is a complete module.
Grove MQ5 Sensor
The Grove Gas Sensor (MQ5) module is useful for gas leakage detection in home and industries. This sensor is suitable for detecting a wide range of gases including H2, LPG, CH4, CO, Alcohol. It provides high sensitivity and fast response time and has a potentiometer to adjust the sensitivity. The output voltage from the Gas sensor increases when the concentration of gas increases.
Figure 2: Gas Sensor
Figure 3: Gas Sensor Board
Features of Grove MQ5 Sensor
- High sensitivity to LPG, natural gas , town gas
- Small sensitivity to alcohol, smoke.
- Fast response
- Stable and long life
- Simple drive circuit
Connections
- Connect LinkIt One to your computer using a USB A to micro B cable.
- Connect the MQ5 sensor into the A0 port of Grove Base Shield.
- In the Arduino IDE, go to the Tools pull-down menu at the top, select Board, and make sure “LinkIt One” is checked.
- Then pull down the Tools menu again, and select appropriate Serial Port.
- 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;
-
- void setup()
- {
- pinMode(buzzer, OUTPUT);
- Serial.begin(9600);
- }
-
- void loop()
- {
- var sensorValue = analogRead(sensor);
- Serial.println(sensorValue);
- if (sensorValue > 200)
- {
-
- digitalWrite(buzzer, HIGH);
- }
- else
- {
- digitalWrite(buzzer, LOW);
- }
- }
Running the system
Figure 4: 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. You can place this system in a box with the sensor outside and near to the LPG source by using a longer jumper wire and install it in your Kitchen. 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.
Important
The best preheat time for the sensor is above 24 hours.