When the reading is wrong
Five things go wrong with this block, and each has its own look in the serial monitor: no answer, a zero on the first line, 250 degrees in the cold, a reading that runs warm, and one that never changes. Most are the wiring or the arithmetic, not the chip.
Five symptoms
Each one points somewhere different: the wires, the sketch or where the board sits. The figure shows what the monitor looks like in each case, and the paragraphs below say what to check first.
No answer
The book's sketch prints No LM75 at 0x48 when the chip does not acknowledge.
Check the order from the square pad: GND, VCC, SDA, SCL. On this block SDA is
the third pin, and a pair of jumper wires swapped between SDA and SCL is the
most common cause. Then VCC: without it the chip is silent and nothing lights
to say so.
If the jumper on the back has been cut, the bus may have no pull-ups at all. VCC sets the bus says when that is safe.
The wrong number
A 0.000 on the first line is a read before the first conversion finished. The book's sketch throws that one away.
About 250 below zero is the arithmetic: the two bytes went into a 32-bit
int and the sign was lost.
Degrees in two bytes has the
one line that fixes it.
A degree or two high is usually heat from nearby: the chip measures its own temperature, and a microcontroller or a regulator a centimetre away warms the board. Put it on longer wires, away from both.
The same value, again and again is a sketch reading faster than the chip converts, or a room whose temperature is steady. A finger on the chip tells the two apart in a second or two.
When it does not work
Count from the square pad: GND, VCC, SDA, SCL. SDA and SCL swapped is the usual cause, then VCC not connected, then a cut pull-up jumper with no other pull-ups on the bus. Nothing is damaged by any of those.
The sketch combined the two bytes in a 32-bit int. Read them into an int16_t and divide by 256.0. The book's sketch does; the code on the page this book replaced did not.
The chip is warmer than the air: a microcontroller, a regulator or the sun is heating the board. Move it a few centimetres away on longer wires and give it a minute. What is left, up to 2 °C, is within the datasheet.
Two devices may share the address. An ADS1115 left at its default is also 0x48. Unplug everything else and read again; if it comes right, move the other device's address.
Back to the block's page: the specifications, the files and the quick reference.
The TK42 LM75 →Edit this page — content/books/lm75/when-the-reading-is-wrong.mdx
Questions about this product
See what other owners have asked, and read their solutions.
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.