0% found this document useful (0 votes)
529 views

Arduino Your Home & Environment - Gas Sensor Tutorial

The document describes a tutorial for building a smoke detector using an Arduino and gas sensor. The sensor is soldered to a carrier board with a sensitivity resistor and header pins. An LED and resistor are connected to indicate smoke detection when the sensor value exceeds a threshold. The code reads the sensor value, turns on the LED if smoke is detected, and prints the results to the serial monitor. The next steps planned are adding a temperature sensor and relay for an alarm siren.

Uploaded by

Eliel Teotonio
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
529 views

Arduino Your Home & Environment - Gas Sensor Tutorial

The document describes a tutorial for building a smoke detector using an Arduino and gas sensor. The sensor is soldered to a carrier board with a sensitivity resistor and header pins. An LED and resistor are connected to indicate smoke detection when the sensor value exceeds a threshold. The code reads the sensor value, turns on the LED if smoke is detected, and prints the results to the serial monitor. The next steps planned are adding a temperature sensor and relay for an alarm siren.

Uploaded by

Eliel Teotonio
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

25/2/2014

Compartilhar

Arduino Your Home & Environment: Gas Sensor Tutorial


11

mais

Prximo blog

Criar um blog

Login

Arduino Your Home & Environment


Learn to monitor and control your home & environment with self contained, inter-communicating microprocessors. Applications include ham radio, robotics, weather stations, model railroading, toys and more. - KK4HFJ
Home About Us Tutorials Discuss Projects Sponsors Tools Products

Wall Adapter Pow er Supply - 9V DC 65... NKC Electronics New $5.37 Best $0.99

CanaKit Raspberry Pi CanaKit New $62.99 Best $62.99

Arduino Uno Ultimate Starter Kit -- ... Sintron New $54.99 Best $50.00

Saturday, March 31, 2012 Gas Sensor Tutorial


We just received a bunch of Gas Sensors from Hacktronics. These sensors include: MQ2 - Flammable Gas & Smoke MQ3 - Alcohol MQ4 - Methane MQ6 - LPG / IsoButane / Propane MQ7 - Carbon Monoxide MQ9 - Carbon Monoxide & Flammable Gas

More of our resources:


Arduino Discussion Group Google + Youtube Videos Instructables

Search

Please support our work!


Our goal is to discover new solutions and provide working examples with video, pictures, code and schematics. Please support our efforts.

Subscribe via email


Enter your email address:

Today's project is a smoke detector that turns on an LED when smoke concentrations exceed a certain level. We soldered the sensor to the carrier board, along with a sensitivity resistor and a 3 pin header. The carrier board pins are VCC (+5v), GND, and Out, which connects to A0 on our Arduino. We connected a LED to Pin 13 and Gnd as indication of an alarm state (smoke detected). See the video and the code we used: Next step is a temp sensor for heat detection, and a relay for a siren.

Subscribe

Delivered by FeedBurner

Subscribe to RSS Feed


Subscribe in a reader

/ /T h e s ec o n s t a n t sw o n ' tc h a n g e . T h e y ' r eu s e dt og i v en a m e s / /t ot h ep i n su s e d : c o n s ti n ta n a l o g I n P i n=A 0 ; / /A n a l o gi n p u tp i nt h a tt h ep o t e n t i o m e t e ri sa t t a c h e dt o


http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html 1/9

25/2/2014

Arduino Your Home & Environment: Gas Sensor Tutorial

c o n s ti n tl e d P i n=1 3 ; t od i g i t a lp i n1 3 i n ts e n s o r V a l u e=0 ; r

/ /L E Dc o n n e c t e d

Ultrasonic Sensor
www.m ax botix .com The Max Sonar R ange Finde r Line has Se rial, Analog, PW & Easy to Use !

/ /v a l u er e a df r o mt h es e n s o

Gas Sensors
www.e dinburghse nsor C O , C 02, C H4, SF6 Gas Se nsor syste m s for industrial inte gration

v o i ds e t u p ( ){ / /i n i t i a l i z es e r i a lc o m m u n i c a t i o n sa t9 6 0 0b p s : S e r i a l . b e g i n ( 9 6 0 0 ) ; p i n M o d e ( l e d P i n ,O U T P U T ) ; / /s e t st h ed i g i t a lp i n a so u t p u t } v o i dl o o p ( ){ / /r e a dt h ea n a l o gi nv a l u e : s e n s o r V a l u e=a n a l o g R e a d ( a n a l o g I n P i n ) ; / /d e t e r m i n ea l a r ms t a t u s i f( s e n s o r V a l u e> =7 5 0 ) { d i g i t a l W r i t e ( l e d P i n ,H I G H ) ; / /s e t st h eL E Do n } e l s e { d i g i t a l W r i t e ( l e d P i n ,L O W ) ; / /s e t st h eL E Do f f } / /p r i n tt h er e s u l t st ot h es e r i a lm o n i t o r : S e r i a l . p r i n t ( " s e n s o r=") ; S e r i a l . p r i n t l n ( s e n s o r V a l u e ) ; / /w a i t1 0m i l l i s e c o n d sb e f o r et h en e x tl o o p / /f o rt h ea n a l o g t o d i g i t a lc o n v e r t e rt os e t t l e / /a f t e rt h el a s tr e a d i n g : d e l a y ( 1 0 ) ; }

All about pH measurement


www.m t.com /pH Ge t a com plim e ntary guide for lab or proce ss pH m e asure m e nt.

Gas Detection Systems


www.acm e prod.com W ire d + wire le ss solutions for IAQ and HVAC control in buildings.

Arduino - Linha Completa


www.m ultilogica-shop R e pre se ntante oficial no Brasil com e nvio im e diato para todo o pas.

The Arduino Store


Looking for Arduino books and gadgets? Here is a collection of our favorite items and resources The Arduino Store

IC Station

Trend Micro InterScan Web Security Event


URL Blocked
Access to this web site was blocked by an IT URL Access Control policy.
Event Details: URL: Reason: http://www.youtube.com/embed/h1z8MgtZHHM Administrator-defined

If you believe this URL was blocked in error, please contact your IT staff to resolve this issue.

Join the discussion


Posted by Steve Spence at 10:10 PM
+11 Recomende isto no Google

Join the Arduino discussion at http://tech.groups.yahoo.com/gro up/arduinohome/.

Link to us for a free gift


18 comments
http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html

Put a link on your website to this


2/9

25/2/2014

Arduino Your Home & Environment: Gas Sensor Tutorial

Add a comment as Eliel Teotonio de Oliveira

website, and Ill send you a series of eBooks on learning the Arduino and cool projects or DIY renewable energy. Just send me an email with the URL where you have posted the link.

Top comments

Recent Posts

Marco Cecchetti via Google+ 3 months ago - Shared publicly Rivelatore di fumo per l'ambiente domestico. Translate
+1 2 1
1 Reply

Andrea Creti 10 months ago - Shared publicly Very nice and usefull! thans ;)
+1 2 1
1 Reply

amit kumar 10 months ago - Shared publicly thank u sir for providing such a nice tutorial it works great......for me.
+1 2 1
1 Reply

Matt Gangloff 6 months ago - Shared publicly Sir, First of all, thank you for taking your time to post this outstanding tutorial. I am currently trying to replicate it. One issue: I have slightly different components. Specifically, the breakout board I am using is(10 slightly different and I suspect this is what is Read more lines) preventing me from getting accurate data. I also started a blog to 1 my Reply chronicle projects. Will you check this link out and see if there is something that you can spot that is wrong? Here is the link to my blog post in which I beg for help: http://wsenvironmental.org/2013/08/15/building-an-arduinoNka Rfan 4 months ago - Shared publicly gas-sensor/ very nice and useful ..thanx..can i ask you,, it is same with QMNG1 and MQ1? Thank you so much for any help you can give me, -Matt1 Reply

Sakinah Saien 3 months ago - Shared publicly can i use arduino uno instead of arduino mega?
+1 2 1
1 Reply

Jez Real 5 months ago - Shared publicly please help me extend the program by making a relay to a gsm arduino shield. so instead of print the results to the serial monitor: make it apear to be a text message.. thanks! help me through this email [email protected]
1 Reply

Steve Spence 11 months ago Just connect a 5v piezo instead of the LED.

http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html

3/9

25/2/2014

Arduino Your Home & Environment: Gas Sensor Tutorial

jose jr. lacanaria 11 months ago can you plz share us how to make the fire alam with fire senzor using arduino

Steve Spence 1 year ago The data sheet explains the pins. http://www.pololu.com/file/download/MQ2.pdf?file_id=0J309 Yes, you need the Arduino.

Tarun kumar 1 year ago hey am having MQ-2 gas sensor with 6 pins wat to do..... can we make this experiment without using arduino

Trefex 1 year ago Hi, Great post. Did you get the MQ7 to work? Would you mind telling us how you connected the sensor especially with the PWM part for the heating coil? Thank you so much!

Porn??? Tidak.....??? 1 year ago i want to ask, if i want use buzzer and fan can i get the source code? i need your help.. send to my email, [email protected]

Jasmin Patel 1 year ago hey how did you solder the sensor on the breakout board because i am confuse between six pins.

Steve Spence 1 year ago We used a 20k ohm IIRC. I'd suggest a 30k - 40k pot so you can adjust sensitivity for different gases.

Bhuwnesh Joshi 1 year ago what is the value for resistor R1 Shown in diagram Above .Thank you in advance

Amroq 1 year ago Hey. Great post. Just testing this sensor right now. I was wondering if you have calibrated the sensor as documented in the datasheet? If so, which equipment did you use?

Steve Spence 1 year ago No, I did not calibrate it. I was just shooting for a confirmation that smoke existed.

SainSmart I2C LCD It seems a lot of folks are having problems getting the SainSmart I2C LCD working. This is a shame, as the I2C LCD only uses 2 data lines, A4 (SDA)... ELEC Freaks LCD Key Shield I'm playing with the ELEC Freaks LCD Key Shield, and this is a simple and fun to use Arduino Shield that contains a 2 line LCD, a rotary encoder,... Arduino & uBlox Neo 6M GPS A buddy of mine sent me a uBlox Neo 6M GPS module and said "figure it out". Cool, I love projects like this. There are 4 connections, TX, RX, VCC... ICStation 5v BMP-085 Pressure / Temperature Sensor ICStation sent us a BMP-085 Barometric Pressure Sensor. This sensor is 5v friendly, and works with the common BMP085 libraries that are available.... ICStation 8 Character, 7 Segment Display ICStation sent us a 8 Character, 7 Segment Display driven by a MAX7219. There's no documentation for this display, but a bit of googling found a... Rotary Encoder Controlling Servo Position, With Last Positio... Ok, that was a long title, but what does it mean? I have a ham radio buddy that wants to control a variable capacitor with his Arduino. I'm using a... Web Based Weather Server Version 2 I have added a Barometric Pressure Sensor to our Web Based Weather Station, and added calculations for Heat Index and Dew Point. You can read about... Power Over Ethernet - Powering Remote Arduino's Several of my projects use Ethernet to communicate data back to a server or internet connection. Our Web Enabled Weather Server for one. I've... Sensing Barometric Pressure Adafruit makes a nice barometric pressure sensor (BMP180), but their tutorial is designed for the BMP085 and does not compile on Arduino 1.05 It... Installing Arduino 3rd Party Libraries Libraries are pieces of code that commonly add functionality for specific pieces of hardware (can be software functions). Instead of putting all... Powered By : Blogger Plugins

http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html

4/9

25/2/2014

Arduino Your Home & Environment: Gas Sensor Tutorial

Popular Posts
Arduino IR Receiver - Part 2 I have been successful in programming my Arduino to identify sets of digits transmitted from my Samsung remote. I used the excellent library... Monitoring voltage of a dc battery supply Since we are involved in off grid solar power systems, we have a need to monitor battery voltage. The Arduino can do this easily with a simp... Two DS18B20 Temp Sensors on LCD Display! We are finally posting our multi DS18B20 Temp Sensor LCD project. Right now we are monitoring two sensors on one data pin, but could add man... Gas Sensor Tutorial We just received a bunch of Gas Sensors from Hacktronics . These sensors include: MQ2 Flammable Gas & Smoke MQ3 Alcohol MQ4 -... DS1307 Real Time Clock Working With a bunch of help from John Boxall of Tronixstuff.com , we finally got the Time / Date functions working on our Arduino, with the DS1307 ... Our Temperature / Humidity Monitor is working! We received our SHT21 Temperature / Humidity Sensor today from Misenso. No documentation came with it, so a bit of googling found parts of t... The Arduino Thermostat I've talked about this before, but since I just built another one last week, I thought I'd reshare this project, as it has a sligh... Virtual Breadboard - Simulate an Arduino Want to try out your designs virtually, before committing to hardware? You can sim the Arduino, and many other
http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html 5/9

Newer Post
Subscribe to: Post Comments (Atom)

Home

Older Post

25/2/2014

Arduino Your Home & Environment: Gas Sensor Tutorial

microcontroller platforms at ... Top 40 Arduino projects of the Web Hack N Mod scoured the internet for the best Arduino based microcontroller projects. The list and variety is extensive, and there's some... Multicolor (RGB) LED with Arduino PWM This is the next step from our last post, where we take the single color example of PWM brightness control, and expand it to a RGB LED with ...

Arduino Blog
An electronic diesel engine controlled with Arduino Mega - 25/2/2014 - Zoe Romano Prototyping a pressure sensor with Arduino Micro #ArduinoMicroMonday - 24/2/201 4 - Zoe Romano You cant touch this! - 20/2/2014 - Zoe Romano Arduino Tour 2014: le nuove tappe di Rimini e Pula #Italy - 19/2/2014 - cristina_mauri Could your skin act as an interface? - 18/2/2014 - Zoe Romano

Blog Archive
2014 (21) 2013 (55) 2012 (57) 12/30 - 01/06 (1) 12/23 - 12/30 (2) 12/09 - 12/16 (1) 11/25 - 12/02 (1) 11/18 - 11/25 (7) 11/11 - 11/18 (1) 11/04 - 11/11 (1) 10/28 - 11/04 (4) 10/21 - 10/28 (1) 10/14 - 10/21 (2) 08/26 - 09/02 (1) 08/19 - 08/26 (3) 08/12 - 08/19 (1) 07/15 - 07/22 (1) 07/01 - 07/08 (2) 06/24 - 07/01 (2) 06/10 - 06/17 (2) 06/03 - 06/10 (4)
http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html 6/9

25/2/2014

Arduino Your Home & Environment: Gas Sensor Tutorial

05/27 - 06/03 (1) 05/13 - 05/20 (1) 04/29 - 05/06 (3) 03/25 - 04/01 (1) Gas Sensor Tutorial 03/18 - 03/25 (2) 03/04 - 03/11 (5) 02/26 - 03/04 (4) 01/22 - 01/29 (1) 01/01 - 01/08 (2) 2011 (36) 2010 (115)

Our Favorite Sites


Adafruit Industries Antipasto Hardware Blog Arduino Controlled Home Arduino for Beginners Arduino Home Arduino Shield List Arduino.org Digikey DIY Drones Earthshine Electronics Electronic Goldmine Electronic Navigator Freeduino Garage Lab General Electronics Tech Green-Trust Renewable Energy Hack n Mod Hackerspace - Wikipedia Hackerspaces.Org Hacktronics Jameco Electronics La navaja del Geek Lady Ada Arduino tutorial Learn Electronics LED Strips LED Tape LED Track Light Little Bird Electronics Macetech Makers Shed Mean PC MindKits Mouser Electronics MPJA Nerd Kits Newark - Electronics Distributer
http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html 7/9

25/2/2014

Arduino Your Home & Environment: Gas Sensor Tutorial

Nudatech Nuts & Volts Pachube / Arduino projects Phenom Engineering Practical Arduino Robot Shop Rogue Robotics RoHS Compliance Seeed Studio Smiley Micros Solarbotics Spark Fun SpikenzieLabs t r o n ixs t u f f Web Design Tips

Green-Trust.Org
The DIY Berkefeld (Berkey) Water Purifier Is Back! - 25/2/2014 Wood Fired Emergency Heat and Cooking - 18/2/2014 32 Hours Without Power, Ice Storm 2014 - 14/2/2014 Van Dwellers / RV Solar Starter Kits - 3/2/2014 Winter Survival Tools - 23/1/2014

Google+ Followers
Steve Spence
Add to circles

1,116 have me in circles

View all

Arduino in the News


Smart Handbag Seals Itself Shut to Stop Shopaholics This aquarium lets your goldfish boldly go where no guppy has gone before! Video: Beer drinking has just gotten cooler and geekier Best Tech Events This Week: Epic Pre-SXSW Party, NYU Entrepreneurs Festival, Google Glass Creative Robotic 'plotclock' writes out the time
http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html 8/9

25/2/2014

Arduino Your Home & Environment: Gas Sensor Tutorial

Arduino Q&A
How to find the digital and analog pins on a standard Arduino board How to create an Arduino alarm that calls a function How Arduino's Servo library controls positioning How to make sure your new Arduino board is working The Most Common XBee Mistakes

Helpful products

Picture Window template. Powered by Blogger.

http://arduinotronics.blogspot.com.br/2012/03/gas-sensor-tutorial.html

9/9

You might also like