How to use the Temperature Sensor Brick

Hi, I’m looking for some help with the Electronic Brick Kit Temperature sensor.

The Docs do not give any clue as to how to connect the module or provide an example sketch.

I have only just received the kit and was going through the examples to make sure everything worked - Everything does, except I can’t test the Temp. Sensor.

Sorry to be a pain - But just a pointer in the right direction would be appreciated.

Thanks.

Hi Geezer,

The following is an example of arduino with temperature sensor.

You can refer to this link. arduino.cc/cgi-bin/yabb2/YaB … 1257341359

[code]

const int tempPin = A0; // Analog input pin that the potentiometer is attached to

int Temp = 0; // value output of analog

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}

void loop() {
// read the analog in value:
Temp= analogRead(tempPin) * 45 / 1024;
// print the results to the serial monitor:
Serial.print("temperature = " );
Serial.println(Temp);
// wait 100 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(100);
}[/code]
LCD.jpg

OK SQX, many thanks - That works … Sort of…
I’m getting a temperature reading, but it’s nothing like accurate - I wasn’t expecting 3 decimal places and would have been happy with +/- 1 or 2 degrees C. But i’ve placed the sensor (carefully) in ice and I get a reading of 11 degrees :astonished: - just a bit high!
However, at room temperature, it seems to be OK (ish). Looks to me like there is a bit of non-linearity going on here. I also don’t understand the 45/1024 bit of the code - I assume that is some “fiddle factor”. :confused:

This has been a good learning experience, but I think I’ll be looking towards the LM35, as there seems to be better reports on this device.

Thanks again SQX, much appreciated.

Ken.

Hi,

I'm getting a temperature reading, but it's nothing like accurate - I wasn't expecting 3 decimal places and would have been happy with +/- 1 or 2 degrees C. But i've placed the sensor (carefully) in ice and I get a reading of 11 degrees   - just a bit high!

You’d better refer to the datasheet, the type of the sensor is TTC3A103□39H.
seeedstudio.com/depot/images … /TTC03.pdf

However, at room temperature, it seems to be OK (ish). Looks to me like there is a bit of non-linearity going on here. I also don't understand the 45/1024 bit of the code - I assume that is some "fiddle factor"

You can refer to this link which there is the calculation.
arduino.cc/cgi-bin/yabb2/YaB … 1257341359

Merry Christmas!

OK, I think I understand - I will do some more experimenting.

Many thanks for your help.

All the best - Ken