Introduction: Environmental Alert System

What's that smell? It's noxious gas of course! If you're in an environment where there's a possibility of gaseous release of which you'd rather not breathe, why not build an automatic system for sensing and alerting you? The design for the Environmental Alert System is driven by my motivation to understand the concentrations of different chemicals in the air. The unit consists of an array of four gas sensors (one each for methane, propane, carbon monoxide, and smoke) connected to an Intel Edison for wireless detection and alerting. While no substitute for a proper commercial chemical detection system, the EAS makes for a great weekend project!

Update: I wrote a guide to making electronics project boxes, which you might find useful if you've not got your own laser cutter and want to make an enclosure for your environmental alert system.

Step 1: Parts and Materials

Intel Edison with Arduino Breakout Board

(4x) 10K rotary panel-mount potentiometer

(4x) 1/4" slot knob

Dotstar strip

MQ-2 (flammable gas and smoke)

MQ-4 (methane)

MQ-6 (propane)

MQ-7 (carbon monoxide)

(4x) gas sensor breakout

(3x) 20K resistor

10K resistor

1K resistor

330 ohm resistor

toggle switch

panel-mount power jack

panel-mount LED holder

5mm green LED

5V buzzer

2N3904 NPN transistor

5V 3A power supply

1/4" plywood

1/8" acrylic

(12x) 1" 4-40 standoff

(24x) 1/2" 4-40 screw

Step 2: Electrical Design

Power

The entire system is powered from a 5V 3A power supply. Each of the four sensors draws upwards of 150 mA, the Edison around 500 mA, and the DotStar LEDs (at full white brightness) up to 2400 mA. Since the DotStar strip will never be fully on or set to white, the 3 amp supply should work just fine. The entire system is switched on via a mini toggle switch. A single green LED is connected via a 330 ohm resistor to the 5V rail to show the power status.

Control

An Intel Edison runs the show for the Environmental Alert System. The Edison is mounted on an Arduino breakout board, which makes it easy to read the analog signals from the sensors and potentiometers. The Edison is connected to the 5V rail via a micro usb cable. The Edison has a built-in Wi-Fi radio, which allows it to connect to the internet without the need for any additional hardware.

Sensors

The system has four sensors that connect the Edison. Each sensor is directly powered from the 5V rail and has its signal pin connected respectively to A0 through A3 on the Edison breakout board. The sensors also each have a sensitivity adjustment resistor; the MQ-7 has a 10K ohm resistor and the rest each have a 20K resistor. The MQ-2 is a combustible gas sensor (liquified petroleum gas, propane, hydrogen, and methane) that outputs an analog voltage proportional to the concentration from 300 to 10,000 parts per million. The MQ-4 is a methane gas sensor and has a equivalent concentration to voltage response. The MQ-6 is an LPG, isobutane, propane sensor. The MQ-7 is a carbon-monoxide sensor.

User Input

There are two potentiometers and two toggle switches for user input. The toggle switches are connected between the digital pins on the Edison (pulled high via software) and allow selection between the two "threshold" adjustment potentiometers. The potentiometers are connected across the 5V rail and have their wipers connected to the remaining analog inputs on the Edison (A4 and A5).

User Feedback

The Edison connects and controls a single strip of DotStar LEDs via SPI. Each strip is cut into four segments of 10 LEDs each and then connected in series to form a single strip, which makes for simpler software control. The system also has a buzzer for immediate auditory feedback if any of the sensors detects a value above the set threshold. The buzzer is connected to 5V and is controlled via a single NPN transistor that is driven by one of the Edison's GPIO pins.

Step 3: Mechanical Design

The body of the E.A.S. is made out of three plates of laser-cut sheets. Although I used a combination of 1/4" plywood and clear acrylic, the design can be assembled out of any sheet material as the spacing (maintained by 1" aluminum standoffs) is the only critical element. The clear window plates in front of the LEDs are optional, but allow for some much needed light diffusion. I designed the frame in a triangular shape reminiscent of many danger and warning signs. I've attached the vector files for download above.

Step 4: Electronic Assembly

Power

The power for the system is provided by a beefy wall-wart with a standard barrel jack which is connected directly to the power switch. The barrel jack must be screwed into its plate prior to soldering. The ground wire is connected to a terminal block on the mini protoboard. The output of the switch is connected via 22 AWG wire to the adjacent hole on the terminal block. There are male and and female headers on either side of the proto board to allow quick power connections.

Sensors

The sensors are attached to breakout boards (they can be soldered in any orientation) on one side, with male headers and the resistors on the other; this configuration allows the sensors to be mounted "flush" with the front of the face plate. The sensors connect to the Edison via male-to-female jumper wires.

Output

The buzzer is broken out with female header wires to allow for quick assembly. The driver transistor and gate resistor are soldered on the mini protoboard with a single male header attached to the collector of the transistor. The LED strips are broken into four 10 LED segments and reconnected with four wires between each. The tiny copper pads on the LEDs are especially difficult to solder, so extra care must be taken in order to attach them properly. The LED strip is broken out with male header wires.

Step 5: Frame Assembly: Face

Faceplate

Potentiometers - simply pop into place and are secured with their matching nuts. The optional knobs fit snugly on top and are fastened with set screws.

Switches - pop into place with the groove facing towards the top. The lockwasher remains below, while the nut and tabbed-washer for each fastens the switch to the plate and aligns them vertically.

Buzzer - slides into the topmost large hole and is held with a friction fit.

Sensors - fit into their matching holes and are secured with two nylon 2-56 screws each.

LED - pops into the hole above the power switch and is fasten with its matching nut.

Step 6: Frame Assembly: Middle

Midplate

Barrel Jack - screws into its mini plate with its matching nut Standoffs - are attached with six 1/2" X 4-40 screws Edison - is fastened with four 2-56 screws and eight nuts (half immediately underneath and the rest on the other side of the plate

Step 7: Frame Assembly: Base

Baseplate - is attached via six more standoffs and 1/2" X 4-40 screws

Step 8: Software and Configuration

The program is an Arduino sketch running on the Edison. I've attached the program and the DotStar library which I modified by commenting out line 111 of Adafruit_DotStar.cpp:

SPI.setClockDivider((F_CPU + 4000000L) / 8000000L); // 8-ish MHz on Due

The program has four main functions:

getInput() - reads the state of the switches and the analog values of the potentiometers, setting the threshold for each sensor depending on the state of the switches.

checkSensors() - reads the analog values of each individual sensor, averaging across 10 points per sensor per 1 second

runTest() - measures the analog values of the sensors against their individual thresholds

drawLevels() - shows the current readings on the individual strips

soundAlarm() - connects via Temboo and sends a wireless alert (either text or email)

Step 9: Calibration

Although it runs immediately on boot, the sensors themselves have a 48 hour necessary pre-heat time (just powered on) in order to run effectively. After the "pre-heat" process is complete, the sensors will give more reliable readings.

Step 10: Final Thoughts

I hope you've enjoyed reading the instructable! This has been and interesting exploration into gathering some unique sensor data. This project could definitely be expanded in quite a few ways too! It's definitely worth figuring out a web interface for plotting the sensor data over time or from multiple sources. I'll leave that for another time. Thanks for reading!

Comments

author
Thehoggs59 made it! (author)2017-05-29

Great project design. These sensors are significantly affected by ambient temperature and humidity and need live compensation. Also make sure the sensors are getting the full 5v as they are sensitive to this also.

author
andresruelas made it! (author)2016-03-19

Hello, In which part are the Vector Files? Thank you and amazing project!!!!!

author
Jonathanrjpereira made it! (author)2016-01-26

I was Inspired by your design the flow of your Instructable. I made a similar project with some of the design elements that you used.

https://www.instructables.com/id/TWIST-DIY-Tweeting-Weather-Station/

FEKMDA5IG3YXR3N.LARGE.jpg
author
Daily Fitness tips made it! (author)2015-12-13

its great work best wishes for you aleator.. Environmental Health is related with our health

author
Rileyowen made it! (author)2015-11-26

Brilliant Design,,,,

author
nafshan05 made it! (author)2015-10-21

it can be used in hospitals too? how can i make it with arduino?

author
Jonathanrjpereira made it! (author)2015-10-06

Which Circuit design software did you use?

author
Aleator777 made it! (author)Aleator7772015-10-06

I create my electrical diagrams in Adobe illustrator for most projects since I usually build projects with lots of modular boards and very few discrete components.

author
Jonathanrjpereira made it! (author)Jonathanrjpereira2015-10-10

Thanks. I love the aesthetics of this Instructable.

author
EvolvedAwesome made it! (author)2015-10-10

It looks absolutely beautiful, really elegant design for a hazard alarm! <3 it :)

author
John T MacF Mood made it! (author)2015-09-06

Very nice design.Quantitative would be much more difficult, qualitative testing is just right. If it's there, it will go off.

Anyone using ammonia based refrigeration systems PROBABLY is commercial, and those refrigeration units usually come with fail safes and alarms. If you use ammonia based refrigeration at home, you're taking risks you do not need or want to... Too dangerous. In some countries outside the US, ammonia is used in homes, and should not be. Can we all remember Bhopal? (Yes, I know that wasn't ammonia, but the safety risks they took killed many people. It was methyl isocyanate (MIC) gas). A chemical plant in an earthquake prone area is not wise either.


While I have a CO, Smoke, and low voltage alarms in my home, this would be a nice addition.

A+ on the idea, design, and thoughtful plans. Thank you for posting.

author
Aleator777 made it! (author)Aleator7772015-10-06

Wow, thank you very much! This was quite fun to build.

author
abbasebne ali made it! (author)2015-08-18

خیلی عالی

author
tbt10f made it! (author)2015-07-23

I am not an Edison engineer, but this project could be made more user friendly if possible by perhaps having a separate red LED or a buzzer (perhaps one for each sensor?) to warn of dangerous levels detected that is independent of the status of the bar graphs?

author
Aleator777 made it! (author)Aleator7772015-07-24

The led strips are mapped to the analog readings of the sensors, even though it is a contiguous length of LEDs, they're addressable, so they report independently. Unless they were all triggered at once, a glance should let you know which is sounding the alarm.

author
PavelKrakken made it! (author)PavelKrakken2015-08-12

Hi, could you do or instruct how to make an amonnia gas detector? (for example a leak on a refrigeration system.

author
Tlhabano made it! (author)2015-07-22

Hi there,

What would be the approximate cost per material item used to assemble or make this EAS?

author
madsense made it! (author)2015-07-22

author
JamesBryan made it! (author)2015-07-22

this could be used as any sort of multi alarm indicator system by switching out the sensors for motion detectors, lights sensors etc. as it stands it is a very good and useful device though. with a bit of work on the code, it could even be a sound level display for a 4 channel equalizer.

author
c.r.h. made it! (author)2015-07-21

Very nice project and well put together instruction.

Okay, did you ever wonder why those various combustible sensor are so inexpensive? Hum...

Problem with using several different versions of these sensors to detect different combustible gasses is that they all have a fairly high degree of cross-sensitivity. So if for example Methane (CH4) were to be present, all the sensors will react to some degree. Bummer! So without some kind of special filtering, you really have to know what gas it is you are trying to detect if you care about the actual level. Otherwise maybe just one combustible sensor might suffice for a basic warning system.

In a basement maybe natural gas would be most likely and maybe in a garage gasoline vapors would be most likely. With that known, you could probably use the same sensor and just apply a correction factor depending upon where it was placed. Remember, combustible vapors always tend to lay low to the ground so that is where you want to detect them. Gasses, can generally be detected higher up in an area. It would be easier to distinguish between the two by locating the sensors at different heights.

Maybe this comment is way over the top but something to think about anyway.
Corrections welcome.

author
capjbadger made it! (author)2015-07-21

Would this work to detect exhaust leaks from a laser engraver?

author
brinstructables made it! (author)2015-07-21

But how does the canary fit inside??

author
KorinaH made it! (author)2015-07-21

great idea , thank You for posting

author
KiloVision made it! (author)2015-07-21

Love the design.

author
acoleman3 made it! (author)2015-07-21

makes me wonder how one could expand that to include radon.

author
billbillt made it! (author)2015-07-21

Great idea!...

author
diy_bloke made it! (author)2015-07-21

funky design

About This Instructable

33,082views

481favorites

License:

Bio: My name is DJ and I previously made electronic whatsits, 3D-printed thingamabobs, and laser-cut kajiggers for the Instructables Design Studio; now I build and repair ... More »
More by Aleator777:MiniSub ROVBasics of Thermal ImagingMiniature Autonomous Blimp
Add instructable to: