Go Down

Topic: The proper way to integrate the MCP9700 temp sensor into an arduino (Read 3335 times) previous topic - next topic


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: [Select]
  float temp = analogRead(0)*5/1024.0;
  temp = temp - 0.5;
  temp = temp / 0.01;

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?



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.




u could try a nicer Vref for arduinos ADC:

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


I'm trying to understand the *5/1024 portion of the equation. Can anyone explain please?

Thanks in advance.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131