LM 393 thermistor module code


Hi, does anyone know the code to sense temperature? FYA I am using a LM 393 thermistor module which is connected to an Arduino Nano.

Did you do any google research?

Yes I did but the code that I manage to find will display an inaccurate temperature reading

LM393 refers to the comparator chip, not the module. The board you have shown looks like a Chinese knock-off of the KY-028. The way the board is intended to be used is as a switch. You set the temperature threshold you want to switch on or off at by the trim pot. The comparator will output LOW until you reach the threshold temperature then it will output HIGH.

Although these have an analog pin output available unless you have a datasheet that gives you a voltage to temp conversion function the analog output will not be very useful.

You are better off using a DS18B20.

1 Like

That thermistor/LM393 module has an output that changes state depending on whether the temperature is above or below a certain threshold.

The threshold is set by a variable resistor, which is uncalibrated, so it only gives an arbitrary indication of temperature.

image

I agree with @robertnc assessment.
An LM35 would also be a good alternative

I've just noticed on the schematic that there is an analogue output , as well as a digital one.
(I hate those schematics where you have to read all the labels to find what is connected to what.)

It would be possible to connect the analogue output to an analogue input on an Arduino.

But you would need to know the characteristics of the thermistor used in order to calculate the temperature, using the Steinhart - Hart equation.

I see, that's explain why it keep giving me in accurate temperature reading.

I don't know the characteristic of the thermistor that is used in the module as it was not written in the product description. I guess like @robertnc and @jim-p said I will be better off using a DS 18B20 or LM 35.

Hi, @blinkllc
Welcome to the forum.

Please post the code you used.
To add code please click this link;

Thanks... Tom.. :grinning: :+1: :coffee: :australia:

Maybe you should post more about what you are trying to do. You may just need a thermistor circuit, but I would probably opt for the LM35 if you want analog output. The DS18B20 is available in the same package type as the LM35 but is also readily available in waterproof housings. It provides a digital one wire output. There are other options, here is a link that outlines some of the most commonly used sensors for MCU projects.

https://www.electronicshub.org/arduino-temperature-sensors/

Hmm, basically I am creating a cooling fan system in a room. I was hoping that it can show the temperature at different location of the room and record it so that I can use it for future reference. Additionally I want to make it so that it can turn on around 30C.

I did some research and I am aware that I might need several sensor to carry out the task but I was hoping to used as little sensor as possible to keep the circuit simple.

In that case, as @robertnc suggested use the DS18B20
It's a one wire bus device. You can connect several (at least more than 12) on the bus

You may also make a calibration curve...
That could be accurate to 0.5 degC. Or better if you have a very good ref T and use a morre complicated fit equation...

Two good measurements of resistance at known temperatures are enough to calculate beta:

Yea I also think that's a better option. As multiple sensor can be connected to one in put.

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