Range, Depth and Displacement Sensors (App Note) | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


Free Shipping for U.S. Orders $150+   |   5-year Warranty   |   Try Our Devices & Support for 60 Days, Risk Free  |   51 of 54 Products In-Stock Now

Range, Depth and Displacement Sensors (App Note)

This is the start of an application note about range and depth sensors

Quick Summary:

Two basic types of sensors covered in this app note: hydrostatic and ultrasonic.

Hydrostatic sensors are best for measuring in the range of a few inches in depths of liquids or some powders.

Ultrasonic sensors are good at measurements in the range of several feet with a somewhat unobstructed path to the object in question. It is important to consider beam width and communication protocol that will work with your application when choosing an ultrasonic sensor, since manufacturers provide a variety of beam widths and protocols. 

Other sensors for measuring distance/displacement include infrared (e.g. Sharp), draw-wire, LVDT, capacitive, inductive, eddy-current, and laser.


The term LVDT is sometimes used for any displacement sensor, but in fact is a specific type of displacement sensor.  A true LVDT is a linear variable differential transformer, and a raw LVDT requires AC input excitation and provides an AC signal (AC-AC LVDT).

The AC excitation is difficult if not impossible to directly provide from a LabJack.  The AC signal is likely possible to read with a LabJack, but it depends on the details and is not simple.  What you really want is a DC-DC LVDT.  That could mean an LVDT with built-in electronics, or it could mean an external signal conditioner that works with a raw AC-AC LVDT to excite it and provide a simple DC output signal.  Note that a DC signal does not mean you can't do dynamic measurements, it just means that the movement signal is not riding on a carrier frequency.

Hydrostatic: eTape PN-6573P-12

The PN-6573P-12 eTape sensor is a solid state, continuous fluid level sensor for measuring levels in water, non-corrosive water based liquids and dry fluids (powders).  It is made by Milone Technologies and can be manufactured in custom lengths to fit any application.  It provides a varying resistance that is pretty easy to work with.

LabJack USB/Ethernet/Wifi Multifunction DAQ compatable fluid level sensor, Hydrostatic: eTape PN-6573P-12

The eTape was tested in a 250 ml graduated cylinder, and reported the depth of liquid readily after software calibration.  The immersed sensor and wiring is shown below.

LabJack USB/Ethernet/Wifi Multifunction DAQ compatable fluid level sensor, eTape in waterLabJack USB/Ethernet/Wifi Multifunction DAQ compatable fluid level sensor, eTape wiring

When using these sensors there are several options for wiring, the simplest of which is to use it in series with another resistor as a simple potentiometer.  See voltage divider section of the eTape datasheet for more details. The Python code used in gathering data can be downloaded below.


Ultrasonic Sensors:

In the range of 1 to 25 feet, these sensors are well suited for range/depth measurement.  They are commonly employed in robotics for obstacle detection, and are useful in many other applications.  They can provide the range information in a variety of data formats, such as PWM, Serial, I2C, or Analog output.  

LabJacks are capable of handling any of these data formats, but Analog and I2C are the only types discussed in this App Note.

When using ultrasonic type sensors it is important to consider the unobstructed path required for accurate distance measurement.  Sensor manufactures commonly report this path in terms of beam width because it is possible to measure distance in a smaller path by using a narrower beam width; although beam width on its own describes the angle of the sonar wave as it propagates toward an object.

In general a narrow beam width will have lower sensitivity than a wide beam width.

For more information on beam width, this is a helpful explanation from MaxBotix.



The LV-MaxSonar-EZ0 is a very easy to use ultrasonic sensor made by MaxBotix Inc.  It can be connected directly to any port on a LabJack configured for analog and report a voltage corresponding to a distance.

LabJack USB/Ethernet/Wifi Multifunction DAQ compatable ultrasonic range sensor, LV-MaxSonar-EZ0 by MaxBotix Inc.LabJack USB/Ethernet/Wifi Multifunction DAQ compatable ultrasonic range sensor, MaxBotix EZ0 out of the package

Connect the AN output of the EZ0 to any of the FIO ports on the LabJack U3 and measure range by converting the voltage to inches.  When 5V is connected the conversion is approximately .01 Volts/Inch.  The Python code used in testing the device can be downloaded below.


Devantech SRF02

The SRF02 is an ultrasonic sensor similar to the EZ0 but it only offers Serial, and I2C output.  It is shown below connected to a U3 via I2C.

LabJack USB/Ethernet/Wifi Multifunction DAQ compatable ultrasonic sensor, Devantech SRF02

When using I2C remember to pull SDA and SCL high through a resistor.  Usually something in the range of 1.8k to 4.7k will work, but SRF02 documentation stated that 1.8k are optimal.  Again, Python code used for testing can be downloaded below.  



LabJack USB/Ethernet/Wifi Multifunction DAQ compatable ultrasonic range and fluid level sensors

All 3 devices worked as intended, and reported measurements through a LabJack without issue.  When calibrating the eTape, keep in mind that it is a pressure sensitive sensor, and so any holding or touching along the measurement surface can disrupt measurements.  Similarly, when reading measurements from the ultrasonic sensors, bear in mind that small obstacles along the path can cause incorrect readings. 



Does  Continuous Fluid Level Sensor  PN-6573P use analog input ? 

Yes, the PN-6573P connects to an analog input and GND.  The simplest way to get a reading from the sensor is to connect a several kOhm resistor between VS and AIN0 then the PN-6573P between AIN0 and GND, forming a voltage divider.  Reference the PN-6573P Datasheet for a setup description and further details.

The link to the eTape datasheet is broken. Try http://www.milonetech.com.

The new version of eTape (8") has an additional temperature compensation resistor incorporated internally which you can use as the second resistor in the voltage divider or as Reference resistor in a wheatstone bridge circuit for greater accuracy

I have implemented the new eTape (12 " version) to measure evaporation from a large tank using a voltage divider configuration and a UE9 (ADC input using 5V from the UE9 as the supply voltage); In the MiloneTech data and application specification sheet the voltage divider has Rref (2250 Ohms) for temperature compensation at the top of the divider network connected to the supply voltage and Rsense (400 to 2250 Ohms) at the bottom of the divider connected to ground. I decided to exchange the resistor placement as I wanted the voltage at the junction of the two resistors (Vmeasured) to rise from 2.5 volts (when empty) to around 4.1 volts (when full).

In my application, I'm measuring evaporation, so the voltage output is 4.1 volts to start and decreases until 2.5 volts covering a span of 11 inches.

The calibration is relatively simple as:

                                                       Rsense/Rref = Vsupply/Vmeasured - 1 = A x evaporation + B

A 2 point calibration, full and empty yields the values for A and B.

I designed a stilling well for the sensor as the tape tends to curl up if not restricted and it must have both front and back of the tape in contact with the water (or other liquid). The stilling well also ensures that no surface disturbances (such as wind generated capillary waves) affect the sensor readings.

I found the resolution to match that as stated by the manufacturer.

Enjoy !

patricio reygadas's picture

We are planning to use the T7-Pro to measure temperatures (0 - 100 C) in water (2 points), and in ambient air (2 points); we will measure electric power (amperes in 1 to 3 phases AC motors and recirculating pump - 0 to 15 A /phase) also; and there will be a gaussmeter to measure magnetic flux density (0 to .5 T). We have to control the water temperature by start/stop in motor and pump. All the data is to be sent to a laptop which will be placed 20-25 ft away from the process.

Questions are: a) Can we do what we plan using T7-Pro? - b) Do you have and sell the necessary sensors/controls to measure (&control) temperatures (water, air), power (amperes) and MagFlux Density (T)? - c) In case you do not have any of the sensors, can you recommend which sensors / actuators will match your T7-Pro better?

Thanks very much. Looking forward to knowing from you soon.


Patricio Reygadas (EVUS INC. Santa Teresa, NM)

labjack support's picture

Yes, the T7-Pro is a likely solution.  USB is limited to about 15 ft per USB specifications, but Ethernet or WiFi are certainly fine at 25 ft.  For an overview of software options see the "Software Options" section on the T7 Quickstart:


temperatures (0 - 100 C) in water (2 points), and in ambient air (2 points):  Sounds like a silicon sensor such as the LM34 might be ideal for you:


electric power (amperes in 1 to 3 phases AC motors and recirculating pump - 0 to 15 A /phase):  No specific recommendations for this.  Ideally you will find sensors that give you a DC voltage value that corresponds to the RMS or True RMS of the AC current at any time.  The typical solution of a current transformer is much more difficult to handle as it gives you an AC waveform that you have to digitize and then do math on, but the T7 is capable of this.

gaussmeter to measure magnetic flux density (0 to .5 T):  No specific recommendations for this.  I suggest you find some sensors of interest and then email links to technical details to [email protected] so we can check them out.

start/stop in motor and pump:  The choices will depend on the voltage and current of these devices, but a likely option is to use LJTick-RelayDrivers to control solid state relays (SSRs):