Hi I make changes for 5v reference and add 4 decimal parts.
I use the formula for the board To=(Vo-1.25)/5mv and the value seems real for temperature
But in output it has +- 1ºC not bad... but I expect better...
int pinoSensor = 0;
int valorLido = 0;
float temperatura = 0;
void setup() {
Serial.begin(9600);
analogReference(5); // use 1.1V internal ref
}
void loop() {
valorLido = analogRead(pinoSensor);
temperatura = (valorLido * 5 / 1024.0);
temperatura = (temperatura - 1.25)/ 0.005;
Serial.print("Temperatura actual: ");
Serial.println(temperatura, 4);
delay(1000);
}
Temperatura actual: 18.5547
Temperatura actual: 18.5547
Temperatura actual: 17.5781
Temperatura actual: 17.5781
Temperatura actual: 18.5547
Temperatura actual: 18.5547
Temperatura actual: 17.5781
Temperatura actual: 17.5781
Temperatura actual: 17.5781
Temperatura actual: 18.5547
Temperatura actual: 17.5781
Temperatura actual: 18.5547
Temperatura actual: 17.5781
Temperatura actual: 18.5547
Temperatura actual: 17.5781
Somebody can tell me that this results are with best accuracy?
In the AD8495 saise that we have only -+1ºc for room temp.
By the way, I have connected to the arduino this AD8495 and a relay module, and when relays arms the temperature reading drops too much. I suppose the usb port from laptop is not enough to power the arduino with enough current. I am right?
cpalha:
Hi I make changes for 5v reference and add 4 decimal parts.
I use the formula for the board To=(Vo-1.25)/5mv and the value seems real for temperature
But in output it has +- 1ºC not bad... but I expect better...
Arduino's 10-bit A/D has 1024 steps spread out over 5volt (default mode). That's about 5mV per A/D step.
That, with the LM35 10mV per degree C sensitivity, results in a temp resolution (steps) of 0.5C.
Printing the temp with four decimal places (0.0001C resolution) is total nonsence.
Printing with one decimal place (0.1C) already isn't going to work.
A thermocouple, with it's 5mV sensitivity (instead of 10mV), could be twice as bad.
The best you can get with that approach is a one degree/step readout.
You can improve the LM35 setup by a factor of five (true 0.1C resolution) by using Arduino's 1.1volt Aref and some oversampling.
But that's the best you can do with a 10-bit A/D.
The LM35 can't go to zero C without additional hardware. The TMP36 can.
For a temp range from 0-100C (-55 to +125) it's much better to switch to a digital DS18B20 sensor.
That one has a resolution (not accuracy) of 0.0625C.
Leo..
I change it for thermocouple because in my work we use a lot of this kind of sensors, LM35 at about 5 degrees it has many fluctuation...If the thermocouple will give a +-1 degree precision, it is acceptable.
About the fluctuation values when relay arms/disarms, I changed the power supply from usb to the dc transformer through dc in connector and it was amazing the stability of the signal.