Transcription

ADC121S101,ADC161S626Liquid-Level Monitoring Using a Pressure SensorLiterature Number: SNAA127

SIGNAL PATH designer Tips, tricks, and techniques from the analog signal-path expertsNo. 115— By Amy Le, Applications EngineerLiquid-level monitoring plays an important role in today’s automotive,oil, water, pressure, and gas industries, to name a few. For example,pumping oil into a storage tank requires liquid-level monitoring toprevent spillage. Draining liquid out of a silo into bottles also requires liquidlevel monitoring for volume control.This article will explain how to automate a liquid monitoring system usinga pressure sensor. Since obtaining the pressure is just one vital piece of theinformation, how to convert the sensor’s output voltage into the liquid’sheight using an analog-to-digital converter (ADC) will also be explained.Details of the pressure sensor, ADC connections, system calibration andcalculations, as well as an example application, are available to guide designersthrough the development phase.V BRRTrapped Air in TubeHeight of the Liquid in ContainerEssentially, the pressure sensor is a Wheatstone Bridge(Figure 1). Changes to the pressure on the bridge are analogousto the changes in the value of the bridge’s resistors, R.Pressure SensorTubeLevel-Sensing TheoryThe height of liquid in a container can be measured using apressure sensor. Placed at the top of the container, the pressuresensor is connected to an open-ended tube that is submergedin the container. The amount of water in the container exertsa proportional amount of pressure on the sensor via the trappedair in the tube. At its output, the sensor produces a pressureequivalent voltage.ContainerDesign Made Easy .5RFeature Article . 1-4Liquid-Level Monitoring Usinga Pressure SensorVSENSE V SENSE -RRFigure 2. ContainerFigure 1. Bridge Sensor

SIGNAL PATH designerLiquid-Level Monitoring Using a Pressure SensorHardwarePressure SensorThe differential sensor used in the example application is GE NovaSensor’s NPC-1210 series. TheNPC-1210 has a typical Full Scale Output (FSO) of50 mV for 10 inches of water. That is, 10 inchesof water in the container corresponds to a typicalsensor’s differential output voltage of 50 mV. Thislinear relationship is useful information for calculating the liquid’s height and determining theappropriate ADC and amplifier for the system.This particular sensor was selected due to its lowsensitivity characteristic, which means its outputwill be in the millivolts range. Since the exampleapplication has a small amount of liquid volume(approximately 540 inches3), a sensitive pressuresensor is adequate. It is important to select the pressure sensor appropriate for a given application.National Semiconductor’s Sensor WEBENCH online design tool (national.com/appinfo/webench/sensorpath.html) can help customers in choosingthe appropriate sensor based on input range anddesired accuracy.Sensor Reference BoardNational’s newest sensor reference boards (OrderNo: SP1202S01RB and SP1602S02RB) are idealsensor interface developments for liquid-level monitoring systems. The SP1202S01RB sensor referenceboard has a differential to single-ended configurationusing an instrumentation amplifier connected to asingle-ended, 12-bit, single-channel ADC121S101converter. The latter board also has an instrumentation amplifier but uses a differential, 16-bit, singlechannel ADC161S626 device in a single-endedfashion.Both boards serve the similar function of amplifyingthe sensor’s output voltage and converting it to anoutput code. However, because the resolution for theSP1602S02RB sensor reference board is higher dueto the 16-bit ADC, it is more sensitive to changesin the liquid’s level than the SP1202S01RB sensorreference board.2Both configurations contain the gain stage to amplifythe millivolts sensor output to the reasonable 0V to4.1V ADC operating range. The output code of theADC is read by a microcontroller via SPI and is uploaded to a PC to be analyzed. An example blockdiagram of the differential to single-ended signalpath can be seen in Figure 3.PressurePressureSensorVSENSE VSENSE - -VOUT AMPADC121S101D OUTV IN ADCInstrumentationAmplifierFigure 3. SP1202S01RB SensorReference Board Block DiagramPressure Sensor CalibrationFinding the linear relationship between the sensor’soutput voltage and height of the liquid requirescalibrating the particular system. The NPC-1210sensor datasheet states that a typical relationship is50 mV to 10 inches of liquid. By pouring in the container ‘x’ inches of liquid and then measuring thesensor’s differential output voltage ‘ y’, where y is[(Vsense ) - (Vsense- )], the sensor can be calibrated. VSENSOR OUT (VSENSE ) – (VSENSE-)(1) VSENSOR OUT y x (Height)x(2)( (This linear relationship can be used to find thesensor’s differential output voltage, VSENSOR OUT, ata new height as seen in Equation 2.The Liquid’s Height CalculationAs shown in Figure 3, the liquid-level monitoringsignal path has three stages. For that reason, calculating the liquid’s height in terms of the ADC andamplifier requires several processes. The first step isfinding the gain of the amplifier and multiplyingthis gain with the sensor’s output voltage, VSENSOR OUT, to obtain the ADC input voltage,VIN ADC.VIN ADC VOUT AMP ( VSENSOR OUT) x (Gain)(3)

SIGNAL PATH designerFinding the gain of any amplifier stage can becumbersome. For simplification, an example calculation for the instrumentation amplifier (Figure 4)used in the example application can be seen in aseries of equations (4a – 4e). These calculations usesuperposition and simple op amp equations toderive the ADC input, VIN ADC, and gain of theinstrumentation amplifier stage. To obtain a goodcommon-mode rejection, RF1 should be equal toRF2; RA1 should be equal to RA2; and RB1 shouldbe equal to RB2.RB1VSENSE IN ADCDOUT SE ( 5a )( VV ( x (2 )nIN ADC( 5b )REFFinally, the output code is converted to the liquid’sheight using Equation 6a for a differential ADC or6b for a single-ended ADC. These equations arederived from Equation 2 but differ from Equation 2because VSENSOR OUT is now written in terms of theADC and amplifier gain.[ x [ ( 1 ( [ (DHeightDIFF y x Gain xV1 (V (DOUT DIFF 2 x V x (2n)REFOUT DIFF)x (2 x VREF)(2n)[( 6a )RA1 RF1RG1RF2[ x [ ( 1 ( [ (DVOUT AMP VIN ADCV 2 RA2Height SE y x Gain xOUT SE )x (V REF )(2 n)[( 6b )VX RB2VSENSE -Figure 4. Instrumentation Amplifier(V1 ( VSENSE ) 1 V2 ( VSENSE ) RF1 ( VSENSE- ) -RF1RG1RG1(( -RFRG ( ( V( (2SENSE-) 1 RF2(1VX RG1( 4a )(( 4b )( RBRB RA ( ( V )2( 4c )222[[RB1VIN ADC VOUT AMP VX RB1 RA1 - V1 RA1VGain V IN ADCSENSOR OUT( RA (( 4d )1( 4e )Next, simple differential (DIFF) and single-ended(SE) ADC formulas can be used to find the ADCoutput code, DOUT. The appropriate equation ischosen based on the type of ADC used in a givensystem. In both configurations, VREF is the ADCreference voltage and n is the ADC-bit resolution.Example ApplicationAn example application is illustrated in Figure 7 inwhich a container full of water is measured usingthe NPC-1210 pressure sensor. Water is continuously drained out of the container into an externalwater tub that contains an electrical pump. Whenthe water level is low, the electrical pump turns onand pumps water back into the tube. When the waterlevel reaches a predetermined point near the top, thepump turns off and awaits the lower trip point toturn on again as water is drained out of the tube.This cycle repeats until the power is turned off.To create this continuous fluctuation of water level,a comparator with hysteresis (Figure 5), an inverter,and a relay switch are added to the previously mentioned hardware connections. The ADC’s input iscompared to the reference voltage of the comparator,VREF COMP (not to be confused with the referencevoltage of the ADC). If VIN ADC is greater thanR2VIN ADCR1V REF COMP -VOUT COMPFigure 5. Comparator with Hysteresissignalpath.national.com/designer3

SIGNAL PATH designerV OUT COMPLiquid-Level Monitoring Using a Pressure SensorPumpOffPumpOn0The comparator’s output is connected to twopowered FETs acting as a buffer. Although theinverter is not necessary, the FETs’ main purposeis providing sufficient current to turn on the relay.Having one pin connected to AC power and theother unconnected, the relay switches between apump-to-power connection and a pump-to-groundconnection.VIN ADCVIN1The application is a good demonstration for liquidlevel monitoring systems that require a safetymechanism. Without depending on software, thishardware connection can turn off the pump whenthe water approaches the overflow point. The example application also illustrates the usefulness ofthe sensor reference board. Its complete signal pathdesign makes enhancing any sensor applicationssignificantly more convenient.VIN2Figure 6. HysteresisVREF COMP, then the comparator’s output is high;otherwise, it’s low. As shown in Figure 6, hysteresisis added to the comparator to create two switchingthresholds at VIN1 and VIN2. These switching thresholds represent the positions when the pump turnson and off.ConclusionLiquid-level monitoring systems require the use ofpressure sensors to measure the pressure, and thusthe height, of the liquid. Since the sensor’s outputvoltage is meaningless to the average users, an ADCis needed to convert the analog voltage to a digitallanguage in which a computer’s software can mathematically compute the height of the liquid. Thissignal path design is encapsulated in National’ssensor reference boards. As illustrated in the exampleapplication, the SP1202S01RB sensor referenceboard is ideal for many pressure-sensor applications.Equations 7a and 7b show how these thresholds canbe easily adjusted by changing the comparator’s resistors R1 and R2. It is up to the designer to pick a comfortable reference voltage, VREF COMP, and availableresistor values to get the desired threshold voltages.V IN1 V IN2 [(V REF COMP) (R 1 R 2)] - [V CC R 1](7a)R2[(V REF COMP) x (R 1 R 2)](7b)R2Pressure SensorSP1202S01RB Sensor Reference BoardV SENSE VSENSE - 121S101 5V5VLiquid Monitoring Board10 kOhm10 kOhmR2R1PumpVREF COMP -BS270AC LineLMV762RelayTub of WaterFigure 7. Liquid Monitoring System4Unconnected

2008, National Semiconductor Corporation. National Semiconductor, , and PowerWise are registered trademarks. All rights reserved.national.com/easyDiscover a wealth ofdesign resourcesFind the perfect mix ofproducts for your designDesign, build andvalidate a solutionExplore “how to” videos,online courses, articles,and the latest designtechnologies.Use National’s online productcatalog, downloadablecollateral, and featured onlinesites to compare and selectproducts.Speed time-to-market withthe new WEBENCH SensorDesigner and enhancedWEBENCH Power Designer.

Design ToolsWEBENCH Signal Path Designer ToolsDesign, simulate, and optimize amplifier circuits in this FREE onlinedesign and prototyping environment allowing you to: Synthesize an anti-alias filter Select the best amplifier/ADC combo for your system specs Make trade-offs based on SNR, SFDR, supply voltage Simulate real-world operating conditions using SPICE Receive samples in 24 hourswebench.national.comWaveVision 4.1 Evaluation BoardTest and evaluate A/D converters with National’s easy-to useWaveVision 4.1 evaluation board. Each evaluation board comescomplete with USB cable and support software.Features and benefits: Plug-n-play ADC evaluation board USB 2.0 interface to PC PC-based data capture Easy data capture and evaluation Highlighted harmonic and SFDR frequencies Easy waveform examination Produces and displays FFT plots Dynamic performance parameter readout with FFT Produces and displays histogramsNational Semiconductor2900 Semiconductor DriveSanta Clara, CA 950511 800 272 9959Mailing address:PO Box 58090Santa Clara, CA 95052Visit our website at:www.national.comFor more information,send email to:[email protected]’t miss a single issue!Subscribe now to receive email alertsswhen new issues ofSignal Path Designer are available:signalpath.national.com/designerAlso, be sure to check out ourt:Power Designer! View online today at:power.national.com/designer 2008, National Semiconductor Corporation. National Semiconductor, , WEBENCH, and Signal Path Designer are registered trademarks of National Semiconductor.All other brand or product names are trademarks or registered trademarks of their respective holders. All rights reserved.550263-019

IMPORTANT NOTICETexas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements,and other changes to its products and services at any time and to discontinue any product or service without notice. Customers shouldobtain the latest relevant information before placing orders and should verify that such information is current and complete. All products aresold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standardwarranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except wheremandated by government requirements, testing of all parameters of each product is not necessarily performed.TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products andapplications using TI components. To minimize the risks associated with customer products and applications, customers should provideadequate design and operating safeguards.TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right,or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Informationpublished by TI regarding third-party products or services does not constitute a license from TI to use such products or services or awarranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectualproperty of the third party, or a license from TI under the patents or other intellectual property of TI.Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompaniedby all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptivebusiness practice. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additionalrestrictions.Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids allexpress and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is notresponsible or liable for any such statements.TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would reasonablybe expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifically governingsuch use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, andacknowledge and agree that they are solely responsible for all legal, regulatory and safety-related requirements concerning their productsand any use of TI products in such safety-critical applications, notwithstanding any applications-related information or support that may beprovided by TI. Further, Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products insuch safety-critical applications.TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products arespecifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet militaryspecifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely atthe Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products aredesignated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-designatedproducts in automotive applications, TI will not be responsible for any failure to meet such requirements.Following are URLs where you can obtain information on other Texas Instruments products and application oCommunications and Telecom mComputers and Peripheralswww.ti.com/computersData Convertersdataconverter.ti.comConsumer Electronicswww.ti.com/consumer-appsDLP Productswww.dlp.comEnergy and w.ti.com/industrialClocks and Logiclogic.ti.comSpace, Avionics and Defensewww.ti.com/space-avionics-defensePower Mgmtpower.ti.comTransportation and Automotive er.ti.comVideo and ImagingRFIDwww.ti-rfid.comOMAP Mobile Processorswww.ti.com/omapWireless Connectivitywww.ti.com/wirelessconnectivityTI E2E Community Home Pagewww.ti.com/videoe2e.ti.comMailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265Copyright 2011, Texas Instruments Incorporated

pressure sensors to measure the pressure, and thus the height, of the liquid. Since the sensor’s output voltage is meaningless to the average users, an ADC is needed to convert the analog voltage to a digital language in which a computer’s software ca