Gas leaks are extremely expensive. For example, the current state of affairs in southern California. This particular gas leak deep under LA, has been emitting 1.6 million pounds of methane each and every day. That equals driving 4.5 million cars each day. Local residents have reported symptoms like nausea, dizziness and nosebleeds.
The biggest price paid by leaks like this is by our environment. Climate change is the biggest problem that humanity as a whole is facing today.
The important question we should be asking is are we doing enough?
Can we put early warning systems in place to detect and prevent leaks as soon as possible?Hardware
- Jumper cables
- Bic lighter (testing)
2. Connecting the sensor to the board
- The gas sensor used works over ADC. Using the pin map for the MW302 board, we see that we can connect this to IO_42.
- The gas sensor requires a 10k resistance to pull down as per the documentation present on the Wiring website.
- I have made changes to the sample code provided on the GitHub repository for the MW302 board. Find my code attached.
To debug and test, without heading dangerously close to a leak, use a simple BIC lighter. Turn it on, and blow the flame off. Keep the starter button pressed.
Take it close to the gas sensor. The gas sensor should heat a little, and you should be able to see a filament inside the sensor slowly turning orange.Configuring AWS IoT
Step 1 : Create a new AWS IoT thing
Log in to your AWS Console and go to the IoT service. I have named my thing as LPG.
Step 2 : Download keys
You need the private key and certificate to allow the MW302 device to connect to the AWS cloud. Download it on your development machine.
Step 3 : Upload keys to device
I simply followed the instructions given on the wiki of AWS Starter SDK.
Step 4 : Check connection on AWS IoT
If everything went as planned, you can see the value of the LPG sensor inside the thing properties.
Step 5 : Create SNS topic
We will create a new topic and add email subscribers to this.
Step 6 : Add your email ID to the created topic
Once you add your subscription to a particular email id, a mail will be sent to that email id. That user will have to confirm that he wants to receive emails. This makes SNS spam-proof.
Step 7 : Add a rule to connect the AWS IoT Thing to the SNS topic
This is an association that we create between a topic with subscribers on Amazon SNS and a topic in AWS IoT on which we get the LPG sensor data.
Step 8 : All set!
Now, if all the steps above were error free, we should be getting email notifications for change in LPG sensor readings.Future scope & large scale implementation
This is the first step to create a network of sensors monitoring such environmental factors. We can add latitude and longitude to each connected sensor node, and map it using Google maps. This will help the authorities and the citizens to monitor and take precautionary measures quickly and efficiently.
There are a lot more things that we can monitor along with LPG leaks. CO2 levels, wind speed sensors (to predict the spread of gases) and many more things.Pumbaa, it is Gas!
The iconic movie Lion King has a scene where Pumbaa involuntarily makes everyone kneel using his 'special power'. The title of the project is a reference to the movie and the scene.