Skip to main content
Skip table of contents

Range, Depth and Displacement Sensors (App Note)

This app note was written for the U3, but some details apply more broadly to other LabJack devices.

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.

LVDT

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.

eTape Sensor

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.

eTape Sensor Submerged

eTape Sensor Connectors

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.

LV-MaxSonar-EZ0

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.

LV-MaxSonar-EZ0 Ultrasonic Sensor (in box)

LV-MaxSonar-EZ0 Ultrasonic Sensor ( with spec sheet)

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.

SRF02 Ultrasonic Sensor

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.  

Conclusions

Ultrasonic and eTape Sensors Connected to a LabJack U3

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. 

Files

3Sensors_Code.zip

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.