filters, actuators, smoke and gas detection

9
M OST of the sensing we have dis- cussed so far in this series has been passive measurement of one para- meter or another. However, we are not restricted to this approach; we may if we wish send a signal out into the environment and monitor the response with a sensor. We can call this a sensor-actuator combina- tion (an actuator is something that does something or sends out a stimulus). Our hands and feet are actuators and eyes and ears are sensors, but we can also use a combination approach. For example, we can “measure” the properties of a mate- rial by squeezing it and feeling and watch- ing the response. This month we will be briefly examining the idea of sensor-actuator combinations – we could have written an entire series on this topic so we only have space to look at it briefly. We will also be investigating sen- sors for smoke and gas, though we examine filters first. FILTERS Electronic filters are circuits that pass signals at certain frequencies (in the pass- band) while rejecting signals at other fre- quencies (in the stop-band). The frequency that divides the pass-band from the stop- band is a cut-off frequency. Filters constructed from just resistors, capacitors and inductors are called passive filters, whereas filters that employ devices such as transistors or op.amps are called active filters. We can make very good passive filters, but inductors are often bulky and expen- sive. They are also limited by non-ideal characteristics such as series resistance, and are susceptible to magnetic pickup of interference. Filters using just resistors and capacitors cannot be used to make high performance filters due to their “soft” response and the high attenuation of the signal they cause. However, we do not always need high per- formance filters; a single resistor and capacitor filter occurs in many circuits. We have used this in many Lab Work circuits in previous parts of Teach-in 2002. Filters can be classified according to the pass-band: * Low-pass filters let low frequencies through *High-pass filters let high frequencies through *Band-pass filters let a specific range of frequencies through *Band-stop filters reject a specific range of frequencies As we will see next month, low-pass fil- ters are of particular importance when we want to convert analogue sensor data into digital for computer storage or analysis. Bandpass filters are needed for the tech- nique described above where we measure the response to stimulus at a particular fre- quency. A notch filter is a band-stop filter with a very narrow stop-band, which can be useful where our sensor signal is subjected to interference at specific frequencies (such as mains 50Hz/60Hz). FILTER CHARACTERISTICS The graph of gain (in dB) against fre- quency (on a logarithmic scale) is called the frequency response of the filter, an example of which is shown Fig.8.1. For an ideal filter the transition from pass-band to stop-band occurs at a single frequency. For real filters (see Fig.8.1) the transition from pass-band to stop-band occurs over a range of frequencies, thus the we need to define specifically what we mean by cut-off frequency. The cut-off is usually defined to be the point where the filter’s gain is –3dB with respect to the pass-band gain. Other defini- tions could be used, particularly for responses where the pass-band gain is not flat. The stop-band may also be specifically defined in terms of reduction in gain, although there is not a “standard” gain reduction for stop-band as there is with the –3dB point for cut-off. The range of fre- quencies between the pass- and stop-bands is the transition region. If the pass-band gain does not vary much with frequency, it is described as flat. In some filters the pass-band gain has distinctive ripples as frequency varies, the depth of these ripples is usual- ly measured in decibels. The stop-band may also have ripples. In sensor applications where the fre- quency of the sensed signal varies and sig- nal magnitude is of importance, a filter without a flat pass-band may lead to mea- surement errors. The slope of the frequency response in the transition region, and possibly the stop-band, indicates how quickly the fil- ter’s gain drops as the frequency moves away from the cut-off. The slope is measured in dB per octave, or dB per decade; this value is called the fall-off or roll-off. The fall-off may be different near and far from the cut-off, thus we have initial fall- off and ultimate fall-off. Note that an octave is a range of frequencies in which the higher frequency is twice the lower (the same term is used in music). A decade is a range in which the upper value is ten times the lower. The order of a filter determines the ulti- mate fall-off and can be calculated as 6ndB/octave (or 20ndB/decade), where n is the filter order. For a first order filter this is 6dB/octave; for a second order filter it is 12dB/octave, and so on. The variation of phase shift with fre- quency (the phase response) is also an important characteristic of filters. Phase shift relates to the time delay of signals passing through the filter. If the delay is different at different frequencies the signal will be distorted. Constant delay 448 Everyday Practical Electronics, June 2002 EPE Tutorial Series TEACH-IN 2002 Part Eight – Filters, Actuators, Smoke and Gas Detection Making Sense of the Real World: Electronics to Measure the Environment IAN BELL AND DAVE CHESMORE Fig.8.1. Describing a filter’s frequency response.

Upload: suryakarthik

Post on 16-Sep-2015

220 views

Category:

Documents


3 download

DESCRIPTION

Learn about Filters, Actuators, Smoke and Gas Detection

TRANSCRIPT

  • MOST of the sensing we have dis-cussed so far in this series has beenpassive measurement of one para-meter or another. However, we are notrestricted to this approach; we may if wewish send a signal out into the environmentand monitor the response with a sensor. Wecan call this a sensor-actuator combina-tion (an actuator is something that doessomething or sends out a stimulus).

    Our hands and feet are actuators andeyes and ears are sensors, but we can alsouse a combination approach. For example,we can measure the properties of a mate-rial by squeezing it and feeling and watch-ing the response.

    This month we will be briefly examiningthe idea of sensor-actuator combinations we could have written an entire series onthis topic so we only have space to look atit briefly. We will also be investigating sen-sors for smoke and gas, though we examinefilters first.

    Electronic filters are circuits that pass

    signals at certain frequencies (in the pass-band) while rejecting signals at other fre-quencies (in the stop-band). The frequencythat divides the pass-band from the stop-band is a cut-off frequency.

    Filters constructed from just resistors,capacitors and inductors are called passivefilters, whereas filters that employ devicessuch as transistors or op.amps are calledactive filters.

    We can make very good passive filters,but inductors are often bulky and expen-sive. They are also limited by non-idealcharacteristics such as series resistance,and are susceptible to magnetic pickup ofinterference.

    Filters using just resistors and capacitorscannot be used to make high performancefilters due to their soft response and thehigh attenuation of the signal they cause.However, we do not always need high per-formance filters; a single resistor andcapacitor filter occurs in many circuits. Wehave used this in many Lab Work circuits inprevious parts of Teach-in 2002.

    Filters can be classified according to thepass-band:

    Low-pass filters let low frequenciesthrough

    High-pass filters let high frequenciesthrough

    Band-pass filters let a specific range offrequencies through

    Band-stop filters reject a specific rangeof frequencies

    As we will see next month, low-pass fil-ters are of particular importance when wewant to convert analogue sensor data intodigital for computer storage or analysis.Bandpass filters are needed for the tech-nique described above where we measurethe response to stimulus at a particular fre-quency. A notch filter is a band-stop filterwith a very narrow stop-band, which can beuseful where our sensor signal is subjectedto interference at specific frequencies (suchas mains 50Hz/60Hz).

    The graph of gain (in dB) against fre-quency (on a logarithmic scale) is calledthe frequency response of the filter, anexample of which is shown Fig.8.1. For anideal filter the transition from pass-band tostop-band occurs at a single frequency. Forreal filters (see Fig.8.1) the transition frompass-band to stop-band occurs over a rangeof frequencies, thus the we need to definespecifically what we mean by cut-offfrequency.

    The cut-off is usually defined to be thepoint where the filters gain is 3dB withrespect to the pass-band gain. Other defini-tions could be used, particularly forresponses where the pass-band gain is notflat.

    The stop-band may also be specificallydefined in terms of reduction in gain,although there is not a standard gainreduction for stop-band as there is with the3dB point for cut-off. The range of fre-quencies between the pass- and stop-bandsis the transition region.

    If the pass-band gain does not varymuch with frequency, it is described asflat. In some filters the pass-band gainhas distinctive ripples as frequencyvaries, the depth of these ripples is usual-

    ly measured in decibels. The stop-bandmay also have ripples.

    In sensor applications where the fre-quency of the sensed signal varies and sig-nal magnitude is of importance, a filterwithout a flat pass-band may lead to mea-surement errors.

    The slope of the frequency responsein the transition region, and possibly thestop-band, indicates how quickly the fil-ters gain drops as the frequency movesaway from the cut-off. The slope ismeasured in dB per octave, or dB perdecade; this value is called the fall-off orroll-off.

    The fall-off may be different near and farfrom the cut-off, thus we have initial fall-off and ultimate fall-off. Note that anoctave is a range of frequencies in whichthe higher frequency is twice the lower (thesame term is used in music). A decade is arange in which the upper value is ten timesthe lower.

    The order of a filter determines the ulti-mate fall-off and can be calculated as6ndB/octave (or 20ndB/decade), where n isthe filter order. For a first order filter this is6dB/octave; for a second order filter it is12dB/octave, and so on.

    The variation of phase shift with fre-quency (the phase response) is also animportant characteristic of filters. Phaseshift relates to the time delay of signalspassing through the filter. If the delay isdifferent at different frequencies thesignal will be distorted. Constant delay

    448 Everyday Practical Electronics, June 2002

    EPE Tutorial Series

    TEACH-IN 2002Part Eight Filters, Actuators, Smoke andGas Detection

    Making Sense of the Real World: Electronics to Measure the Environment

    IAN BELL AND DAVE CHESMORE

    Fig.8.1. Describing a filters frequencyresponse.

  • corresponds with a linear increase of phaseshift with frequency. The terms constant-delay, or linear-phase are used to refer tofilters that are ideal or have very good per-formance in this respect.

    The time domain response of a filter canbe obtained by applying a step change tothe input (e.g. a sudden change from 0V tosome other voltage). The response mayhave a number of features which are illus-trated in Fig.8.2. The terms used can bedefined as:

    Rise time is the time to get from 10 percent to 90 per cent of the final value.

    Overshoot is the percentage of maxi-mum value over the final value.

    Ringing is the decaying oscillation thatmay occur as the output settles to itsfinal value.

    Settling time is the time the outputtakes to get within certain small per-centage of final value. Settling timemay be of importance in high speedsensor applications as we may not beable to get an accurate reading until thecircuit has settled.

    Filter design is a compromise between

    requirements such as pass-band flatness,sharpness of cut-off, delay flatness (phaselinearity), rise time, overshoot, etc. Anumber of well-known filter types providedifferent properties. Butterworth filtershave a very flat gain response in the pass-band. Chebyshev filters have a very steeptransition from pass-band to stop-band buthave ripples (or a resonant peak) in thepass-band gain. Bessel filters have verygood phase linearity.

    There are many circuit configurationsfor active filter circuits, with variants forhigh-pass, low-pass, band-pass etc. Wecertainly do not have space to look at allof them in detail here! As an example, wehave chosen an equal component Sallenand Key second order low-pass filter (seeFig.8.3), which can be set up to provide avariety of types of response as shown inFig.8.4. Here you can see the flat, but rel-atively steep, response of the Butterworthfilter, and resonant peaks in theChebyshev responses.

    The Sallen and Key part of the namecomes from names of the engineers whofirst described it and the equal compo-nent bit refers to the fact that the two fre-quency selection capacitors and resistorshave the same value (labelled R and C onthe schematic).

    The high-pass version of the circuit isobtained by swapping the locations of R

    and C. Sallen andKey filters areexamples of a moregeneral class of fil-ters called singleamplifier biquadratic(SAB) filters. Bi-quadratic (biquad forshort) is a term relat-ing to the mathemat-ics behind the filtercharacteristics.

    To complete thedesign of a filter, firstselect your cut-off fre-quency, fC. Thenchoose the type of fil-ter you want (Bessel,Butterworth etc.,depending on theresponse shaperequired) based on thecharacteristics of eachtype.

    Using a table, suchas that in Table 8.1,establish the dampingfactor (Greek letterxi) and the resonantfrequency f0. Thedamping factor in thiscontext states the fil-ters ability to respondwithout ringing occur-ring. Tables of filterparameter values arepublished in cook-books on filter design.

    You are now ready to find the actual com-ponent values. Select the values of R and Cto give the required resonant frequency f0.Resistor values of around 10k are appro-priate, but higher values (e.g. 100k) may bebetter for low cut-off frequencies as the sizeof the capacitors is reduced. Use:

    f0 = 1 so C = 12RC 2Rf0So, for example, if we want a

    Butterworth filter with a cut-off frequencyof 1kHz (and the same resonant frequency)and we decide to use 10k resistors, weneed capacitors of value 0016F.

    The value of sets the gain requiredfrom the amplifier and hence the values ofthe op.amp feedback resistors. These val-ues can be set completely independently ofthe frequency component values, but thebest value for RA is one that gives about thesame resistance seen at the inverting andnon-inverting inputs.

    This happens when the parallel combina-tion of the gain resistors equals the seriescombination of thefrequency resistors.From which we getthe best value for RAas

    RA = (3 2) R(1 )

    Hence, for example,if the frequency-setting resistors areboth 10k and we

    want = 0707, we get the best value forRA as about 54k. Calculate the otherresistor value using (2 2)RA (e.g. 32kfor = 0707 and RA = 54k).

    If the best value for RA is not close toa preferred value is does not matter if youchange it a bit, but given your value for RAthe other gain resistor must be as close aspossible to (2 2)RA in order to get theright filter characteristic.

    The gain due to op.amp IC1 (Fig.8.3) isset to (3 2) by the damping factor, . Ifyou need a specific gain, say G, add anordinary op.amp amplifier with gainG/(3 2). This could be at the input toprovide the d.c. bias path for the filter andact as a buffer for the input signal (seelater).

    The filter gain should not usually bemuch greater than 2, above this we get avery high Q but the circuit responsebecomes very sensitive to componentvalues.

    Everyday Practical Electronics, June 2002 449

    Fig.8.3. Equal component Sallen and Key second order low-pass filter circuit.

    Fig.8.4. Typical responses from a second order Sallen andKey low-pass filter.

    Table 8.1 Parameters for 2nd order low-pass Sallenand Key filter. fc is 3dB (cutoff) frequency. The

    frequency responses of these filters are shown inFig.8.4.

    Characteristic Name Resonant DampingFrequency (f0) (d or 2)

    Best Delay Bessel 1274 fc 0866Flattest Pass-band Butterworth 1000 fc 07071dB Ripple Chebyshev 0863 fc 05232dB Ripple Chebyshev 0852 fc 0448Fig.8.2. Filter time domain response.

    1103w

    Frequency

    110401

    100

    Gai

    n

    1

  • The input to the filter must have a rea-sonably low impedance d.c. path to ground(i.e. it should not be directly capacitivelycoupled to the input signal). This is in orderto make sure that the op.amp is providedwith bias current. If your signals are large,make sure that the input signal will not sat-urate the op.amp.

    If you want your filter to deal with rela-tively high frequency (tens to hundreds ofkilohertz) or large magnitude (severalvolts) then there is an op.amp parameteryou need to take note of.

    Slew rate specifies the maximum rate ofchange of output voltage for an op.amp.The higher the frequency and the larger thesignal magnitude, the faster the op.ampoutput has to change to keep up with therequired output signal. If this speedexceeds the op.amps slew rate the op.ampwill fail too keep up, resulting in distortionof the signal.

    If the required peak output voltage is VMand the slew rate is s (in volts per second,from the op.amps datasheet) then themaximum frequency sinewave that can beoutput without distortion is:

    f = s2VmFor example, for a slew rate of 2V/s

    and VM = 15V, the maximum frequency is21kHz, not a particularly high one. Theslew rate of the OP177 op.amp is quite lowat 03V/s (the 741 is 05V/s). This isbecause the device is optimized for veryaccurate processing of relatively low leveland low frequency signals.

    Far faster op.amps are available if youneed them; in fact, we need to use anLF351 (13V/s) to amplify the output ofthe sinewave generator in Lab 8.1because it has a reasonable gain. Youcould easily see the effect of slew rate byexchanging the LF351 in Lab 8.1 for anOP177 and varying the frequency of thesinewave.

    There are a number of low cost and even

    free software packages available for thedesign of filters. These remove the need forlaborious calculations and searching of fil-ter parameter tables, and of course it is veryquick if you want to change one or twoparameters.

    With such software packages youoften have the further advantage of get-ting the schematics and responses drawnfor you. A screenshot from a free pack-age called Filter Free from NuhertzTechnologies (www.nuhertz.com) isshown in Fig. 8.5.

    The filter schematic and responsecurves resulting from the design parame-ters in Fig.8.5 are shown in Figs.8.6 and8.7. Note that this circuit is a singleamplifier biquad and is in fact a Sallenand Key filter, but without the simplify-ing equal component feature which ourprevious circuit had in order to makemanual design easier.

    It is fairly obvious that the circuit

    becomes quite complex if we need highorder filters (one op.amp and at least fourcomponents for each second order filter).

    There is, however, an alternative solution a switched capacitor filter. A switchedcapacitor filter uses analogue switches torapidly switch between two differentcapacitors controlling the duty cyclechanges the effective capacitance.

    Such devices allow fine control ofcapacitor values and can be manufacturedon silicon. There are many integrated cir-cuit filters from Linear Technology,Maxim, etc. available as low-pass, high-pass, band-pass filters, even Butterworth,Chebyshev, etc. They have many advan-tages, including small size, programma-bility and ease of use. However, theysuffer from one problem their need forclocking to control the capacitor switch-ing. The clock, often 100 times the cut-offfrequency, can appear at the output of thefilter, albeit at low levels, and can inter-fere with low level signals.

    The device we will be using in Lab 8.1 isan LTC1062 from Linear Technology whichis a 5th order maximally flat (Butterworth)low-pass filter with an internal clock. Theratio of clock to cut-off frequency is 100:1and can be generated externally from anoscillator or even a microcontroller. Thismeans we can vary the cut-off frequency.The i.c. itself is 4th order and an additionalRC section is added to provide the 5th order.A full datasheet can be found at www.linear.com/pdf/lt1062.pdf.

    In electronic sensing the sensor-actuator

    combination is often used to make it easierto ignore interference signals we knowthe properties of the signal we sent out sowe can ignore irrelevant parts of the sensorresponse. The most obvious example is touse a stimulus at a particular frequency and

    only measure responses from the sensor atthat frequency. In order to extract the fre-quency of interest we need filter circuits,which, as you have seen, is one of ourtopics this month.

    Next month we see that filters are alsovery important when we want to digitizethe signals from sensors for processing bya microcontroller or computer.

    Sensor actuator combinations are essen-tial for some measurement processes. Forexample, we may need to apply heat or elec-trical signals to a substance for chemicalsensing. Indeed, many gas sensors need tobe heated to around 350C and this is bestachieved if the heating controller is activelycontrolled so that any deviations from theoptimum temperature are counteracted.

    The simplest way of achieving this is tofeed back the difference between the sen-sors actual temperature and its desiredtemperature in such a way as to reduce thedifference to zero. Any changes in sensor

    temperature aredetected and the opti-mum temperature isreached.

    A simpler and morefamiliar feedback cir-cuit is in controllingthe temperature of aroom where the heateris turned on until thedesired temperature isreached, when it isturned off. This is asimple on-off controland is suitable formany applications.

    We often need moreaccurate control where,as above, the differenceis fed back and the out-put is a function of the

    450 Everyday Practical Electronics, June 2002

    Fig.8.5. Example filter design software.

    Fig.8.6. Single amplifier biquad Sallenand Key filter.

    Fig.8.7. Frequency response of the circuit in Fig.8.6.

  • difference. So, in the heater example, wewould vary the amount of power to the heaterdepending on the difference the larger thedifference, the more power applied.Feedback control is found just about every-where, from controlling the speed of anengine, to an autofocus on a camera.

    Everyone is familiar with smoke detec-

    tors, but how do they work? There are actu-ally two basic types photoelectric andionization detectors.

    The most common form of photoelectricsmoke detector relies on the detection of lightscattered from smoke particles. The principleof light scattering is also used in measuringthe turbidity (cloudiness) of water, an impor-tant factor in many aquatic applications. Suchan instrument is called a Nephelometer and iswidely used in the water industry.

    The way in which light is scattered bysmall particles is quite complex andinvolves the size of the particle and thewavelength of light (remember the equa-tion relating wavelength, frequency andspeed, = fc-1 where f is the frequency andc the speed of light, 3 108ms-1).

    Basically, the shorter the wavelength incomparison to the size of the particle, themore the light is scattered. In fact, if theparticle size is smaller than the wavelength,the amount of scattering increases by thefourth power of the wavelength, and shortwavelengths are scattered much more thanlonger wavelengths.

    This explains why the sky is blue and thesetting sun is red blue light is scatteredfrom air molecules much more than redlight and it is scattered sideways so the skylooks blue. At sunset, the light from the sunhas to pass through more atmosphere andthe blue is scattered even more, increasingits apparent red content. If you look care-fully at the sky when the sun is on the hori-zon, you will actually see all the coloursranging from red to violet as you lookfurther away from the sun. (Never lookdirectly at the sun.)

    At the opposite extreme, when the parti-cles are much larger than the wavelength oflight, all wavelengths are scattered equally.This is why thin clouds appear to be white.When a cloud becomes very thick, the lightis attenuated and it becomes grey.

    One of the best ways of illustrating the idea

    of light scattering is to use a torch and twoglasses of water. Put a couple of drops of milkinto one glass of water. If you look throughthe glass at right angles to the torch beam,you will not be able to see the beam in theglass only containing water, but will see it inthe water-milk mixture. Try increasing thenumber of drops of milk and see the effect.

    In addition to the effect of particle sizeon scattering, the chemical nature of parti-cles also changes the amount of scatter.This has application in monitoring of gasesemitted from chimneys, which can be car-ried out at a distance using a telescope andlaser, as indicated in Fig.8.8.

    The laser illuminates the pollutioncloud and light scattered back from parti-cles is detected by sensitive detectors inthe telescope. The chemical makeup of thecloud can be found out from the receivedsignal. It is also possible to plot the pollu-tion in the cloud by moving the telescope

    and measuring the time taken for eachlaser pulse to return (the longer the time,the further away the scattering particles).This system is known as a LIDAR, whichstands for Laser Radar.

    The principle of operation of a photo-

    electric smoke detector is simple, as shownin Fig.8.9 where a beam of light (usuallyinfra-red IR) is passed along a tube and aphotodiode is placed at right angles to thebeam. Under normal conditions, the photo-diode will not pick up any light, but ifsmoke is present, the light is scattered bythe smoke particles and the photodiode willdetect the light.

    Photoelectric smoke detectors are com-mercially available but are not as commonas the ionization chamber devices. We dis-cuss the building a simple photoelectricsmoke detector in this months Lab Work.

    As said earlier, smoke is detected bylight being scattered. Detecting smallchanges in light can be difficult, especiallyif there is a lot of ambient light around. Wecan reduce the ambient light in two ways placing the whole detector in a dark box orusing IR light. The problem with a darkbox is that we need to allow smoke to enterbut not light!

    To use IR is the best option since IRdetectors are usually encased in a black

    package which isopaque to visible lightbut transparent to IRlight. Even so, weneed to reduce theoverall light to a min-imum because there isusually quite a lot ofambient IR lightaround.

    In the Lab, we willbe building a sensorfrom discrete compo-nents and some digitalcircuits. If we wished,we could have usedcommercially avail-able integrated cir-cuits which containall circuitry including

    piezo-buzzer drivers. Examples are theMotorola MC145010 and Allegro A5366(both functionally identical). All they needare a few resistors and capacitors, and a IRl.e.d. and photosensor. They are also capa-ble of being interconnected (e.g. 40 on acommon signalling bus).

    Ionization chamber detectors are verydifferent from photoelectric detectors andthey rely on detecting changes in a currentcaused by a radiation source. The schemat-ic diagram of a typical ionizing chamber isshown in Fig.8.10, consisting of a radioac-tive source and two plates across which is avoltage.

    The principle of operation is as follows.The radioactive source (a very small quan-tity of Americium-241) produces alpha par-ticles which are helium nuclei. Theseparticles ionize air molecules within thechamber by knocking electrons of theatoms, causing them to have a positivecharge, the free electrons being attracted tothe positive plate and the ions to the nega-tive plate. A current is therefore createdwhich is amplified by electronics. Whensmoke particles enter the chamber the ioncurrent is disrupted and the electronicsdetect the drop in current.

    Ionization chamber detectors are moresensitive than photoelectric detectors and arecompletely safe. The amount of radioactivematerial is very small, typically 200g andeven a piece of paper will completely absorbalpha particles. The only thing you should

    Everyday Practical Electronics, June 2002 451

    Fig.8.8. Principle of a LIDAR system.

    Fig.8.9. Photoelectric smoke detector.

    Fig.8.10. Ionization chamber.

  • not do is disturb the Americium and cause itto become airborne.

    Gas detection and monitoring has taken

    on an ever-increasing importance due to theawareness of the damaging effects thatsome volatile gaseous compounds have onthe environment and our health. There aremany gas sensors available and Capteurprovides a good range. Table 8.2 givesexamples of some sensors and their sensi-tivity. Full details can be found on theCapteur website www.capteur.co.uk.

    Another company, Figaro Inc., has beenin the business for more than 30 years anddetails of their sensors can be found atwww.figarosensor.com. Sensor cost isquite high, from 10 to over 25 dependingon the gas to be detected. The sensor wewill be using next month is about 10 andis capable of detecting a range of gases, aswe will see later.

    The range of gases for which sensors areavailable is very large, ranging from com-bustible gases such as methane, propaneand hydrogen through toxic gases (chlo-rine, carbon monoxide) to organic solventssuch as alcohol, toluene and xylene.

    How do they work? There are severaltypes depending on the material used. Thesimplest types utilizing a special tin diox-ide semiconductor coated on a ceramictube. The conductivity of the tube varies in

    response to its exposure to a wide range ofdetectable gases.

    These sensors need to be heated to oper-ate and they incorporate an internal heatingelement which must be maintained at350C or so, depending on the sensor. Themost common circuit used is a bridgewhere the sensor forms one arm of thebridge. The other arm of the bridge is eitheran accurate resistor or a compensator. Infact, the sensor we will be using nextmonth comprises two separate devices asensor and a compensator.

    Many gases are heavier than air so the

    sensors are best placed low down whengeneral monitoring is being undertaken;

    different sensors can be selected for animproved response to particular gases. Theability to respond to carbon monoxide alsomeans that some sensors will respond wellto smoke, acting as a smoke or fire alarm.

    One disadvantage is that the heater ele-ment draws a high current, e.g. the FigaroTGS813 needs typically 160mA or more at5V, and they are also easily damaged by thepresence of some chemicals, including sili-cone and salts (boat owners take note).

    Sensors incorporate a fine stainless steelmesh which acts as a flame arrestor. Youare probably aware of the principle ofintrinsic safety by which a gas detector sys-tem is designed in such a way that it cannotcreate a spark or ignition hazard anywhere,or cause an explosion when a flammablegas is detected.

    Ignition sparks can be caused in manydifferent ways, including the arcing of elec-trical switches or relay contacts, faultyinsulation, loose plugs and sockets, theoperation of electric buzzers or even staticelectricity discharge from nylon clothing.Sources of ignition also include light fit-tings (fluorescent and incandescent) andelectric heaters.

    For this reason, if ever you detect a gasleak, you should never turn any electriclights on or off (including torches/flash-lights) or operate any electrical item,because any sparks may cause an explo-sion. Likewise, mobile phones are bannedfrom use at petrol filling stations in case thehigh frequency transmissions induce sparksin electrical equipment and cause a fire inany pockets of gas.

    452 Everyday Practical Electronics, June 2002

    Table 8.2 Some Gas Sensors from Capteur and FigaroGas Concentration Concentration

    Range (Capteur) Range (Figaro)Ammonia 0-100ppm 30-300ppmCarbon Monoxide 0-400ppm 50-1,000ppmHydrogen 0-10,000ppm 50-1,000ppmLPG 0-1% 500-10,000ppmMethane 0-1% 500-10,000ppmOzone 0-300ppb Propane 0-1% 500-10,000ppmVOCs (volatileorganic compounds) 0-10ppm Oxygen 0-100%ppb = parts per billion (108) ppm = parts per million (106)

    Left: Example of asmoke detector fordomestic use.

    Example of a gas sensor from Figaro.

    TEACH-IN 2002 Lab Work 8DAVE CHESMORE

    FILTER AND SMOKE DETECTOR EXPERIMENTSLab 8.1 Signal Generator

    In this Lab we build a sinewave genera-tor so that we can test the filter circuits inLabs.8.2 to 8.5 and to illustrate aliasingwhich will be described in Part 9. The cir-cuit in Fig.8.11 is based on an IntersilICL8038 waveform generator (IC1). Thisdevice is easy to use and can generate sine,

    square and triangular waves between0.001Hz and 300kHz. A full descriptivedatasheet for the 8038 can be downloadedfrom www.intersil.com/data/FN/FN2/FN2864/FN2864.pdf.

    You could alternatively use a MaximMAX038 instead as it is pin-compatiblewith the 8038 but operates up to 20MHz.

    However, here we are only interested inaudio frequencies and the circuit has beendesigned to operate up to 20kHz.

    Op.amp IC2 provides gain and outputbuffering since the sinewave output has arelatively high impedance. It is connectedto the 8038 via potentiometer VR3 whichallows the output amplitude to be varied.

  • Everyday Practical Electronics, June 2002 453

    Notice that IC2 is a type LF351 this is awide bandwidth op.amp (high slew rate).

    Later, if you want to see why this deviceis recommended, try replacing it with anOP177 or 741 and increase the frequencyto 10kHz or more. The op.amps outputwill become a triangular wave instead of asinusoidal one, due to the low slew rate ofthe amplifier (see Tutorial section).

    Build the circuit of Fig.8.11 on bread-board or, alternatively on stripboard if youwish to make a more permanent circuit(see photograph). There are three poten-tiometers, which control frequency (VR1),duty cycle (VR2) and output amplitude(VR3).

    Once the circuit is built, set VR1 andVR3 to halfway (VR3 in our circuit is apreset). Connect the Picoscope and checkto see that the waveform looks like that inFig.8.12. You will notice that it doesntactually look particularly sinusoidalbecause of the steps we will explain thisnext month.

    The shape can be altered with VR2 adjust it until the shape is as close to asinusoid as possible. The next stage is tocalibrate VR1, at least at the low frequencyend by measuring the frequency with thePicoscope and noting the wiper position.Be aware that at very low frequencies, theoutput becomes non-sinusoidal as the pos-itive peaks become flattened.

    Whilst all we need is the sinewave out-put, the circuit is versatile and you couldadd a three way switch to allow selectionof sine, triangle or square wave and changeVR3 to a panel mounting potentiometer togive easier control of the output amplitude.

    Lab 8.2 Low-pass FiltersIn Fig.8.13 is shown the circuit for a

    Butterworth second order low-pass filterbased on the Sallen and Key filterdescribed in this months tutorial section.The cut-off frequency is set at approxi-mately 1kHz. Build the circuit and test itusing the signal generator from Lab 8.1and the Picoscope to measure the outputsignal.

    Set the signal generators output ampli-tude to about 6V peak-to-peak. The filtered

    Lab 8.1 Signal GeneratorResistors

    R1 82kR2 4M7R3, R4 4k7 (2 off)R5 22kR6 100kR7 6k8R8 15k

    All 025W, 5% carbon film

    PotentiometersVR1 10k rotary carbon lin.VR2 1k min. carbon presetVR3 100k min. carbon preset

    CapacitorsC1 100n polyesterC2 1n5 polyester

    SemiconductorsD1 1N4148 signal diodeIC1 ICL8038 waveform

    generator (see text)IC2 LF351 bifet op.amp

    Lab 8.2 Low Pass FiltersResistors

    R1, R2,R5, R6 1k5 (4 off)

    R3, R7 15k (2 off)R4, R8 18k (2 off)

    CapacitorsC1 to C4 100n polyester (4 off)

    SemiconductorsIC1, IC2 LF351 bifet op.amp (or

    LF353 dual bifetop.amp)

    SeeSSHHOOPPTTAALLKKppaaggee

    Approx. CostGuidance Only 2233

    excl. hardware

    Lab 8.4 Switching FilterResistors

    R1 56kR2 22kR3 680kR4, R5 27k (2 off)

    All 025W 5% carbon film

    CapacitorsC1 1n5 polyesterC2, C3 10n polyester (2 off)C4 10 elect. 16V

    SemiconductorsIC1 4093 quad Schmitt

    trigger NAND GateIC2 LTC1062 5th order

    switched capacitor low pass filter

    Lab 8.5 Photoelectric SmokeDetector

    ResistorsR1, R5, R8 1k5 (3 off)R2 1kR3 12kR4 470kR6 8k2R7 470k

    All 025W 5% carbon film.

    CapacitorsC1 1 elect. 16VC2, C4 100n polyesterC3 47 elect. 16V

    SemiconductorsD1/TR1 QPE1113 IR

    emitter-detector pairTR2 BC184 npn transistorIC1 4093 quad Schmitt

    trigger NAND GateIC2 4538 monostable

    MiscellaneousX1 Piezoelectric buzzerStripboard sections (see text)

    Fig.8.12. Sinewave output of the signal generator at 18kHz,as viewed on the Picoscope

    Stripboard assembly for the signal generator circuit inFig.8.11.

    Fig.8.11. Signal generator circuit.

    N.B. Some components are repeatedbetween Lab Works.

  • peak-to-peak output voltage from IC1should decrease as the signal frequencyincreases. You can plot a graph of outputvoltage against frequency by setting theinput voltage to 1V peak-to-peak andmeasuring the output voltage at differentfrequencies.

    The most common form of graph showsdecibels (dB) plotted against frequency asshown earlier in Fig.8.7. The value in dBcan be calculated from:

    value in dB = 20log10(Vout/Vin)where log10 is the log function on a calcu-lator (not the ln function).

    The value of 20 is present because weare using signal voltages; it should bechanged to 10 if signal power is measured.

    For example, if Vout = 2V and Vin = 1Vthen the output is 6dB; if Vout = 10V andVin = 2V, the output is 14dB. Conversely, ifthe output is smaller than the input, then thevalue is dB, e.g. Vout = 2V, Vin = 5V, thedecibel value is 8dB.

    Plot the output in dB for frequenciesbetween 10Hz and 2kHz. As the frequencyincreases, you should see the outputremaining constant until 1kHz or so whenit will start decreasing. The shape of thecurve shows that the filter is a low-passtype. As discussed in the tutorial, the rate at

    which the outputdrops is called theroll-off and can becalculated as 6ndB peroctave (or 20ndB perdecade) where n is theorder of the filter.

    In our case, n = 2,so the roll-off shouldbe 12dB per octave, or40dB per decade.Fig.8.14 shows thefrequency responsegraph for the circuit.

    Build the circuit inFig.8.15 and repeatthe measurements.Now you should seethat the roll-off hasincreased to 24dB peroctave (80dB perdecade) because thefilter is now 4th order.

    Lab.8.3 High-pass FiltersIt is a simple matter to change the cir-

    cuits in Figs.8.13 and 8.15 to high-pass byswapping R (R1, R2) for C (C1, C2). Trythis using the circuit in Fig.8.13 and plotthe graph. You should now see that the fil-ter is high-pass.

    Changing the cut-off frequency requiresrecalculating R and C as we described inthe tutorial section. Note that the resistorand capacitor values must be close to thecalculated values otherwise the filterresponse will not be accurate.

    You can build a band-pass filter by cas-cading high- and low-pass filters. Forexample, say we wanted to create a300Hz to 3kHz band-pass filter, wedesign a 300Hz high-pass filter and con-nect its output to the input of a 3kHz low-pass filter.

    Lab 8.4 Integrated Circuit FilterThe device we are using in this Lab is a

    5th order low-pass filter based on aswitched mode capacitor device whose cut-off frequency is controlled by an oscillatorclock, and is 100th of the clock frequency.So, to use it we only need to provide aclock 100 times that of the cut-off frequen-cy, ideal for circuits where the cut-off fre-quency needs to be changed.

    These switched mode devices are oftenused for anti-aliasing filters and in micro-controller applications where the micro-controller directly produces a clock fromone of its timers.

    The complete circuit diagram for aclocked filter is shown in Fig.8.16. It isless complex than even the 2nd order

    454 Everyday Practical Electronics, June 2002

    Fig.8.15. Fourth order low-pass filter circuit.

    Fig.8.14.. Frequency response for the circuit in Fig.8.13,plotted from actual measurements.

    Fig.8.13. Second order low-pass filter.

    Right: Breadboard assembly for the circuit in Fig.8.13, alsoshowing the sinewave generator assembly.

  • filter! The LTC1062 filter device (IC2)can operate on single or dual power sup-plies but only to 8V so we are operatingthe circuit at +5V only. This means thatthe ground pin (pin 2) has to be biassedat half of the supply, created by resistorsR4 and R5.

    The clock signal is generated by SchmittNAND gate IC1a/IC1b and is set toapproximately 50kHz to give a cut-off fre-quency of 500Hz. There are two outputs,from pin 8, which is buffered, or from pin 7via C3, to give an accurate d.c. output.

    You can plot the frequency responsewhich will now be steeper than the others(30dB/octave). Note that the input signalshould be less than 2V peak-to-peak.Changing the value of resistor R2 allowsthe cut-off frequency to be changed.

    We will be returning to filters and thisfilter in particular next month, when weexamine aliasing and analogue-to-digitalconversion.

    The filter is maximally flat (Butterworthresponse) if the RC components are calcu-lated as follows:

    1=

    fc2R1C 184

    C3 = C2

    and R3 12R1

    Lab 8.5 Photoelectric Smoke DetectorIn this Lab we build a photoelectric

    smoke detector using the light scatteringmethod. Fig.8.17 shows the circuit diagramwhich consists of a 1kHz oscillator basedaround Schmitt NAND gate IC1a. Its out-put is buffered IC1b which drives IR l.e.d.D1. The light scattered from any smokeparticles is detected by phototransistor TR1and amplified by TR2 to give a digital out-put. i.e. either fully high or fully low.

    The IR emitter and phototransistor areusually purchased as a pair, in our case aQPE1113. Others can be used (e.g. CH10Land CH11M) but the values of R3 to R5may need to be adjusted if the phototran-sistors gain is different.

    The output of TR2 is fed into NANDgate IC1c, with the other input taken from

    Everyday Practical Electronics, June 2002 455

    Fig.8.16. Switched capacitor filter circuit.

    Fig.8.17. Circuit diagram for the smoke detector.

    Breadboard assembly for the circuit in Fig.8.16. Breadboard assembly for the circuit in Fig.8.18. The sensoris mounted on a separate stripboard and housed in the boxat top right.

  • the output of IC1a. Its output feeds intomonostable IC2. Normally (no light), nopulses will appear at the output of IC1c.When sufficient light is scattered, the puls-es on the collector of TR2 (see Fig.8.18)become large enough for gate IC1c to pro-duce pulses, causing the monostable to trig-ger. The monostable is continuallyretriggered until the output of TR2 dropsagain.

    The output of the monostable goes highwhen it is triggered and turns on the oscillator

    based around IC1d, which produces an audi-ble output from piezo buzzer X1. The mono-stables period is set to a few seconds to givea reasonably long audio output (see Fig.8.19).The period can be lengthened by increasingthe value of C3.

    When building the circuit, mount thephototransistor and l.e.d. at right angles to

    each other and about one centimetre apart.As discussed in the theory section, youshould place the assembly inside a contain-er to reduce the ambient light level as muchas possible. The accompanying pho-tographs show a typical configuration.

    When setting up the circuit, you shouldmonitor the output of gate IC1c using thePicoscope and twist the l.e.d. until pulsesjust stop any object scattering lighttowards the phototransistor will cause thelight level to increase.

    Finally, test the circuit using smoke andre-adjust the l.e.d. until it gives reliabledetection.

    Note that this circuit is for illustrativepurposes only and should not be used foractual smoke detection as a substitute fora commercial device.

    In Part 9 next month, we continue look-ing at filters and then discuss data samplingand digital converters.

    If you have any queries directly relatedto this series, you can write to the authorsc/o the Editorial address, or you can emailthem at [email protected](no file attachments or general electronicqueries please).

    456 Everyday Practical Electronics, June 2002

    Stripboard assembly for the smokedetector sensor pair.

    Fig.8.18. Output at TR2 when smokedetected.

    Fig.8.19. Output of monostable whentriggered.

    Name ..................................................................................................

    Address ...............................................................................................

    .............................................................................................................

    Post code ......................... Tel. ...........................................................

    SUBSCRIPTION ORDER FORM

    I enclose payment of ............. (cheque/PO in sterling only),

    payable to Everyday Practical Electronics

    My card number is: .......................................................................Please print clearly, and check that you have the number correct

    Signature .........................................................................................

    Card Ex. Date ......................................... Switch Issue No. .............

    Subscriptions can only start with the next available issue.For back numbers see the Back Issues page.

    MAKE IT A GIFT EVERY MONTH AND SAVE UP TO 68p AN ISSUE

    EPE STYLOPIC INFRA-RED AUTOSWITCH SIMPLE AUDIO CIRCUITS3

    Annual subscription rates:6 Months: UK 15, Overseas 18 (standard air service),

    27 (express airmail)1 Year: UK 28.50, Overseas 34.50 (standard air service)

    52 (express airmail)2 Years: UK 52.00, Overseas 64.00 (standard air service)

    99 (express airmail)To: Everyday Practical Electronics,

    Wimborne Publishing Ltd., 408 Wimborne Road East, Ferndown, Dorset BH22 9ND

    Tel: 01202 873872 Fax: 01202 874562E-mail: [email protected]

    Order from our online shop at:www.epemag.wimborne.co.uk/shopdoor.htm

    06/02

    NEXT MONTH WE CALL THE TUNE DONT MISS OUT MAKE SURE OF YOUR COPY NOW!