Thermistors And A Microcontroller Simplify Anemometer Design

Oct. 14, 2002
Typically, air flow is measured with a hot-wire anemometer. Here's an alternative version of that concept using two thin-film platinum resistance temperature detectors. A high-performance mixed-signal microcontroller can make the measurement and drive...

Typically, air flow is measured with a hot-wire anemometer. Here's an alternative version of that concept using two thin-film platinum resistance temperature detectors. A high-performance mixed-signal microcontroller can make the measurement and drive a display, reducing component count and system cost.

Air flow is detected by the cooling effect of air movement across a heated resistor (see the figure). The RTDs, R5 and R7, are essentially thermistors with a very linear temperature response. T6 and R7 make up the flow sensor. The bias on R7 is intentionally set below the bias on R5. R6 and R7 are thermally linked such that when R7 is heated by R6, R7's resistance increases.

As R7 increases, so does the voltage across it until it matches the voltage across R6. At that time, the output of the on-chip op amp (OPA) rises above the reference voltage of the comparator. Then the comparator shuts down the pulse switch-mode controller (PSMC), which stops heating R6. As moving air cools R6, more power is required to heat the R6-R7 pair to maintain the same R7 resistance and voltage.

Two voltage dividers, R2/R5 and R1/R7, compensate for changes in ambient temperature. R2 and R5 form a voltage divider between the OPA's output and its inverting input. Similarly, R1 and R7 form a voltage divider between the variable digital-to-analog converter (DAC) reference and the OPA's noninverting input. Because R5 and R7 are identical RTDs, resistance variations due to self heating and changes in ambient conditions cancel out at the OPA's inputs.

R6's heating is controlled by a closed loop consisting of the OPA, the comparator, the PSMC, and R6 driver Q1. When moving air cools R6, R7's resistance drops, the OPA's output voltage goes below VR, and the comparator output rises high. This enables the PSMC to deliver output pulses to drive Q1 and apply additional power to R6, producing more heat.

The PSMC is configured for pulse skipping so that at equilibrium, only as many pulses are generated as needed to keep R7 at the proper temperature and resistance to match the voltage across R5. The DAC output is used to adjust the equilibrium point in still air by adjusting the bias on R7. At high bias levels, less heat is required by R6 to reach the equilibrium resistance level. Low heating in still air means that there's sufficient headroom in the potential drive output, but it also means less variation due to cooling and low sensitivity. At low bias levels, R7 requires more heat. Greater heat causes greater cooling effects, resulting in higher sensitivity.

There's a limit to the drive available to R6, so if the bias level is low enough, the equilibrium resistance and voltage can't be obtained. In other words, at low bias levels, there's better sensitivity but less headroom in potential heating drive. It was determined empirically that a good bias point is obtained when the OPA output is 100 mV below VR when R6 heating is inhibited.

The power delivered to R6 is proportional to the cooling effect of moving air. Power is measured by counting the average time that the R6 driver is enabled. The PIC16C781 microcontroller has an integral Timer1 count-enable input (Timer1 gate). By connecting the PSMC output to the Timer1 gate input, Timer1 will count only when the PSMC output is low. Average PSMC drive time is determined by clearing Timer1, using Timer0 to wait a fixed period, then reading Timer1 at the end of that period. Because the gate is a low-true, higher gate counts indicate that less power is being delivered to R6.

A 10-segment light-emitting diode (LED) bar graph displays relative air flow. The figure shows how to drive 10 segments with five outputs, with each output tied to two segments. When the output is high, one LED is driven, but when it's low, the other LED is driven. Neither LED is driven when the output is high impedance.

The DAC integral to the PIC 16C781 enables automatic zeroing of the R7 bias current. The first task after power-on initialization is to calibrate OPA's offset via the microcontroller's built-in calibration utility. After calibration, the DAC is set initially for about a 3-V output. The RTD temperatures are allowed to settle for 6 seconds. After that, the average PSMC drive time is measured using Timer1 and the Timer1 gate input. If the measured value is within ±1 display resolution of the expected zero value, the zeroing routine is exited and measurement and display continue. If the measured value is outside of the expected window, the DAC is adjusted up or down to compensate for the offset. After the 6-second settling time, another measurement is taken. This process repeats until the desired R7 bias level is obtained.

Sponsored Recommendations


To join the conversation, and become an exclusive member of Electronic Design, create an account today!