LM35 on an esp8266?

Hello, I'm working on a simple project with a lm35 being on a esp8266 and Led's. I'm working on s simple temperature if it reaches 80F a red led turns on. The problem I have from what I'm seeing is that the lm35 requires 4v or higher. However I'm seeing other people using it on the esp8266 which is a 3.3v logic level. Is there a way to get the voltage higher on the logic level without killing the esp8266?

Sorry this is new to be I have never done anything like this before. and Maybe I'm phrasing this wrong in a way. If so please let me know so I can correct myself.

Joseph

Hi,
Maybe I'm wrong, but according to the specification,
https://www.ti.com/lit/ds/symlink/lm35.pdf?ts=1662555430568&ref_url=https%253A%252F%252Fwww.google.com%252F
the lm35 can accept a supply voltage between -0.2V and 35V. So with a 3.3V supply voltage, the signal won't exceed 3.3V. But I'm not sure if the signal will be usable.

When I search google. I found this.

​The input voltage to LM35 can be from +4 volts to 30 volts . It consumes about 60 microamperes of current.

Or an other way is to supply your LM35 with 5V and use a voltage divider on your analog pin. Typically R1/R2 = 1/2 so 5Vx2/3=3.3V

Thank you. That is what I was thinking.

It's "recommended operating conditions" not "absolute maximum ratings". But it's not recommended. I think that a voltage divider is a better solution.

What flavor of ESP8266 do you have?

A NodeMCU the ADC takes 0 - 3.3V because there is a voltage divider on the ADC input to bring the 3.3V down to 1V. The regular ESP8266 ADC takes 0 - 1V.

The LM35 output is 10mV per degree C so the output is 1V at 100 degrees C.

The LM35 takes 4V minimum to work right.

I have the D1 mini clone.

So the D1 mini is made to support 3.2V max on his analog input according to all the clones spec.

I did mange to find this site with an example. No extra resistors added on. https://www.instructables.com/Interface-LM35-With-NodeMCU/

Yep, no magic here.
The LM35 is supposed to work between 4 to 30V. However, it seems that some people can get a correct signal supplying the LM35 with 3V which is inside absolutes maximum rating specifications.

Just power the LM35 with 5volt from the V-in/USB/5volt pin of the D1 mini, and connect it's output directly to A0. The D1 mini has a 110k:220k voltage divider on that input, so nothing bad will happen. A TMP36 would have been a better choice. Then you would also have been able to measure temps below 32F. A digital DS18B20, with it's higher resolution, would have been much better.

Try this
float tempF = (analogRead(A0) * 0.592) +32.0;
Leo..

Depending what temperature you want to measure, the supply can be lower than 4V. This graph from the dat sheet may help:
image

I like the suggestion of @Wawa, use the DS18B20 digital output sensor. Higher accuracy, no dependence on supply voltage or analog reference accuracy and one pin for multiple sensors.

Kindly check the datasheet. LM35 pdf, LM35 Description, LM35 Datasheet, LM35 view ::: ALLDATASHEET :::
It says, the supply soltage is +35V to −0.2V. So, there should be no problem in using it with ESP8266.

That's absolute max ratings before damaging the part.
Working condition is more like 4 to 24volt.
Leo..

At the moment I don't have acess to any ds18b20 temperature sensors.

If you do order some, make sure to get them from a reputable vendor. There are a lot of counterfeits around.

I notice that. Same with the lm35.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.