If you do not already have an Adafruit IO account set up, head over to io.adafruit.com to link your Adafruit.com account to Adafruit IO.
The first step is to create a new Adafruit IO feed to hold the data from the temperature sensor. Navigate to the feeds page on Adafruit IO. Then click Actions -> Create New Feed, and name this feed rx.
- If you do not already know how to create a feed, head over to Adafruit IO Basics: Feeds.
Now that we have feeds to hold data and display the type of data, we need a way to consolidate these feeds in one place. Dashboards are a feature of Adafruit IO which allow us to display and control feeds using widgets called Blocks.
- If you haven't used an Adafruit IO Dashboard before, check out the Adafruit IO Basics: Dashboards learn guide for a quick primer.
- Navigate to the Adafruit IO Dashboards page.
- From the Actions dropdown, click Create a New Dashboard.
- Name the dashboard Temperature Armband.
The MCP9808 temperature sensor sends data to Adafruit IO once per minute. We'll want a way of displaying historical data on the dashboard. From the dashboard, click the + button to create a new block.
From the modal, Click the Line Chart block.
A gauge is a read only block type that shows a fixed range of values. We'll add a gauge block to display the real-time value from the wearable temperature monitor in real-time
- Select the rx feed.
- Set the Block Title to Temperature.
- Set the Gauge Min Value to 94 (or 34 if you're measuring degrees Celsius).
- Set the Gauge Max Value to 107.6 (or 42 if you're measuring degrees Celsius).
- Set the Gauge Width to 50px.
- Set the Gauge Label to Degrees F (or Degrees C if you're measuring degrees Celsius).
The gauge will change color if the value goes out of bounds.
- Set a Low Warning Value to 96.
- Set the High Warning Value to 100.4
Set Decimal Places to display to 1.
You may also optionally show an icon next to the value. To do this:
- Tick the Show Icon checkbox
- Set the icon to thermometer
Your dashboard should look like the screenshot below:
Actions are a way to do something when a certain situation occurs. We'll be using a reactive action to email us if the rx feed receives a value from the thermometer above our fever-threshold.
Navigate to your Adafruit IO account's Triggers page. Click Actions, then click Create a New Action
Select the Reactive Action
Next, we'll configure the action.
- Under If, select the rx action feed.
- For the comparison, select Greater Than or Equal to.
- For the Comparison Value or Feed, enter 102 (we're in the US, so our fever threshold is measured in degrees Fahrenheit. Change this value to 38.9 if you're planning to measure temperature in degrees Celsius).
- Select email me for the action.
You are also going to need your Adafruit IO username and secret API key.
Navigate to your profile and click the View AIO Key button to retrieve them. Write them down in a safe place, you'll need them for the next step.