DIY Gas Sensor Monitoring System

Discussion in 'The Projects Forum' started by rubberbus, Jan 13, 2014.

  1. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    Hi guys, I have a school project which requires me to mimic an optical gas sensor system using a microcontroller as the control system for the gases and the lasers.

    I will be replacing the lasers with LED and it will be required to switch on and off by the mircocontroller for specific periods of time. I need a three way value which will also be controlled by the microcontroller, in order to select two different types of gas, one gas is the gas to be detected and the second gas is to purge away the detection gas. Finally, using a photodiode to detect a voltage from the LED and send back to computer using the mircocontroller,

    I know roughly how to design the circuit but I have some questions and hopefully you help me out. I included a rough sketch of the project below.

    My questions:

    1) Is it possible for me to DIY a 3 ways valve and be controlled by the mircocontroller?

    2) If I'm not wrong, I believe the distance between the LED and photodiode cannot be too far away? maybe a maximum 1cm gap? is this correct?

    3) if you guys have any circuit schematics which are useful to my project, please share with me! I appreciate your help!
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    How much absorption are you expecting to get? That's your "signal". You need to design to make that as large as possible while minimizing other factors - the noise.

    The LED and the detector are not terribly precise in their wavelengths, but it sounds like you're only building a simulator, not an analytical device?

    1) Yes, but I'd consider 3 individual valves, one for exhaust and a choice of 2 for intake.
    2) You can get much larger distance if you need to - think TV remote. But those are modulated to give a signal at one frequency, allowing other noise to be filtered out. You might be able to do that with your micro. But a few inches or more should be no problem either way with a little attention to optics, shading and such.
     
  3. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,796
    831
    "You need to develop something with a microcontroller "which requires me to mimic an optical gas sensor system".

    Aren't you mimicking the laser and detector with LEDs? So can you mimic the valve with LEDs as well?
     
  4. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    Hi, thank you for replying!

    Sorry for the misunderstanding. Yes, I need to design and build the device. I also need to do a demonstrate of the result. I'm still at the first stage of planning and researching.

    sorry, I dont understand this point "How much absorption are you expecting to get? That's your "signal". "

    1) Do you have an example of how the values look like? Or I just make use of plastic tubes and DIY? The school didnt provide us any money to purchase components except requesting from the workshop.

    2) COOL! I never though of that! Thank you very much!
     
  5. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    Sorry I dont understand what you mean. I need the valve to pump in the gas automatically.
     
  6. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    Knowing the "gas" might help with valve choices/solutions..
    Are the gas sources under any pressure? can they be?
     
  7. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    For now, I will probably be using the gas from a normal lighter or kitchen lighter.
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    The gas is detected by the amount of light NOT getting to the detector, presumably absorbed the gas. So you need to calibrate 100% transmittance (0 absorption) with a clear gas such as air, and then look for anything less than that with the test gas. If it does not absorb much at the wavelengths you are using, if you get >95% transmittance, it'll be very hard to resolve the amount of absorption as being anything besides noise from stray light, temperature changes, whatever.

    The value you are after is the extinction coefficient, which describes how much of a given wavelength the gas will absorb. This will depend roughly linearly on the density of the gas and the distance between transmitter and detector.

    You're thinking of using butane? That does add a bit of safety risk, since it is flammable.
     
  9. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    Thanks alot! this is very informative! I use butane because I can get access to it easily. Can I use an air pump as clear gas and maybe carbon dioxide as test gas (its free! blow from my mouth)? sounds abit silly but I cannot think of any other way.
     
  10. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,357
    IR absorption is a common method for measuring various gas concentrations, gases such as CO, CO2, CH4, and hydrocarbons.

    Google CO2 absorption spectrum.

    CO2 absorbs IR at specific wavelengths, 2.4, 4.3 and 15μm. Match your IR emitter and detector to one of these ranges.

    The preferred detection technique uses a differential method using two detection channels or chambers. One chamber is in a vacuum or filled with air or N2 or some other gas that does not absorb that specific IR wavelength. The other chamber is subjected to your sample gas (CO2).

    You then use analog electronics to measure the difference in voltage between the two detectors. This difference measurement compensates for the effects of temperature variation. Thus you do not need a 2-way valve except for calibration purposes.
     
  11. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    Your breath is not likely more than 5% CO2, and will also contain moisture, which also absorbs IR. A device to measure exhaled CO2 is called a capnometer, and these use more complex chemistry. Spectrophotometry isn't up to the job.

    Do you have to use a gas? You could just use a piece of glass, or maybe water, to absorb the majority of the IR. The trouble with ANY gas, even one that absorbs and is pure, is the very low density at ambient pressure.

    [edit] I stand corrected. There has been successful use of spectrometry to build a capnometer. Not cheap, but awfully cool. Mfg here.
     
    Last edited: Jan 14, 2014
  12. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    cool stuff! thanks alot for your explanation!
     
  13. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    Yes, I have to use a gas. seems like my idea is not practical. maybe I should just stick with butane of normal lighters. Just need to be extremely careful i guess.
     
  14. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    395
    I would use two solenoid gas valves & fill two rubber baloons filled with desired gasses. Use narrowest beam width IR LED or a plastic lens, & tube as long as possible, 10 cm or greater.
    Possible air valve: Surplus Center, # 20-1452, US $ 6.95
     
    rubberbus likes this.
  15. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    Butane absorbs IR strongly at ~3,450nm, but I'm not sure you can get an LED and detector for that far into the infrared. See here and here.

    Even at that wavelength, before building anything I'd do the calculation to be sure it's reasonable to detect a loss of transmittance across a short tube filled with butane at 1 atm.
     
    rubberbus likes this.
  16. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    Thank you guys for the help! Have been busy with report writing and project meeting! I got more information about the project after meeting my mentor.

    After discussion, I will just need to mimic the gas sensor by using an normal LED and photodiode to detect the amount of light. Detecting gas is not required. Some programming will be required.

    I have a Infrared sensor circuit shown below. Can I replace the IR LED with normal LED and it still works?
     
  17. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    I didn't look up your part numbers, but an IR sensor is usually encased in a plastic that absorbs visible light, to reduce interference from visible light. Maybe it would still work, but it will be far from ideal. You want to compare the transmitter spectrum to that of the receiver.
     
  18. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    Hi, I like to use this Red LED,


    I have yet to select the photodiode. What are the characteristic that I shall look into? How do I check whether the output voltage and Light level is linear response? Thank you for your help!
     
  19. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    Wavelength is big - you want to be able to "see" the emitter.
    Datasheets are your friend. For the emitter, the output will be nearly linear with current over much of its range. The response of the sensor will depend in part on the circuit supporting it.
     
  20. rubberbus

    Thread Starter New Member

    Sep 27, 2012
    13
    0
    Sorry to bother you with my questions. I look into these few choices because the wavelength is within range and the sensitivity is around 60%. I assume the angle is not important because I will be pointing them directly facing each other. Can you help me check whether it is suitable to match with the red LED? Sorry abt this.

    http://uk.rs-online.com/web/p/photodiodes/6548154P/

    http://uk.rs-online.com/web/p/photodiodes/6548902/

    http://uk.rs-online.com/web/p/photodiodes/6548659P/
     
Loading...