Hello
I wrote a program for the lm75 sensor that works well in Proteus software.
But when it is in practice, the temperature displayed on the lcd some times jumps from the actual temperature to -1.
Where do you think the program is having trouble?
The sensor used is lm75 of nxp.
The display lcd nokia5110.
In practice, like the following circuit:

Your driver is substantially different from the CCS driver: lm75cim3.c
I suggest you look at the CCS driver and use it instead of your code.

temtronic

Joined: 01 Jul 2010Posts: 6290Location: Greensville,Ontario

Posted: Sun Jan 21, 2018 3:28 pm

2 comments
1) Noise could be coming into the device. Be sure Vdd is stable and noise free. The Maxim datasheet suggests 5K in series with SCL, SDA lines suggesting board layout is critical.

2) The 'temp part' of your code could be a problem. You've got 2 8-bit variables from the device that need to be merged into the proper bits and then displayed. If you don't 'cast' correctly you'll end up with bad numbers.

qwwe

Joined: 17 Sep 2017Posts: 59

Posted: Sun Jan 21, 2018 11:39 pm

I got an idea from lm75cim3.c to write this Program .
When I used exactly my own lm75cim3.c, I did not show the correct temperature, for example, -1 was 225.
That's why I applied the above changes to the program.
This program responds correctly to proteus, but not in practice.
Is the lm75 sensor from nxp different from other lm75 sensors?

qwwe

Joined: 17 Sep 2017Posts: 59

Posted: Mon Jan 22, 2018 12:40 am

I also used this driver lm75cim3.c like before, just this time it jumps from the actual temperature to 255.
Because, as I said, this driver does not show a negative.

qwwe

Joined: 17 Sep 2017Posts: 59

Posted: Mon Jan 22, 2018 1:19 am

problem solved .
In fact, I had forgotten to connect the lines of the address to the ground
Thankful