Body temperature sensor usiing LM 35

I want to measure the temperature of body by placing a fingr tip or something like that using LM 35 sensor but while i am doing this the sensor is giving varying OUTPUT sometimes above 50 and sometimes right to the range of 37-38.How can i correct this?

int sensorValue = analogRead(sensorPin); 
float voltage = sensorValue*5.0/1024.0;
float temperature = 100.0*voltage;
lcd.clear();
lcd.print("Temp.(C): ");
lcd.print(temperature);
delay(3000);

One of the things I did to 'calm' down the A/D converter was to push a 15pF ceramic disc 50V capacitor into the Aref and Gnd pins. I, initially tried a 47nF cap but found the cap value was to large and, hence, to slow to respond. For best effect, clean the leads off with a rubber eraser before insertion.

Use the 1V internal reference for much better precision (five times the resolution) and stability.

A load resistor on the output of this sensor may help as well.

wvmarle:
Use the 1V internal reference for much better precision (five times the resolution) and stability.

A load resistor on the output of this sensor may help as well.

a load resistor´╝č
no that is fine but getting temperature values in the range of 50-60 C indicating some another problem??

Idahowalker:
One of the things I did to 'calm' down the A/D converter was to push a 15pF ceramic disc 50V capacitor into the Aref and Gnd pins. I, initially tried a 47nF cap but found the cap value was to large and, hence, to slow to respond. For best effect, clean the leads off with a rubber eraser before insertion.

What does it mean to calming ADC??

vishal_3:
no that is fine but getting temperature values in the range of 50-60 C indicating some another problem??

That means the output voltage of the sensor is changing by about 25 mV, and/or your reference voltage is not stable. You have to stabilise this.

So:

  • load resistor (10k or so will be good) between output pin and GND,
  • small capacitor (10-100 nF will be fine) between output pin and GND,
  • internal analog reference.

wvmarle:
That means the output voltage of the sensor is changing by about 25 mV, and/or your reference voltage is not stable. You have to stabilise this.

So:

  • load resistor (10k or so will be good) between output pin and GND,
  • small capacitor (10-100 nF will be fine) between output pin and GND,
  • internal analog reference.

10 k resistor between OUTPUT pin of LM 35 Aand ground??
and i want to ask do i need to set the analogreference(INTERNAL) in the setup() part? and what value the ADC now gives for ex. in case of 5V reference for a 5V voltage ADC returns 1023 value now what value shall ADC return?.I mean how to measure that and convert to C OR F temperature value.

Thanks.

vishal_3:
I want to measure the temperature of body by placing a fingr tip or something like that using LM 35 sensor but while i am doing this the sensor is giving varying OUTPUT sometimes above 50 and sometimes right to the range of 37-38.How can i correct this?

int sensorValue = analogRead(sensorPin); 

float voltage = sensorValue5.0/1024.0;
float temperature = 100.0
voltage;
lcd.clear();
lcd.print("Temp.(C): ");
lcd.print(temperature);
delay(3000);

The temperature of a finger tip is 1-2 degrees cooler than the "body" temperature. On an older person, like me, with poor circulation and little body insulation, the temp may be even less.

Paul

vishal_3:
10 k resistor between OUTPUT pin of LM 35 Aand ground??

Yes. In parallel with hat capacitor.

and i want to ask do i need to set the analogreference(INTERNAL) in the setup() part?

Yes,

and what value the ADC now gives for ex. in case of 5V reference for a 5V voltage ADC returns 1023 value now what value shall ADC return?.I mean how to measure that and convert to C OR F temperature value.

ADC range remains 0-1023, but the scale changes. It's from 0V to AREF, where AREF by default is Vcc (about 5V normally), but that's now 1V. So 1V input is 1023 on the ADC output.

Note that for best precision you have to calibrate the internal reference value for each individual microcontroller as it's very stable but not precise (can be up to 10% off).

Use the 1V internal reference for much better precision

Is the internal reference 1V or 1.1V?

GolamMostafa:
Is the internal reference 1V or 1.1V?

Could be either :wink:

Note that for best precision you have to calibrate the internal reference value for each individual microcontroller as it's very stable but not precise (can be up to 10% off).

I think it's nominal 1.1V.

If you want to know it more precise, get a precision reference such as the TL431. The B-grade (the highest) has no more than 0.5% error. The output of that you can then connect to the AREF pin of your Arduino, and set analogReference(EXTERNAL).