pico-examples/i2c/mcp9808_i2c
2021-11-03 11:37:42 -05:00
..
CMakeLists.txt Updates along with SDK1.3.0 release (#181) 2021-11-01 14:41:54 -05:00
mcp9808_i2c.c Updates along with SDK1.3.0 release (#181) 2021-11-01 14:41:54 -05:00
mcp9808_i2c.fzz Updates along with SDK1.3.0 release (#181) 2021-11-01 14:41:54 -05:00
mcp9808_i2c.png Updates along with SDK1.3.0 release (#181) 2021-11-01 14:41:54 -05:00
README.adoc Update README.adoc's for various examples to remove unnecessary block callouts. (#182) 2021-11-03 11:37:42 -05:00

= Attaching a MCP9808 digital temperature sensor via I2C

This example code shows how to interface the Raspberry Pi Pico to the MCP9808 digital temperature sensor board. 

This example reads the ambient temperature value each second from the sensor and sets upper, lower and critical limits for the temperature and checks if alerts need to be raised. The CONFIG register can also be used to check for an alert if the critical temperature is surpassed.

== Wiring information

Wiring up the device requires 4 jumpers, to connect VDD, GND, SDA and SCL. The example here uses I2C port 0, which is assigned to GPIO 4 (SDA) and 5 (SCL) in software. Power is supplied from the VSYS pin.

[[mcp9808_i2c_wiring]]
[pdfwidth=75%]
.Wiring Diagram for MCP9808.
image::mcp9808_i2c.png[]

== List of Files

CMakeLists.txt:: CMake file to incorporate the example in to the examples build tree.
mcp9808_i2c.c:: The example code.

== Bill of Materials

.A list of materials required for the example
[[mcp9808-bom-table]]
[cols=3]
|===
| *Item* | *Quantity* | Details
| Breadboard | 1 | generic part
| Raspberry Pi Pico | 1 | https://www.raspberrypi.com/products/raspberry-pi-pico/
| MCP9808 board| 1 | https://www.adafruit.com/product/1782
| M/M Jumper wires | 4 | generic part
|===