This gas sensor uses a MQ-2 gas sensor to indicate if there is gas in the area. so the sensor has a threshold value (the threshold value is around the amount of smoke in there is a fire) in that if it goes above it starts alerting people in the vicinity. The alert just shows a red led and starts beeping. This idea is very helpful and is used on a daily basis with the smoke alarms that a lot of people have in their houses and I tried recreating that with an Arduino there are also other reasons listed below.
I created this gas sensor because of multiple reasons:
1- I had to do a school project in which you use the Arduino Uno and upload it to the project hub.
2- I thought that the smoke sensor is a good project idea as it has the potential to save or help lives
3- I had found how to make the code and I thought it very easy.
4-I had all the supplies needed.
The pseudocode (with code) + flow chart:
Summary of pseudocode+ flow chart.
First, the code gets indicates values and pins then it indicates the threshold value of the smoke (it is the value that if the sensor senses above it start to alert the person that there is smoke).Then it sets up outputs and inputs. After that, it starts the loop, in the loop, there is 2 possible outcomes: 1-it stays in the threshold value 2- it goes above the threshold value. If it stays in the threshold value the green led will be on while the buzzer and red led will be off. If it goes above the threshold the green led will turn off and the red led and the buzzer will turn on.
//indicates red led
//indicates normal
//indicates gas
//indicates sensor is connected to A5
//sets a threshold value
//red led as output
// buzz as output
//green led as output
//sensor as input
//starts the code
//loops
//reads sensor value
//sees if it reached the threshold value do:
//turns on red led
//turns off green led
//turns on buzzer
//if it hasn't reached the threshold value do:
//turns red led off
//turn green led on
;//turns buzzer off
//delay 0.1 sec
Comments
Please log in or sign up to comment.