What to include?

I have a temperature sensor module (This one : http://smart-prototyping.com/LM393-Comparator-NTC-Thermistor-Temperature-Sensor-Module-DC-3.3-5V.html)

I connected the - , + and the analog. Now I have to create a code capable of receiving the temperature. But I dont know what to include for that. Can anyone help?

analogRead() on the analog pin, then convert the value (which represents the analog voltage, referenced against Vcc, on scale of 0 (for 0v) to 1023 (for Vcc - 5v for Uno/etc) to the temperature. No #include is required for this, though I suspect there are libraries to do thermistor calculations, not that they're complicated enough that you need a library for it.

You'll need to figure out what math you need to do to convert the analog voltage to a temperature.

Unfortunately, they don't seem to have provided the part number of the thermistor, so I'm not sure how you'd find this information. Normally you get a couple of values from the datasheet and plug them into a formula.


spycatcher2k: Sure, you can't, this module only outputs a high or low based on the threshold set by the Pot. Read the description and it tells you this.

Hm, interesting, so it's one of the ones without an analog pin? OP describes connecting to the analog pin. Oh, maybe he meant analog pin on the Arduino?

I assumed (without looking carefully enough) that it was one of the ones with 4 pins (Vcc, Gnd, DO, Analog). If it's only got Vcc, Gnd, and DO, you can only check whether its above or below a set point set with the pot on the board.

Guys. I used the analogRead() thing and it worked. I'm getting sometimes 32, sometimes 31. Is this the temperature in celsius?


What pot?


Done. I'm getting 1023


And how can I know at what temperature it is triggering? Also, i went outside with it and it did not reported 32-31 anymore. It reported a lower value.