Sensors-Interfacing Techniques


Published on

This class notes is intended for Electronics students of SKU and other ECE students of all universities

Published in: Business, Technology

Sensors-Interfacing Techniques

  1. 1. Dr.Y.NARASIMHA MURTHY Ph.D Sensors and Interfacing techniquesIntroductionSensors are sophisticated devices which will detect and measure any non-electrical physicalquantity .A Sensor converts the physical parameter (for example: temperature, blood pressure,humidity, speed, etc.) into a signal which can be measured electrically.Sensor is sometimes called a primary measuring element, which can be found simply as amercury thermometer to measure the temperature. It may be embedded in the transducer toperform its function. That means the transducer consists of a primary element (sensor) plus asecondary element (signal conditioning circuit) that transforms the passive change or smallvoltage signal into active signal range that can be easily used in other chains of the control loop.So, we can write that Transducer = Sensor + Signal conditioning circuitThe important characteristics of sensors are Accuracy :High accuracy is needed Environmental condition – The performance of the sensor should not depend on environmental conditions like temperature or humidity etc.. Wide Range –.Measurement limit of sensor . The range should be high. Calibration - Essential for most of the measuring devices as the readings changes with time Resolution – Sensor must be able to detect even small changes in the input signal. Cost- Sensor should not be very expensive. Repeatability – The sensor must be able to reproduce the same output at similar conditions. Linearity : The output of the sensor must be linear .There are various types of sensors available , which measures various physical parameters. Sensor type Physical Parameter Temperature Temperature Light Light / dark Pressure Pressure or barometric pressure or blood pressure Moisture amount of moisture present in air1
  2. 2. Dr.Y.NARASIMHA MURTHY Ph.D Water-level How full / empty a container is Movement Movement nearby Proximity How close or far something isTypes of Sensors : Based on the principle of working the sensors are divided into Resistor type Capacitor Type & Inductor type etc..Resistor type Sensors: A sensor whose resistance changes with the input signal .i.e based on thevatiation of the resistance of the sensor element , the physical parameter is detected.For example , Themistor , Platinum resistance thermometer or Thermocouple etc.. are used tomeasure the temperature with respect to the variation in the resistance of the material. In the caseof a thermistor the temperature is given by Rt = R0.e β (1/T - 1/T0 ) Here ,β is the constant of the thermistor. Rt is theresistance of the thermistor at a temperature t. The variation of resistance of a thermistor withtemperature is given by the following graph.A strain gauge is a thin metal foil that changes resistance with applied strain. Strain gauges arethe preferred choice in stress analysis due to their small size and relatively low cost. Straingauges can measure strain levels from a few micro-strain (μe) to over 100,000 micro-strain.2
  3. 3. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comThe changes of resistance associated with strain gauges are small and present measurementsituation. A Wheatstone bridge arrangement is commonly used to measure the small changesin resistance associated with strain gauges.Capacitive type Sensors: These sensors work on the principle of variation of capacitance withthe external input signal.The basic operation of capacitive type sensors can be seen from the familiar equation for aparallel-plate capacitor. C = Kε0 A /dHere K is the dielectric constant of the material, ε0 is the permittivity of the free space and d isthe distance between the parallel plates and A is the area of cross section.The capacitive type sensors are used to detect the physical parameters like Humidity or pressureor proximity etc..Inductive type Sensors: These sensors are based on the principle that the inductance of a coilvaries with the change input signal.For example, if a permeable core is inserted into an inductor the net inductance is increases.The best example is the LVDT (Linear Variable Differential Transducer) which is used tomeasure displacements accurately. LVDTs can measure displacements from a few microns toseveral feet in a wide variety of environments.Inductive proximity sensors use an electromagnetic field to detect the presence of metal objects.Inductive proximity sensors are available in a variety of sizes and configurations to meet varyingapplications. The sensor incorporates an electromagnetic coil which is used to detect thepresence of a conductive metal object. The sensor will ignore the presence of an object if it is notmetal.Limitations of Sensors : The sensors have certain limitations based on their working andconstruction. Some sensors require complex signal conditioning circuitry. The output of the certain ssensors is not linear and hence additional circuitry is needed. The response time of sensors is some times very high3
  4. 4. Dr.Y.NARASIMHA MURTHY Ph.D The size of some sensors is large and occupies more space. Many times a sensor may respond to more than to one parameter. For example, gas sensors respond to more than one gas at a time. Reliability of a sensor is also a serious problem in some cases.Need and Advantages of IC sensors: With the developments in semiconductor technology andwith the advent of high speed processors ,the need of IC sensors is rapidly increasing. TheIntegrated sensors provide significant advantages in terms of overall size and the ability to usesmall signals from the transduction element.(i)They do not require complicated signal conditioning circuitry.(ii).The response time of IC sensors is low.(iii).The IC sensors are also more stable and accurate.(iv).The response of IC sensors is more linear than normal sensors.(v).The IC sensors support many latest communication protocols(I2C , SPI ,Single wire pulsewidth modulation etc..), so that they can be interfaced easily with microprocessors andmicrocontrollers.(vi).Provide better noise immunity.(vii)The smart sensors available today will also provide an alert when the sensed value exceedscertain critical value.(viii).IC Sensors are relatively simple and inexpensive.Interfacing of temperature Sensor LM 35:The LM35 series sensors are precision integrated-circuit temperature sensors, whose outputvoltage is linearly proportional to the Centigrade temperature. It gives 10mV of output voltagefor every 10C. The LM35 does not require any external calibration or trimming to provide typicalaccuracies of ±¼°C at room temperature and ±¾°C over a full -55 to +150°C temperature range.The LM35s low output impedance, linear output, and precise inherent calibration makeinterfacing to readout or control circuitry especially easy. It can be used with single powersupplies, or with dual supplies. As it draws only 60 µA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over a -55° to +150°Ctemperature range. The LM35 IC sensor is available at a Low cost .LM35 is a three terminal IC with ,Vcc ,Ground & Vout .4
  5. 5. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comThe LM 35 IC gives a 10mV analog output voltage for every degree Celsius change intemperature. The Output of the temperature sensor is analog in nature so we need an analog todigital converter for converting the analog input to its equivalent binary output.Since the output of LM35 is analog voltage, it should be converted into digital before it isapplied to a microcontroller port pin. So,with proper circuitry an ADC chip is used as shownbelow.As shown in the circuit ADC0809 is used to convert the analog voltage into its equivalent digitalvoltage.For this necessary signal conditioning circuit is developed using an operationalamplifier.The ADC0809 is an 8-input channel system. A clock signal of 100KHz is applied.The5
  6. 6. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comvoltage drop across the LM Zener is buffered by an op-amp LM741to produce a Vcc and Vrefof around 5V to 12Vfor the A/D converter .With this reference voltage the A/D converter willhave 256 steps of 20mV each. Since the temperature sensor signal is amplified by 2 ,each degreeCelsius of temperature change will produce an output change of 20mV.or one step on the A/Dconverter. This gives us a resolution of 10C ,which is about the typical accuracy of thesensor.The advantage of using Vref as Vcc for the device is that this voltage will not have theswitching noise that the digital Vcc lines have. The control inputs and data outputs of the ADCare connected to the Ports of the Microcontroller as shown in the circuit.A relay is used to control the temperature. When the temperature of the bath is reached a settemperature, the microcontroller sends a High bit to the relay so that the Relay will switch off thepower supply to the heater and automatically the temperature starts decreasing. The vice- versatakes place when the temperature falls below the set value.A 2x16 LCD module is interfaced to the Microcontroller to display the temperature .Suitableprogram is developed to control and measure the temperature. The temperature at which thewater bath is to be maintained is set as (Ts).The measured temperature is compared with this Tsand if measured temperature is higher than the set temperature, a signal is sent to the relay toswitch-off the power. Otherwise the power is switched on. This temperature is displayed onthe LCD module.Assembly Language Program :Address(Hex) Label Mnemonics Operands Comments9000 START SETB P3.4 Send ALE & SOC high NOP No operation NOP No operation CLR P3.4 ALE &SOC low LOOP1 JNB P3.5 , LOOP1 Is conversion over ? MOV A,P1 Read digital data CLR C Clear carry bit SUBB A,#SET POINT Compare the measured with Set temp.6
  7. 7. Dr.Y.NARASIMHA MURTHY Ph.D JNC OFF ON SETB P3.0 Switch on heater CALL CONV Convert the hex value into Decimal value CALL DISPLAY Display subroutine to display temp .on LCD OFF CLRB P3.0 Switch off heater SJMP START Start sensing the temperature DISPLAY LCALL 675F MOV R7, #00 MOV A, #Set point MOV R6,60H Display set temp. RET Return to main programInterfacing of Humidity Sensor : A humidity sensor measures the relative humidity and expressed as a percent (RH %). It isthe ratio of actual moisture in the air to the highest amount of moisture in air can hold at thattemperature. The most common type of humidity sensor used is the “capacitive sensor.” Thissensor is based on electrical capacitance . The sensor is composed of two metal plates with anon-conductive polymer film between them. The film collects moisture from the air, and themoisture causes minute changes in the voltage between the two plates. The changes in voltageare used to know the amount of moisture in the air. Humidity sensors are of three types.Resistive, Capacitive, and Thermal Conductivity sensing. Resistive sensors are useful inremote locations. Capacitive sensors are useful for wide RH range and condensation tolerance.Thermal conductivity sensors are beneficial in corrosive environments that have hightemperatures.The SY-HS-220 series Humidity sensor is a simple to use sensor based on capacitive technology.This module converts relative humidity to output voltage. Its operating voltage is 5V DC. Itsoperating temperature is 0 - 60˚ C and its operating humidity is 30- 90% RH. Its standard out putat 25˚C and 60%RH is 1980mV DC.7
  8. 8. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comThe circuit details of the humidity sensor are given in Fig.below.This is a three pin IC sensor .Among the three pins one is (B) connected to ground, the other (R) is to +5 volts and the thirdone (W) gives the analog output voltage based on the humidity levels.The interfacing of Humidity sensor with 8051 microcontroller using ADC0809 is shown below.Interfacing of Pressure Sensor :8
  9. 9. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comPressure Sensors convert absolute atmospheric pressure into a linear, proportional voltage, whichmay be used in any meteorological application. Pressure sensors can be classified in terms ofpressure ranges they measure, temperature ranges of operation, and most importantly the type ofpressure they measure.In terms of pressure type, pressure sensors can be divided into fivecategories. Absolute pressure sensor This sensor measures the pressure relative to perfect vacuum pressure (0 PSI or nopressure). Atmospheric pressure, is 101.325 kPa (14.7 PSI) at sea level with reference tovacuum. Gauge pressure sensor This sensor is used in different applications because it can be calibrated to measure thepressure relative to a given atmospheric pressure at a given location. A tire pressure gauge is anexample of gauge pressure indication. When the tire pressure gauge reads 0 PSI, there is really14.7 PSI (atmospheric pressure) in the tire. Vacuum pressure sensor This sensor is used to measure pressure less than the atmospheric pressure at a givenlocation. This has the potential to cause some confusion as industry may refer to a vacuumsensor as one which is referenced to either atmospheric pressure (i.e. measure Negative gaugepressure) or relative to absolute vacuum. Differential pressure sensor This sensor measures the difference between two or more pressures introduced as inputsto the sensing unit, for example, measuring the pressure drop across an oil filter. Differentialpressure is also used to measure flow or level in pressurized vessels. Sealed pressure sensor This sensor is the same as the gauge pressure sensor except that it is previously calibratedby manufacturers to measure pressure relative to sea level pressure.The NPC-1220 is a solid state IC Pressure Sensor used to measure pressure.series of solid statepressure sensors are designed to provide a cost effective solution for applications that requirecalibrated performance over a wide temperature range. Packaged in a dual-in-line configuration,the NPC-1220 series is intended for printed circuit board mounting. The NPC-1220 offers theadded advantage of superior temperature performance over the temperature compensated rangeof 0°C to +60°C.9
  10. 10. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comNPC-1220 sensor is available as an 8-pin DIP chip and the circuit connections of this pressuresensor are given below. To interface the pressure sensor with a microcontroller ,a signal conditioning circuit isnecessary. The signal conditioning circuit is shown below. The signal conditioning of thepressure sensor consists of LM324 operational amplifiers, which are high gain, internallyfrequency compensated amplifiers designed specifically to operate from a single power supplyover a wide voltage range. The analog output voltage of the sensor is given to ADC. Thepressure sensor generates 0 to 50 mV of output voltage for a 0- to 15-psi pressure range.10
  11. 11. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comThe interfacing circuit of the Pressure sensor NPC1220 to the Microcontroller using ADC0809 isshown below.Interfacing of Proximity Sensor :A proximity sensor is used to detect an object when the object approaches within the detectionrange of the sensor. Proximity sensors are mainly used for detecting the approach of metal11
  12. 12. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comobjects. There are various types of proximity sensors that are used for detecting the presence orabsence of an object. The design of a proximity sensor can be based on principles like variablereluctance, eddy current loss, saturated core, and Hall effect etc.. Common types of non-contact proximity sensors include inductive proximity sensors,capacitive proximity sensors, ultrasonic proximity sensors, and photoelectric sensors. Hall-effectsensors detect a change in a polarity of a magnetic field. Variable reluctance sensors typicallyinclude a U-type core and coils wound around the core legs. Inductive proximity sensors have alossy resonant circuit (oscillator) at the input side whose loss resistance can be changed by theproximity of an electrically conductive medium.The VCNL4010 is a fully integrated proximity and ambient light sensor. Fully integrated meansthat the infrared emitteris included in the package. It has 16 bit resolution and it includes asignal processing IC and features standard I2Ccommunication interface. It features an interruptfunction. This IC sensor has a built-in infrared emitter and photo-pin-diode for proximityfunction. Its 16 bit effective resolution for proximity detection range ensures excellent cross talkimmunity .The programmable LED drive current is from 10 mA to 200 mA in steps of 10 mA .Ithas excellent ambient light suppression by modulating the infrared signal .The maximumProximity distance of this sensor is up to 200 mm. It has 100 Hz and 120 Hz flicker noiserejection. This sensor has excellent temperature compensation, robust refresh rate setting withoutany external RC low-pass filter. Connected with an infrared LED (IR-LED), the built-inproximity sensor can reveal the closeness of approaching/departing objects. This device isintended primarily for use in applications in which measurement of ambient light and proximitysensing is a necessary, such as laptop computers, PDA, camcorders, mobile phone, smart phonesetc... The sensor contains an eight 8-bit registers accessed via the I2C bus. All operations can becontrolled by the command register. The sample command structure makes the user easy toprogram the operation setting and latch the light data from the sensor. The block diagram of thesensor is shown below in figure1.The interfacing of the proximity sensor and signal conditioningis shown in figure2. below.12
  13. 13. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.com13
  14. 14. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comThe interfacing is done using two wired I2C technique. the SCL and SDA signals are connectedto the port1.0 and port 1.1 pins of the microcontroller. After detecting the object the sensor sendsan interrupt signal to the microcontroller. Since the Sensor is a digital IC ,its output is in digitalform .So, no ADC is required and the output voltage can be directly given to the microcontroller.Interfacing of Flow Sensor:A flow sensor is a device for sensing the rate or quantity of fluid flow whether it be a gas, steam ,liquid or solid .Flow sensor configurations are available for use in liquids or gases with flowrates from ultra low flow sensing to fast transient flow sensors . The flow rate is determineddirectly by measuring the liquids velocity or the change in kinetic energy. Velocity depends onthe pressure differential that is forcing the liquid through a pipe . Because the pipes cross-sectional area is known and remains constant ,the average velocity is an indication of the flowrate. Flow sensors are sometimes related to sensors called velocimeters that measure speed offluids flowing through them, these use units like ft/sec . A very basic relationship fordetermining the fluids flow rate in such cases is Q= VXA where Q is the liquid flow throughthe pipe ; V = average velocity of the flow; A = cross-sectional area of the pipe.There are three basic types of flow sensors and flow meters. Mass flow sensors measure flowrate in terms of the mass of the fluid substance , Volumetric flow sensors measure flow rate interms of how much of the material is flowing, Velocity flow sensors measure flow rate as interms of how fast the material is moving.An effective way to measure the flow rate through a pipe is to place some type of restrictionwithin the pipe and to measure the pressure difference between the low velocity, high-pressureupstream section, and the high-velocity, low-pressure downstream section. One common methodis the use of an orifice plate as shown below.The volumetric flow rate (Q) is given by14
  15. 15. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comWhereA1 = Area of pipe upstream from restrictionA2 = Flow area of pipe at restrictionp1 = pressure upstream from restrictionp2 = pressure at restrictionρ = density of fluidC = correction factor for energy lossesThe differential pressure sensorsThe SDPx108 series sensors are a high-performance sensors , specially designed for air flowmeasurements.The SDPx108 sensor provides an analog output signal with a range of 0-4 V andis fully calibrated and temperature compensated. In addition, it has a high resolution.TheSDPx108 sensor series achieves outstanding sensitivity and accuracy even at extremely lowdifferential pressures and exhibits very high stability and has zero point drift. Furthermore, theSDPx108 series offers square-root output characteristics for a wider dynamic measurementrange. The faster response time - compared to the SDP1000 series - makes the differentialpressure sensor a perfect alternative for respiratory devices and time-critical process automationapplications. The simple differential pressure sensor used to measure flow rate is shown below.It is a 3-pin CMOS IC, whose output is at the pin 3. It has internal temperature compensation, onchip ADC and on chip DAC .15
  16. 16. Dr.Y.NARASIMHA MURTHY Ph.D yayavaram@yahoo.comInterfacing Circuit: The output of the sensor is applied to the ADC0809 and this digital outputis given to the ports of the Microcontroller .The analog output of the sensor is applied to channel 0 (IN0) of the ADC and the output of theADC is given to the Port1 of the microcontroller as shown in the diagram. a 2X16 LCD moduleis interfaced to the microcontroller to display the flow rate.16