MCP9802 temperature sensor and Arduino
MCP9802 is a digital temperature sensor from Microchip that measures temperatures between -55°C and +125°C to a digital word. It provides an accuracy of ±1°C (maximum) from -10°C to +85°C. The MCP9802 sensor comes with user-programmable registers that provide flexibility for temperature sensing applications. The register settings also allow user-selectable 9-bit to 12-bit temperature measurement resolution. This sensor has an industry standard 2-wire I2C compatible serial interface, allowing up to eight devices to be controlled in a single serial bus. In this blog post I am going to write about an Arduino sketch to interface the MCP9802 sensor with an Arduino for temperature sensing application. For illustration, I am using the MCP9802 sensor onboard the I2C EEPROM+Sensor breakout board.
The hardware connections between MCP9802 and Arduino is straightforward. Two pull-up resistors are required on the I2C signal lines. On Arduino Uno, the I2C lines are multiplexed with analog pins A4 (SDA) and A5 (SCL).
The following Arduino sketch configures the MCP9802 sensor resolution to 12-bit. The Arduino receives the temperature bytes and sends them out to serial port. The values are received and displayed on the serial monitor window on PC. Note that the 7-bit slave addresses of the
MCP9802 sensor on board is 0×48.
Read More: MCP9802 temperature sensor and Arduino