# Electronic – Interfacing LM335 to XBee ADC pin

lm335xbee

I'm a software engineer dipping my toe into hardware. I am trying to interface an LM335 temperature sensor to an XBee radio device. The XBee has an ADC built in. The XBee pins are:

• 1 = VCC = 3.3V
• 10 = GND
• 14 = VREF

The specifications on the XBee say that VREF "must be between 2.6V and VCC".

The LM335 has (-) and (+) and (adj) pins, see LMx35, LMx35A Precision Temperature Sensors.

Could someone give me some guidance on what circuit I would need to make this work? Or at least a reference where I could learn more?

Have a look at the examples on page 6 of the datasheet. It shows a basic application and a calibrated sensor. This is the calibrated one:

Set the potentiometer so that at 25°C you have 2.982V at the output. If you don't need the calibration just leave out the potentiometer. Your reading will be less precise. Uncalibrated error is for the LM335 typically 2K @25°C, maximum 9K(!) over the full range (table on page 2), so that you might prefer to calibrate it after all.
The value of R1 must be chosen in function of the power supply; on the first page you can read that it needs between 400\$\mu\$A and 5mA. Suppose the maximum temperature you want to measure is 30°C (that's 303.15K). The output will then be 3.03V. The current through the potentiometer will be \$\frac{3.03V}{10k\Omega}=303\mu A\$. You have a 3.3V power supply, then \$R1=\frac{3.3V-3.03V}{400\mu A + 303\mu A}=384\Omega\$ maximum.

Being good designers :-) we now check if the current isn't going to be too high at the lowest temperature. Suppose we want to measure temperatures as low as 0°C, that's 273K, giving \$V_{OUT}=2.73V\$. The resistor current will then be \$I_{R1}=\frac{3.3V-2.73V}{384\Omega}=1.5mA\$, subtract the 273\$\mu\$A through the potentiometer, and we have 1.2mA through the LM335, way below the allowable 5mA, so that's OK.

R1 has to be smaller than \$384\Omega\$ if you want to measure higher temperatures. With a 3.3V supply your theoretically maximum measurable is 330K, or 57°C. In practice somewhat less, because you will always need some voltage over the resistor. The resistor value will be so low, however, that at lower temperatures you almost certainly will exceed the allowable 5mA.

Connect \$V_{REF}\$ to \$V_{CC}\$.

National has also a sensor giving you the temperature directly in °C (LM35) and I thought this would be a solution for measuring higher temperatures (at 57°C it will only output 570mV, so you'd have enough headroom), but that needs at least 4V, so that wouldn't help us.