Accurate, cost-effective, ultrasonic flow meters key a transformation in liquid and gas flow measurement. Critical for revenue collection, leak detection and conservation of critical natural resources, flow meters lie at the heart of utility and industrial distribution systems of water, gas and heat. Mechanical flow meters, currently the most prevalent meter style, use moving parts to measure the velocity of a fluid in a pipe. These moving parts are subject to wear and lose accuracy over time, often requiring replacement within 10 years.1 The MAXREFDES70# ultrasonic time-of-flight flow meter by Maxim Integrated sends and receives ultrasound waves between piezoelectric transducers in both the upstream and downstream directions in the pipe. By measuring the TOF difference between the upstream and downstream wave travels, utilizing sophisticated digital signal processing techniques, a very accurate flow rate can be calculated.
The MAX35101 is the center of the heat/flow meter system. The MAX35101 integrates all the functions required for automatic TOF measurements, including the ultrasound pulse launching and detecting, TOF calculation, temperature measurement, and a real-time clock (RTC). The MAX35101 can work in various configurable automatic event timing modes, requiring very minimal interactivity from a host microcontroller, thus reducing the total power consumption of the system.
The MAXREFDES70# reference design (Figure 1) demonstrates the typical application of the MAX35101 TOF converter. Please note, the meter is not calibrated and only serves as a high-performance platform for developing customized heat/flow meters. Contact the manufacturer for calibration details.
Figure 1. The MAXREFDES70# reference design block diagram.
The MAXREFDES70# heat/flow meter is based upon the time-of-flight or transit-time measurement principle as shown in Figure 2. The system utilizes two piezoelectric transducers, which function as both ultrasound wave transmitters and receivers.
Figure 2. MAXREFDES70# reference design flow velocity calculation.
The heat/flow meter alternatively transmits and receives ultrasound waves between the two transducers. The ultrasound pulses are first transmitted in the direction of the fluid flow (downstream) and then against the fluid flow (upstream).
The ultrasound pulses move faster downstream than upstream, the TOF difference between the downstream and upstream is proportional to the flow velocity. The larger the TOF difference, the faster the fluid flows. When the fluid stops flowing, the TOF difference is 0, ideally. The MAX35101’s sophisticated digital processing circuits, precise analog front-end circuits, and automatic calculation algorithms make the ultrasonic TOF measurement highly accurate and reliable. Refer to the MAX35101 IC datasheet for details.
The MAXREFDES70# reference design uses a DN20 spool body from Audiowell Electronics Co., Ltd. The spool body dimensions are shown in Figure 2. Other types of spool bodies work for different flow velocity and volumetric flow rate requirements.
The basics of flow rate calculation work as follows. Assume the speed of a sound wave in the fluid at a specific temperature is C0, the downstream TOF TA > B is given by:
where D is the diameter of the spool body pipe, L is the length from reflection mirror A to reflection mirror B, v is the flow velocity.
The upstream TOF TB > A is given by:
Take the TOF difference of the upstream and downstream:
ΔT × (C0² - v²) = 2 × L × v
Because the flow velocity is orders of magnitude slower than the sound speed in liquids, we can ignore the v² item in the above equation. The flow velocity v is then given by:
v = (ΔT × C0²)/(2 × L)
The simple volumetric flow rate is given by:
q = v × A
where A is the crosssection area of the spool body pipe.
Because the flow rate and the temperature of the fluid continuously change, the heat/flow meter calculates the flow velocity and volumetric flow rate piecewise. The total volumetric flow is the integration of the piecewise volume:
where t is the time elapsed after the start of metering, which is denoted as time zero.
Attention must be paid to the real world volumetric flow rate calculation. The above volumetric flow rate q is the theoretical calculation. Because of the blocking effect of the two ultrasound signal reflection mirrors in the pipe, flow differences at the pipe’s surface, effects of laminar and turbulent flow, and the manufacturing discrepancies of each spool body, the calculated volumetric flow rate must be calibrated against an accurate reference flow rate to get the real-world flow rate. This is done by taking data points for multiple flow rates, and storing the gain factors for each calculated flow rate in a lookup table. After each piecewise flow rate is calculated, in the lookup table, use the interpolation method to find the corresponding gain factor and adjust the calculated flow rate to get the real world flow rate. The MAXREFDES70# firmware implements this gain factor correction as an example.
After a gain factor-corrected piecewise volumetric flow rate is available, the water mass flow rate at a specific temperature is given by:
m = q × ρ
where ρ is the water density at a specific temperature.
Known inlet (hot) and outlet (cold) temperatures, the energy flow rate is given by:
e = m × (Hhot - Hcold)
where Hhot, Hcold are the enthalpies of water at the pipe inlet and outlet temperatures. Usually, Hhot - Hcold is denoted as ΔH.
Same as the volumetric flow, the heat/flow meter calculates the energy flow (either heating or cooling) rate piecewise. The total energy flow is the integration of the piecewise energy:
The MAXREFDES70# reference design system block diagram is shown in Figure 1.
The meter needs to be activated before use. First, press and release the button on the meter cover (SW2 button) to turn on the LCD display. Then, press and hold the button for more than 10s to activate the meter. This operation is required only one time.
MAX35101 Time-to-Digital Converter with Analog Front-End
The MAX35101 lies at the center of the system, a time-to-digital converter with built-in amplifier and comparator, is built as a complete analog front-end solution for the ultrasonic heat meter and flow meter markets.
With automatic differential TOF measurement, this device simplifies computation of liquid flow. Early edge detection ensures measurements are made with consistent wave patterns to greatly improve accuracy and eliminate erroneous measurements. The built-in arithmetic logic unit provides TOF difference measurements. A programmable receiver hit accumulator can be utilized to minimize the host microprocessor access.
For temperature measurement, the MAX35101 supports up to four 2-wire PT1000/500 platinum resistive temperature detectors (RTD).
The MAX35101 offers an event timing mode that is configurable and runs cyclic algorithms to minimize microprocessor interactivity and increase battery life.
The real-time clock provides time-of-day monitoring and one programmable alarm and watchdog functionality.
A simple op-code based on a 4-wire SPI interface allows any microcontroller to effectively configure the device for its intended measurement.
On-board user flash allows the MAX35101 to be nonvolatile configurable and provides nonvolatile energy use data to be logged.
The heat/flow meter is controlled by the EFM32ZG110 energy-friendly, ARM Cortex-M0+ CPU, 32-bit microcontroller. The microcontroller runs at 14MHz internal clock and has 32KB internal flash.
The microcontroller communicates with the MAX35101 and the LCD module through the SPI interface and several GPIO pins. The MAX35101 is set to work in event timing mode, requiring very minimal interaction from the microcontroller, thus conserving battery life. The MAX35101 wakes up the microcontroller periodically with an interrupt request. The microcontroller does a very short data processing and usage logging step and then enters/re-enters into deep sleep mode.
User Interface: Control Button and Liquid Crystal Display (LCD)
Press and release the SW2 button to turn on the 3x16-character LCD. After the LCD is on, press and release the SW2 button to recursively display the following information menus:
Press and release the SW2 button to also access the following configuration menus:
When the information menus are displayed, press the button for more than 2s to turn off the LCD. If there is no operation on the button, the LCD stays on for 2 hours and then turns off.
When the configuration menus are displayed, press and release the SW2 button to change the register values. A long press (more than 2s) and release of the SW2 button sends the value to the MAX35101 register.
Because the LCD module draws very little power (normally less than 1mA) in display mode, the LCD module is powered directly by the microcontroller GPIO pins.
MAX4721 Analog Switch
The MAX4721 low-voltage, low-on-resistance (RON), dual single-pole/single-throw (SPST) analog switch is used to isolate the LCD module SPI interface when the LCD is powered off. The switch reduces the current leakage to the LCD module down to 5nA, thus conserving battery life.
Factory Real-Time Clock Setting
The MAXREFDES70# heat/flow meter firmware implements the MAX35101 RTC factory setting by using the SW2, SW3, and SW4 buttons. During factory production process, press SW2 and then press SW3. This will bring up the RTC clock setting menu and follow the menu instructions to set the RTC clock. Refer to the firmware for details.
Tamper Detection Operation
The MAX35101 provides a single-pin input that can be connected to a device case switch and used for tamper detection. Upon detection of a case switch event, the CSWA in the Control register and the CSWI bit in the Interrupt Status register are set and the INT device pin is asserted (if enabled). The SW1 tactile button on the circuit board is a normally closed tactile switch. A meter manufacturer can configure the SW1 switch to open position during production, e.g., pressing the SW1 switch using the meter case top cover. The firmware then monitors the CSW pin state for tamper detection.
The heat/flow meter firmware is based on an interrupt driven design model. After power-up, the microcontroller configures the GPIO pins, system clocks, LCD module, and sets the MAX35101 to a preconfigured event timing mode. Most of the time, the microcontroller is in the power-saving sleep mode, woken up only by the interrupt requests from the MAX35101 to do very quick data processing and usage logging.
The flowcharts of the two major firmware modules are shown in Figure 3 and Figure 4, respectively. These include the main function and interrupt service routine (ISR) modules.
Figure 3. MAXREFDES70# firmware main function flowchart.
Figure 4. MAXREFDES70# firmware interrupt service routine flowchart.
Follow the ensuing procedure to set up the MAXREFDES70# in a real metering environment.
Refer to the MAX35101 datasheet for register details.
The MAXREFDES70# design was verified and tested under typical application cases. Basically speaking, the MAX35101 is capable of measuring any water flow rates with the proper spool body dimensions and water pipe structure. The current spool body has a diameter of 20mm, a reflection mirror distance of 71.7mm. Based on the expected volumetric flow rates, other spool body sizes can be easily used and tested against good references.
Figure 5 shows the accuracy that can be achieved by the MAXREFDES70#. This accuracy plot was obtained by using a popular electromagnetic reference water meter to calibrate the MAXREFDES70#. The meter was set in the following condition for TOF measurement: TDF = 0.5s, TDM = 5 measurements. At very low flow rate, the electromagnetic water meter has a relative large error itself.
Figure 5. MAXREFDES70# flow rate comparison.
Figure 6 shows one typical RTD sensor test results. The MAXREFDES70# firmware uses the standard RTD1000 resistances as lookup table to calculate the RTD sensor temperature. The meter was set in the following condition for temperature measurement: TMF = 1s, TMM = 5 measurements. For more accurate temperature measurement, each RTD sensor must be calibrated against the standard RTD1000 resistances.
Figure 6. MAXREFDES70# temperature test.
The temperature difference between the hot RTD sensor and the cold RTD sensor is used to calculate the energy consumption. It is important to use matched RTD pairs for one meter. The accuacy of the temperature difference is captured by putting the two sensors in the same temperature environment, and reading the temperature difference of the two RTDs. Figure 7 shows typical meter temperature diference test results.
Figure 7. MAXREFDES70# temperature difference test.