LM75 sensor/The reading/04. Ten readings a second
The reading · 04 of 9

Ten readings a second

The chip measures on its own clock: a short conversion about every 100 milliseconds, the result left in the register for whoever asks. Reading faster returns the same number again. The first read after power-up comes before the first conversion and is thrown away.

Its own clock

Nobody tells the chip when to measure. From power-up it converts on a fixed schedule and writes each result into register 0. NXP's LM75B takes about 10 ms to convert and starts a new conversion every 100 ms; UMW's sheet for the fitted part gives 26 ms every 80 ms. Either way, a new number about ten times a second.

A read does not start a conversion or interrupt one. It returns whatever the last finished conversion left.

Ten readings a second
Sketch reads every50 ms
Datasheet
Reads a second
20
New ones
10
Conversion
10 ms of every 100
Reading every 50 ms, faster than the chip's 100 ms. 10 of the 20 reads in this second return a number the sketch already had. Nothing breaks, and nothing is gained: air does not change temperature in a tenth of a second.

So reading every 20 ms gets each number four or five times. Nothing is lost, nothing is gained, and the bus is busier than it needs to be. The book's sketch reads twice a second.

The first read

At power-up the register holds nothing useful. NXP says the first reading "must be ignored"; UMW's sheet says the register reads zero until the first conversion ends. The book's sketch waits a quarter of a second, reads once and throws it away, then starts printing.

It measures itself

The sensor is inside the chip, so the number is the temperature of the chip. The chip sits on the board, the board sits on your wires, and heat reaches it through its legs and through the air.

Its own supply current barely warms it: at NXP's worst case, 200 µA at 5.5 V, the chip heats itself by about 0.06 °C. What does warm it is whatever is near it. How quickly it follows a change in the air is not in either datasheet; a small board like this one takes something like a minute in still air to settle, but that is an estimate, not a measurement.

When it does not work

The first line after power-up says 0.000.

The register has nothing in it until the first conversion ends. NXP says to ignore the first reading after power-up; UMW's sheet says the register reads zero until then. The book's sketch waits and throws the first one away.

The number does not change for several reads in a row.

Either the sketch is reading faster than the chip converts, about ten times a second, or the temperature is simply steady. Hold a finger on the chip: a live sensor starts to climb within a second or two.

Can I make it convert faster?

No. The conversion period is fixed inside the chip; neither datasheet offers a faster setting. What a sketch can do is read less often, or put the chip into shutdown between readings, which is bit 0 of register 1.

Where this goes next

An eighth of a degree is the step, not the accuracy.

How close to the truth →

Edit this page — content/books/lm75/ten-readings-a-second.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

LM75 Temperature Sensor

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →