Application Note Analog Voltage Output With MLX90614
Application Note Analog Voltage Output With MLX90614
Application Note Analog Voltage Output With MLX90614
Application Note
Analog voltage output with MLX90614
Scope
Analog output voltage is sometimes needed from sensors in a system. Current application note
describes how to implement that with the MLX90614 IR thermometer.
The IR thermometer MLX90614 can be configured in EEPROM for any of the following 3 types
of output:
PWM (push-pull or NMOS open drain)
SMBus (always a slave device on SMBus network)
Thermal relay (push-pull or NMOS open drain)
All these outputs provide measured temperature, linearized and ready to be used.
With the PWM option, the duty cycle of the continuous pulse train represents the measured
temperature. Passing this pulse train through a low-pass filter will result in the average value
that can be measured as an analog value. Some details of this option need to be taken into
account in order to get relevant results.
Major drawbacks of PWM-to-voltage conversion are:
Accuracy & resolution: it would be very expensive to reach the resolution and accuracy the
MLX90614 provides through the SMBus and PWM digital interface by means of an analog
measurements. It is likely that both accuracy and resolution will be significantly degraded in
most cases. The precise degree of that degradation is strongly application specific and can not
be generally predefined for all cases.
EMC: analog lines are much more susceptible to noise than digital communications.
Dependence on environmental conditions such as temperature, power supply variations or
humidity will be higher.
Therefore, conversion of MLX90614 measurements to an analog voltage output can hardly be
recommended as an approach in applications where accuracy and resolution are important.
Table of Contents
Scope...................................................................................................................................................................... 1
Other Components Needed...................................................................................................................................... 2
Typical Circuit........................................................................................................................................................ 2
MLX90614 PWM output format ............................................................................................................................. 3
PWM format in analog values ................................................................................................................................. 4
Configuration of MLX90614 for PWM-to-voltage conversion application ............................................................... 5
Considerations with analog output measurements .................................................................................................... 7
Input resistance ................................................................................................................................................... 7
Ripple ................................................................................................................................................................. 8
Reference............................................................................................................................................................ 8
Maximum PWM frequency ................................................................................................................................. 8
Output levels versus loading................................................................................................................................ 9
General considerations ........................................................................................................................................ 9
Conclusion.............................................................................................................................................................. 9
U2
1 3
R2 +Vref circuitry switching noise. The well known
+In
Vss PWM
value 100nF (SMD ceramic type) is typically
SCL/Vz
ADC
C2
U1
-In
-Vref
adequate for this component.
MLX90614
R2 and C2 form the LPF filter which
2
U2 is the voltage measurement unit. Shown is an ADC. Note that the reference voltage of that
unit is taken from the MLX90614 power supply voltage (Vdd, pin 4). The averaged output
voltage depends on the Vout,high of the MLX90614 (pin 3, PWM output). The PWM output of
the MLX90614 is CMOS (configured as push-pull in this case), so the high output level is
virtually equal to the Vdd in case of light loading. Therefore, a 5% tolerance of the Vdd will
directly degrade the average voltage measured by 5%.
PWM output of MLX90614 can be configured in two modes – single data transmission and dual
data transmission. For the average value to be useful the single PWM output format is required.
It has the timings shown below:
Where T is the PWM period, t1 is starting buffer (always high, with a duration which is always
12.5% of the period), t2 is the data band, taking an additional 0…50% of the period. t3 is the
error signaling band (25% of the period). In normal operation the t3 should be zero as well as the
rest of the period.
The temperature reading can be calculated from the signal timing as:
2t
Tout = 2 * (Tmax − Tmin) + Tmin
T
where Tmin and Tmax are the corresponding rescale coefficients in EEPROM for the selected
temperature output and T is the PWM period. Tout is Tobj1, Tobj2 or Ta according to Config
Register [5:4] settings. (Refer to the MLX90614 Data sheet available on www.melexis.com for
details.)
Example:
Tobj1 => Config Reg[5:4] = 11’b
Tomin = 0°C => Tomin [EEPROM] = 100 * (tomin + 273.15) = 6AB3h
Tomax = +50°C => Tomax [EEPROM] = 100 * (tomax + 273.15) = 7E3Bh
Captured PWM high duration is 0.495*T => t2=(0.495 – 0.125)*T=0.370*T =>
measured object temperature = 2X0.370* (50°C -0°C)+0°C = +37.0°C.
The data field transmitted via PWM is 10 bit. Tmin and Tmax are written in device’s EEPROM,
and then the output data swing (12.5 to 62.5% duty cycle) will represent temperatures within this
range. This provides the “zoom in” option – 10 bits resolution over 50 degrees range, for
example, would give 0.0488 degrees LSB. Outside this range the output will saturate (to 12.5%
for T<Tmin and to 62.5% for T>Tmax).
Version MLX90614AAx
DC\Vdd Vdd,min=4.5V Vdd,nom-5%=4.75V Vdd,nom=5V Vdd,nom+5%=5.25V Vdd,max=5.5V
Tmin 12.5% 0.5625 0.59375 0.625 0.65625 0.6875
Tmid 37.5% 1.6875 1.78125 1.875 1.96875 2.0625
Tmax 62.5% 2.8125 2.96875 3.125 3.28125 3.4375
% of the Vdd,nom value 90% 95% 100% 105% 110%
Version MLX90614BAx
DC\Vdd Vdd,min=2.4V Vdd,nom-5%=2.85V Vdd,nom=3V Vdd,nom+5%=3.15V Vdd,max=3.6V
Tmin 12.5% 0.3 0.35625 0.375 0.39375 0.45
Tmid 37.5% 0.9 1.06875 1.125 1.18125 1.35
Tmax 62.5% 1.5 1.78125 1.875 1.96875 22.5
% of the Vdd,nom value 80% 95% 100% 105% 120%
The single data PWM output duty cycle is linearly dependent on the measured temperature:
100.0%
87.5% PW M DC
75.0%
62.5%
50.0%
37.5%
25.0%
12.5% Tobj
0.0%
Any of the temperatures measured is available for the PWM output. MLX90614 comes in single
MLX90614xAx) or dual zone (MLX90614xBx) configuration. The single zone version differs with
the following specifics:
no IR2 sensor is implemented
Tobj2 data is irrelevant
FOV is a symmetrical cone
A bit in EEPROM (CongifRegister1[05h], bit 6, 1 for dual zone) is set during factory calibration
that identifies number of zones.
Herein, unless otherwise noted, a single zone with object temperature 1 transmitted via PWM is
assumed. In most examples, 5V version is used. With extended PWM output format it would not
be possible to use the average value, as it is composed of two independent data bands.
Nevertheless it is possible to read the MLX90614xBx Tobj2 in the PWM-to-voltage conversion
application (single PWM format, again).
It is possible to configure the output to swing in a human friendly format (like 3.00 V for 30.0 °C).
As the duty cycle of the output PWM train swings in duration with a factor 1:5 (12.5% to 62.5%),
the temperature range of the MLX90614 needs to be set accordingly. Note that this assumes
that the ratiometric to the power supply voltage measurement option is unused. Therefore, if the
output is 3.00V at 30.0°C and 5.00V power supply, with the specified operating voltage range of
MLX90614AAA, 4.5…5.5V at 30.0°C the averaged value will vary as 2.70..3.30V. This is ±3°C
error in a range of 25°C, or ±12% error.
The MLX90614 has on-chip EEPROM memory. Once configured as desired, it will power-up in
the required configuration. (PWMCTRL and ConfigRegister1, if altered, would require power-
down and power-up in order for the changes to take effect). EEPROM locations of interest for
PWM-to-voltage conversion applications are:
To,max, address 00h : 16-bit value that represents the higher limit of the range to be transmited
via PWM in case object temperature is transmitted.
To,min, address 01h : same as To,max, but the lower limit.
P W M C TR L , address 02h : PWM function configuration. Reviewed in details below, as well as in
the MLX90614 datasheet.
Ta r an g e , address 03h : 8+8 bit values of the higher (8 left bits) and lower (8 right bits) limits of
the range to be transmitted via PWM in case ambient (package, or die) temperature is
transmitted.
C on f i g R e g i s t e r 1 , address 05h : Contains selection of the data to be transmitted via PWM. Note
that this register also consists of calibration settings, so adventurous writes of data in that
register may cancel the factory calibration.
All ranges limits are valid for both zones in a dual zone MLX90614. For example, the upper and
lower limits are set for both object temperatures Tobj1 and Tobj2.
Ranges limits are calculated as follows:
To,max[00h] = hex2dec [100*(to,max + 273.15)] , where to,max is the upper limit of the object
temperature in degrees Celsius. For example, upper limit of +120°C gives 9993h.
To,min[01h] = hex2dec [100*(to,min + 273.15)], where to,min is the lower limit of the object
temperature in degrees Celsius. For example, lower limit of -20°C gives 62E3h.
Ta range[03h] = Ta,H:Ta,L - each limit is coded in one half of the 16-bit number written. Bytes
for Ta,H and Ta,L are calculated as follows:
Ta,L = hex2dec [100*(ta,min + 38.2)/64] , where ta,min is the lower limit of the ambient
temperature in degrees Celsius. For example, lower limit of -20°C gives 1Ch.
Ta,H = hex2dec [100*(ta,max + 38.2)/64] , where ta,max is the upper limit of the ambient
temperature in degrees Celsius. For example, upper limit of +120°C gives F7h. This way the
example of Ta range -20…+120°C gives EEPROM[03h]=F71Ch.
Note: all examples are calculated using round-to-nearest, not truncation conversion decimal-to-
hexadecimal numbers.
P W M C TR L [02h]:
Bits [15:9] select the PWM period. For the PWM-to-voltage conversion applications highest
possible frequency is desired as it results in best ripple rejection after LPF and average value
restoration. The minimum period setting (1 ms) is 1 (b’0000001’).
Bits [8:4] set the number of repetitions for each period. Valid for extended PWM format.
Recommended value is 0 (b’00000’).
Bit 3 when high enables thermal relay function of the MLX90614. Recommended value for
PWM-to-voltage applications is 0.
Bit 2 when high configures the MLX90614 PWM output as push-pull ; Open drain NMOS when
low. Most applications are likely to need push-pull (all examples and schematics reviewed
herein are for push-pull output). Therefore the recommended value is 1.
Bit 1 when low enables SMBus. It is necessary to have this bit set for PWM output.
Bit 0 when low selects extended PWM format. Set this bit to 1 for PWM-to-voltage conversion
applications.
C on f i g R e g i s t e r 1 [05h]:
Note that all bits except the discussed below are highly recommended not to be altered as this
may cancel the factory calibration.
Bts [5:4] select the data to be transmitted via PWM. There are 3 possible options when
averaging and LPF is used:
b'
00’ – Tamb
b’11’ – Tobj1 (most likely to be the choice for these applications)
b’10’ – Tobj2 (undefined on MLX90614xAx).
Input resistance
Any loading of the LPF network will inherently degrade the accuracy of the circuit operation.
Without loading the averaged voltage will be
Vout = Vhigh*DC + Vlow*(DC-1)
,where Vhigh is the high level output voltage of the MLX90614, Vlow is the low level
output voltage of the MLX90614, and the DC is the duty cycle of the PWM output train
(0.125…0.625 in normal operation). For the estimation of the LPF loading assume R2 is high
enough not to cause significant voltage drop over the output push-pull stage. That gives
Vhigh=Vdd, Vlow=0. With loading of the LPF (to ground) the equivalent schematic will be:
C1
+Vdd
4
Vdd
R2
1 3
Vss PWM
SCL/Vz
C2 R1
U1
MLX90614
2
resulting in a passive resistive divider. In that case the output voltage will be
Vout’ = [R1/(R1+R2)]*Vout
For an example, with R2 = 10 kOhm, and R1 = 1 MOhm, Vdd=5V and DC=0.2 instead of
1000mV the output voltage will be 990mV. In other words, R1:R2=100 introduces 1% error.
Some measurement units (for example, some ADCs and some handheld multimeters) can be
demanding for the source resistance when accuracy is a must. In that case a buffer might
significantly improve the accuracy, as on the schematic below. With the output voltage range
0.125Vdd...0.625Vdd demands on the input common mode voltage range are relaxed. As an
example, AD8603 from www.analog.com would be an appropriate choice for this component.
C1
+Vdd
4
Vdd
U2
R2 + +Vref
1 3 +In
Vss PWM U3
SCL/Vz
- ADC
C2 -In
U1
-Vref
MLX90614
2
Ripple
The output of the LPF network R2C2 is never a perfect DC voltage. Some ripple is present after
the filter network. The ripple amplitude depends on the duty cycle (within the 12.5…62.5% range
the ripple would change by a factor of 2.3 with maximum at 50% duty cycle). With
R1=R2=10kOhm, C2=C3=1uF, Vdd=5V, PWM frequency 1kHz and duty cycle 50% ripple is
approximately 126mV peak-to-peak for Out1 and 1.6mV peak-to-peak for Out2.
C1
+Vdd
4
Out1 Out2
Vdd R1 R2
1 3
Vss PWM
SCL/Vz
C2 C3
U1
MLX90614
2
If this amount of ripple is unacceptable, a more complicated schematic could be used, like
C1
+Vdd
4
Vdd
U2
R1 R2 + +Vref
1 3 +In
Vss PWM U3
SCL/Vz
- ADC
C2 C3 -In
U1
-Vref
MLX90614
2
With R1=47k, R2=470k, C2=C2=1uF, the ripple (again at 5V, 50%, 1kHz) seen by the ADC will
be less than 20 uV. Note that this ripple reduction comes with significantly increased settling
time (3 seconds for this case). Certainly, a cost-effective approach might be to use a first order
RC network between the MLX9614 and the ADC in conjunction with digital filtering of the ADC
output.
Reference
Using the Vdd as an ADC reference voltage eliminates the Vdd influence on the Vhigh and
therefore on the analog voltage output. For applications with low accuracy demands this
influence might be acceptable, but it is recommended to check the error introduced. An
alternative approach might be to also measure the Vdd, or power the MLX90614 from a voltage
reference with tight tolerance. It is still not likely to expect easy and 100% successive
cancellation of the Vdd influence compared to simply using the Vdd as reference voltage.
General considerations
The MLX90614 is an integrated system in a metal can package. This results in good EMC
performance of the device. However, power lines still need decoupling as with any mixed signal
system. A 100nF SMD decoupling capacitor close to the package is typically good enough local
bypass. Certainly, the entire power rail needs to be free of severe noise and ripple. In systems
with strong EMI a careful EMC layout in conjunction with enhanced power supply filtering will be
a must. It is obviously more simple and cheap to implement digital communication with the
MLX90614 if EMC problems are expected.
With power supply voltages like 12V or 24V MLX90614Axx offers the extended flexibility for
building voltage regulators. It integrates a synthesized zener diode that can be used to build 5V
regulators as shown on the schematic below. Note that this zener diode is not provided as a
reference voltage source (refer to the MLX90614 datasheet for electrical specifications).
+Vsup
R1
Q1
C1 + C3
+5V
4
Vdd
U2
R2 + +Vref
1 3 +In
Vss PWM U3
SCL/Vz
- ADC
C2 -In
U1
-Vref
MLX90614
2
As shown, this regulator can be used to power more than just a MLX90614Axx thermometer.
However, the zener is not designed to sink large currents (refer to MLX90614 datasheet for
specifications). Base current of the external NPN BJT Q1 multiplied by the current gain is the
power drain of the circuitry, powered by this regulator. This base current can not exceed the bias
from R1 with the minimum zener diode operating current subtracted. Note that the 3V version
(MLX90614Bxx) does not provide the zener diode option.
Conclusion
Digital communications have inherent advantages that make them the prime choice for virtually
any application. However, there is a way to use the purely digital communications embedded in
the MLX90614 IR thermometer in analog applications on the price of only two passive
components. With reasonable care about several design specifics many demands to such
designs can be met. Visit www.melexis.com for most recent documents and tools.