Reading Pulse Output Sensors with dataTaker DT8x Data Loggers

Using the Versatile dataTaker Family of Intelligent Data Loggers

CHESTERLAND OH—October 20, 2011

Users often run into applications that require data logging from sensors that provide a pulse output. Common types of these pulse output sensors include flow meters, speed sensors, electrical power meters and switches for event counting. These applications may require the measurement of a rate, for example gallons/minute or RPM, or they may require totalizing the pulse count to determine flow volume, distance traveled or kWHr used.

The dataTaker DT8x family of data loggers is extremely flexible and they allow the measurement of pulse output sensors using several different methods–however it is not always obvious which method should be used or which might provide the best results. This tech note is intended to provide some background on commonly used techniques to capture data from these sensors. When choosing which to use, it is essential to know the electrical characteristics of the output pulses that are coming from the sensor. There are 4 common output types:

AC voltage output devices: These are not true pulse output sensors, but they are commonly found in anemometers and magnetic pickups. The signal output is a sine wave that varies in frequency and amplitude based on speed. In some cases, the voltage output can be over 20 VAC p-p.

Dry contact devices: This is really just a fancy name for a simple switch. Often these devices consist of a reed switch that is periodically closed by a magnet passing by. This sensor needs an external voltage source to be able to generate a signal that can be measured by the data logger.

Open collector output devices: These will have an NPN or PNP transistor as the output device. The emitter of the transistor is connected to ground and the collector provides the output. The sensor switches the transistor on and off to effectively create a series of open and closed connections to ground. This sensor will require the application of an external voltage source to create the pulse waveform.

Voltage output sensors: These sensors provide a true voltage pulse output. This pulse will typically conform to the TTL standard logic voltage levels; a low is defined as a voltage below 0.8V and a high is a voltage above 2.0V. The output of these sensors can be fed directly into a digital input or counter circuit of the appropriate type.

When it comes to the actual measurement, there are three ways to measure a pulse output sensor with dataTaker DT8x data loggers, including frequency measurement using an analog channel, a low speed counter using a digital channel, and high speed counter channels. Each of these has certain advantages and disadvantages that make them more or less suitable for a particular sensor type.

Regarding frequency measurement, any of the analog input channels of the data logger can be used to measure the frequency of a repetitive pulse train. Internally, the logger has a very accurate time base reference that is used to measure the time between 2 zero crossings of the input waveform. By taking the inverse of this time, the logger can calculate the frequency of the signal.

An advantage of using the frequency measurement is that it can accommodate signals up to 30V p-p. In this case, the appropriate voltage range can be specified using the gain lock, GLx, command. Also, the default settings allow measurement of a range of frequencies between 33 Hz and 20 kHz making this method suitable for fast pulses.

The main disadvantage of the frequency measurement method is that it relies on the voltage passing through 0.0V. This has 2 implications: In the case of a dry contact, open collector or voltage output sensor, if the voltage does not pass through 0.0, i.e. the sensor switches from 0.0 to +5.0 volts, the frequency measurement will not be reliable. It is possible to work around this by using the 2V channel option which will apply an offset voltage to the measurement circuit to switch the crossing point to +2.5V. Because the measurement relies on measuring the time between zero crossings, if the frequency of the pulses is very low, the data logger will time out and return “Underrange”. By default, the maximum time between zero crossings has to be less than 30 milliseconds. It is possible to increase the gate time by adding the sample period as a channel option. For example: 2F(1000) will measure the frequency on channel 2 with a sample period of 1 second to allow the measurement of signals down to 1 Hz. However, the data logger will be unable to process other commands during this time so this technique is not really suitable for sensors that output pulses slower than a few times a second.

Additionally, any of the digital inputs 1D-8D (4D in the case of the DT82) can be used as a low speed counters. Be aware that the first 4 digital inputs 1D-4D (or 3 inputs 1D-3D in the case of the DT82x) are electrically different from the other digital inputs. The first 4 (3) inputs have a weak pull-up resistor to the internal 3.3V digital power supply. This makes them especially suitable for use with sensors that have a dry contact or NPN open collector. The pull-up resistor will cause the digital input to go to a high voltage when the switch is open or the output transistor is off, and will allow the input to go to 0.0V when the switch is closed or the output transistor is turned on. These channels are also compatible with sensors with a TTL output.

The other digital inputs have a weak pull-down resistor to ground. These inputs are well suited to the measurement of sensors that have a voltage output. In the absence of an input voltage, the digital input will be 0.0 V or low and the external voltage from the sensor will cause the input to go high and increment the count. If these are to be used with a dry contact or open collector sensor, an external voltage source will be required to be pull the input high to allow the data logger to count correctly.

As with the frequency measurement, there are several considerations when using the digital inputs as counters. The counters are actually implemented in software by scanning the digital inputs every 20 milliseconds to see if the state has changed. This means that the width of the pulse must be greater than 20 milliseconds or the logger may not detect the transition between scan times. The maximum measurable pulse frequency, assuming a 50% duty cycle, is about 25 Hz. Pulses of a higher frequency will not be properly counted. The channels are not scanned if the logger is asleep, so this method cannot be used to measure pulse counts over longer periods of time (the default is 30 seconds) when the logger is operating off battery or in a forced sleep mode and will go into sleep mode between samples.

All of the DT8x data loggers have 4 dedicated high speed hardware counter channels (8 in the case of the DT85 S3 models). These channels are capable of counting pulses as fast at 10 kHz. These channels are similar to digital channels 1-4 in that they incorporate a weak pull-up resistor that allows them to be used with dry contact or open collector output sensors as well as TTL output sensors. In addition, channels 1 and 2 have the ability to measure low level signals from very low voltage output sensors, such as those with an inductive pickup, using the low threshold (LT) option. This sets the off/on threshold at <2 mV and >7 mV respectively.

The hardware counters will function if the logger is asleep, allowing them to be used over longer sampling intervals; however, the maximum count is limited by the width of the counter registers to 65536 counts. If more pulses than this occur within the sample interval or if the count is allowed to accumulate over a long period of time, it will overflow and start back at 0. Also, when used with a dry contact (voltage free) input where the input is not actively driven to high state but rather is forced to a high by the internal pull-up resistor, the inputs are effectively filtered to eliminate the effects of contact bounce from mechanical switches. This limits the maximum count rate to about 500 Hz when used with a voltage free input.

With all of this in mind, let’s consider a common application of a water flow meter. A common turbine flow meter has a simple dry contact output that is triggered when a magnet embedded in one of the turbine blades passes by a reed switch. For this meter a flow of 200 gallons per minute (GPM) produces an output frequency of 168 Hz. For this application, it is necessary to record the flow every 10 seconds.

Since this sensor has a simple switch output and the pulse frequency is in the range of 100-200Hz, it is easiest to wire it to one of the high speed counter inputs so let’s use counter 1.
In deTransfer the program would be:

BEGIN”JOB1″
CATTN
‘Spans and polynomial declarations
S1=0,200,0,1680″GPM”
‘Global declarations
RS1S
‘schedule definition
RA(“B:”,ALARMS:OV:100KB,DATA:OV:1MB)10S LOGONA GA
1HSC(R,S1,”Flow”)
END

Here, we have configured the scaling to take into account the 10 second sample interval by multiplying the sensor output by the interval, i.e. 200 GPM will produce 168 Hz x 10 seconds = 1680 pulses. Also we have used the R option in the counter command to reset the count back 0 after the reading the count.

The set-up in Delogger would be:

Note the resetting option has been enabled to reset the counter to 0 after each reading. It is not apparent, but the scaling has been adjusted per the previous example.

The set-up in dEX would look like:

Note that the scaling has been adjusted as before. Not apparent in this example is that the R option has been enabled for this counter to reset the count to 0 after the measurement is made.

Check out the bestselling dataTaker DT8x family of dataloggers here.

For further information on the highly successful dataTaker DT8x data loggers, other dataTaker dataloggers, or to find the ideal solution for your application-specific needs, contact a CAS Data Logger Applications Specialist at (800) 956-4437 or visit the website at www.DataLoggerInc.com.

Contact Information:
CAS DataLoggers, Inc.
12628 Chillicothe Road
Chesterland, Ohio 44026
(440) 729-2570
(800) 956-4437
sales@dataloggerinc.com
http://www.dataloggerinc.com

Facebooktwittergoogle_plusredditpinterestlinkedinmail