Temperature sensor result

Hello world,

I’ve bought a temperature sensor (model: LDTR-0010) and wrote a code to get temperature in console.
As I don’t have an experience I found an example code and make it work.
What I want to know if the code is correct when calculating temperature in Celsius.
Could you please check and see if with the sensor I will get the correct result?
Thanks in advance.
Code below

  temp = analogRead(tempPin);
  float mv = 5.0 / 1024.0 * temp * 100 - 50;
  float cel = mv / 10;
  Serial.print("Temperature = ");
  Serial.print(cel);
  Serial.print("*C");
  Serial.println();

Can't find anything about LDTR-00 on google.

guix:
Can't find anything about LDTR-00 on google.

Sorry, my mistake, it is LDTR-0010, analog temp sensor.
Like this one: http://es.aliexpress.com/item/LDTR-0010-Analog-Temperature-Sensor-Board-Module-for-Arduino/32519590382.html

If you find a datasheet of the thermistor they used on this board, then maybe I can help you :slight_smile:

Where did you find the example code?

guix:
If you find a datasheet of the thermistor they used on this board, then maybe I can help you :slight_smile:

Sorry, I was searching for datasheet, but no success :frowning:

aarg:
Where did you find the example code?

From google :slight_smile:

Hi,

Arsen:
Hello world,

I’ve bought a temperature sensor (model: LDTR-0010) and wrote a code to get temperature in console.
As I don’t have an experience I found an example code and make it work.
What I want to know if the code is correct when calculating temperature in Celsius.
Could you please check and see if with the sensor I will get the correct result?
Thanks in advance.
Code below

Have you tried your code?
Because the code you posted is nowhere near complete.
Tom.... :slight_smile:

TomGeorge:
Hi,Have you tried your code?
Because the code you posted is nowhere near complete.
Tom.... :slight_smile:

Hello,
Yes, it works and I can see 18.xº or 19.xº, I put the calculating part only from the code :slight_smile:

Hi,
Good that it works.
We need to see all of your code.

Thanks.... Tom.. :slight_smile: