Contents[Show]

### Intro

Here we describe a class for reading out the LM335 temperature sensor. This class is based on Chiptemp. See here for a detailed description of the software: http://www.avdweb.nl/arduino/temperature-measurement.html

### Differential amplifier

The LM335 output voltage is 2.73V ... 3.73V for 0/°C to 100/°C. This differential amplifier converts the output voltage to 0 ... 5V for the Arduino ADC:

### Electronic circuit calculation with wolframalpha

Although the circuit is simple, the calculation isn't. We have to solve a system of multiple variable equations. Manually solving cost a lot of work, but wolframalpha can solve it automatically. For Rc we take a value of 100kΩ, the resistors Ra and Rb have to be determined.

#### Gain calculation:

The gain is (Rc + Ry) / Ry, where Ry is the equivalent resistance Ry = Ra*Rb / (Ra+Rb)

#### Kirchhoff's circuit law:

iRa = iRb + iRc
(5V - 2.98V) / Ra = 2.98V / Rb + (2.98V - 1.25V) / Rc

So there are 4 equations which have to be filled in into wolframalpha:
c = 100e3, y = a*b / (a+b), (c + y) / y = 5, (5 - 2.98) / a = 2.98 / b + (2.98 - 1.25) / c

After a short time wolframalpha comes with the solution:
Ra=36630Ω, Rb=78740Ω

http://www.wolframalpha.com/input/?i=y+%3D+a*b+%2F+%28a%2Bb%29%2C+%28c+%2B+y%29+%2F+y+%3D+5%2C+c+%3D+100e3%2C+%285+-+2.98%29+%2F+a+%3D+2.98+%2F+b+%2B+%282.98+-+1.25%29+%2F+c

### LM335 class

For troubleshooting see HERE.