Pages: [1]   Go Down
Author Topic: The proper way to integrate the MCP9700 temp sensor into an arduino  (Read 2317 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a MCP9700 and it's really simple to get data out of it. Ground, +5V and connect the middle pin to an analog pin on the arduino. From there the simple sketch will display some values:

Code:
  float temp = analogRead(0)*5/1024.0;
  temp = temp - 0.5;
  temp = temp / 0.01;
  Serial.println(temp);

However this is giving me a temperature that is consistently high by 5-15 degrees. I'll even have two sensors next to each other on two separate arduinos and they both read very differently.

Can someone tell me the best way to either calibrate or connect the MCP9700 into my circuit? I've tried adding capacitors but that didn't quite get me visibly better results. Do I need a resistor? Do I need a shunt?

Thanks!


Logged

0
Offline Offline
Full Member
***
Karma: 5
Posts: 233
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you using the USB cable to power the Arduino and then the Arduino to power the sensor, if so that may be your problem as the voltage out of the USB can be noisy.  Try using a different method of powering your Arduino like a wallwart DC source of say 9 volts plugged into the DC socket on the board, this may solve your problem.  Alternatively, you could find a USB hub that supplies the 5 V line through its own power supply.

wade

wade
Logged

Brunsbüttel, SH, F.Rep.GERM
Offline Offline
God Member
*****
Karma: 4
Posts: 596
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

u could try a nicer Vref for arduinos ADC:
http://arduino.cc/en/Reference/AnalogReference?from=Reference.AREF

it is appr. 1.1V and it is good for up to 60°C and will increase accuracy...
Logged

-Arne

Pages: [1]   Go Up
Jump to: