# Electronic brick-Temperature sensor(Analog) what temp/value

Hi, I have just bought this temperature sensor module.
seeedstudio.com/depot/electr … Path=48_52

It works fine, but I cannot find any kind of table or list, what values will be put out for which temperature…

At the moment, when I read in the analog value I get about “470”, that could be something like 22° Celsius in my room here.

But can I get the values for 100°C and 0°, so I can calibrate it by my own…
Or is there any kind of list

Thank for your help
Best regards from Hamburg

Simon

change the AD value to voltage value.

calculate the voltage to get the resistance of the sensor.

check the relation of the resistance and the temperature .

Thanks thats better than nothing, but I think I will buy an LM35 TempSensor-module, that´s nearly linear. And I can get a proper datasheet

greetz
simon

I would have to agree that the temperature sensor in the brick line is rather difficult to find the right values for. It certainly may be easier to use a more linear one. However, this one can be tamed to produce good results. With my limited equipment, I am finding that my measurements are about .2 degrees off on F and .1 on C (I don’t know which is right, my lab thermometer or this brick temperature sensor). Again, if you looking for something extremely accurate, a more linear sensor can be found. But, this is close enough for my uses.

These are what I am using:

For Fahrenheit:

250 = 34.3 degrees F 700 = 111.0 degrees F

For Celsius:

250 = 1.3 degrees C 700 = 43.9 degrees C

Here is the code I am using for Celsius:

Original code is over at arduino.cc/ I changed it to reflect this particular sensor.

This code assumes you are connecting the Temperature sensor to A1 on the Brick Chassis. If you put it somewhere else, you will need to change the port your pulling data from. You will need to change the red colored port below to the one you change it too.Additionally, I connected the led sensor to D12 on the Brick Chassis to see the read and write process. If you add the LED sensor to a different port, you will need to change that assignment as well.

void toggle(int x)
{
if (digitalRead(x) == HIGH)
digitalWrite(x, LOW);
else
digitalWrite(x, HIGH);
}

void setup()
{
Serial.begin(57600);
}

void loop()
{
float x = map(analogRead(1),250,700,13,439); // analog pin reads 250-700, corresponds to 1.3C to 43.9C
x /= 10.0; // divide by 10; map() uses integers
Serial.println(x); // output to serial
toggle(12); // toggle LED
delay(1000); // wait 1 second

}

Here is the code I am using for Fahrenheit:

Original code is over at arduino.cc/ I changed it to reflect this particular sensor.

This code assumes you are connecting the Temperature sensor to A1 on the Brick Chassis. If you put it somewhere else, you will need to change the port your pulling data from. You will need to change the red colored port below to the one you change it too. Additionally, I connected the led sensor to D12 on the Brick Chassis to see the read and write process. If you add the LED sensor to a different port, you will need to change that assignment as well.

void toggle(int x)

{
if (digitalRead(x) == HIGH)
digitalWrite(x, LOW);
else
digitalWrite(x, HIGH);
}

void setup()
{
Serial.begin(57600);
Serial.println(“Serial Connection is Ready”);
}

void loop()
{

float x = map(analogRead(1),250,700,343,1110); // analog pin reads 250-700, corresponds to 34.3F to 111.0F
x /= 10; // divide by 10; map() uses integers
Serial.println(x); // output to serial
toggle(12); // toggle LED
delay(1000); // wait 1 second

}

I would recommend placing the sensor in an ice bath along with a thermometer and write down the counts and temperature reading for low range. Then place the thermometer in hotter source along with the sensor and write down the counts and the temperature reading for the high range. Remember the accuracy of any calibration procedure is as accurate as the instruments used to calibrate the outcome. Also the range you calibrate should cover the range of you requirements. You may take a few intermediate readings of temperature and counts. The linearity can be plotted and you could add adjustments in your program to correct the output and improve the middle readings.

By following this you can obtain the counts / temperature and will know that it is more accurate than using standard published numbers.