Inter-Integrated Circuit, aka I2C, is a two-wire protocol for connecting sensors and "devices" to a microcontroller. A large number of sensors, including the ones sold by Adafruit, use I2C to communicate.
Typically, using I2C with a microcontroller involves programming. Adafruit IO and WipperSnapper let you configure a microcontroller to read data from an I2C sensor and publish that data to the internet without writing code.
The WipperSnapper firmware supports a number of I2C sensors, viewable in list format here.
- If you do not see the I2C sensor you're attempting to use with WipperSnapper, Adafruit has a guide on adding a component to Adafruit IO WipperSnapper here.
On this page, you'll learn how to wire up an I2C sensor to your board. Then, you'll create a new component on Adafruit IO for your I2C sensor and send the sensor values to Adafruit IO. Finally, you'll learn how to locate, interpret, and download the data produced by your sensors.
Make the following connections between your Adafruit HUZZAH32 and the MCP9808:
- Board power to MCP9808 VIN
- Board ground to MCP9808 GND
- Board SCL to MCP9808 SCL
- Board SDA to MCP9808 SDA
Add an MCP9808 Component
On the device page, click the New Component (or "+") button to open the component picker.
Search for the component name by entering MCP9808
into the text box on the component picker, the list of components should update as soon as you stop typing.
Since WipperSnapper supports such a large number of components, there is keyword filtering. Try searching for various keywords, like:
- component names:
aht20
,servo
,buzzer
,button
,potentiometer
, etc - sensor types:
light
,temperature
,pressure
,humidity
, etc - interface:
i2c
,uart
,ds18x20
,pin
, etc (also I2C addresses e.g.0x44
) - vendor:
Adafruit
,ASAIR
,Infineon
,Bosch
,Honeywell
,Sensirion
, etc
There are added product and documentation links for every component, follow the links beneath the component descriptions to be taken to the appropriate product page or Learn Guide.
Select the MCP9808 from the list of results to go to the component configuration page.
There will be a back button if you select the wrong component, and you can use the Edit component icon (⚙️) on the device page to update the component configuration in the future.
On the component configuration page, the MCP9808's I2C sensor address should be listed along with the sensor's settings.
The MCP9808 sensor can measure ambient temperature. This page has individual options for reading the ambient temperature, in either Celsius or Fahrenheit. You may select the readings which are appropriate to your application and region.
The Send Every option is specific to each sensor measurement. This option will tell the board how often it should read from the sensor and send the data to Adafruit IO. Measurements can range from every 30 seconds to every 24 hours.
For this example, set the Send Every interval for both seconds to Every 30 seconds. Click Create Component.
The board page should now show the MCP9808 component you created. After the interval you configured elapses, the WipperSnapper firmware running on your board automatically reads values from the sensor and sends them to Adafruit IO.
Read I2C Sensor Values
Now to look behind the scenes at a powerful element of using Adafruit IO and WipperSnapper. When a new component is created on Adafruit IO, an Adafruit IO Feed is also created. This Feed holds your sensor component values for long-term storage (30 days of storage for Adafruit IO Free and 60 days for Adafruit IO Plus plans).
Aside from holding the values read by a sensor, the component's feed also holds metadata about the data pushed to Adafruit IO. This includes settings for whether the data is public or private, what license the stored sensor data falls under, and a general description of the data.
Next, to look at the sensor temperature feed. To navigate to a component's feed, click on the chart icon in the upper-right-hand corner of the component.
On the component's feed page, you'll each data point read by your sensor and when they were reported to Adafruit IO.
Doing more with your sensor's Adafruit IO Feed
This only scratches the surface of what Adafruit IO Feeds can accomplish for your IoT projects. For a complete overview of Adafruit IO Feeds, including tasks like downloading feed data, sharing a feed, removing erroneous data points from a feed, and more, head over to the "Adafruit IO Basics: Feed" learning guide.
Text editor powered by tinymce.