This tutorial covers everything you'll need to build and run your own freezer temperature monitor and alert system. We'll cover how to build the device, setting up a free online database, flashing code onto the device, monitoring the database and sending email alerts. The components used in this project can measure temperatures as low as -200 celsius.
This project takes about 60 to 90 minutes to build.
Materials | Description | Vendor |
---|---|---|
Adafruit Feather Huzzah32 (a) | WiFi enabled ESP32 based prototyping board | Adafruit |
Adafruit MCP9600 (b) | I2C Thermocouple amplifier | Adafruit |
Adafruit Type K Thermocouple (c) | 2 wire thermocouple effective temperature ranger -200c to 800c +/-2c | Adafruit |
Jumper Wires (d) | Adafruit | |
Breadboard (e) | Adafruit | |
Micro USB cable | Used to power the ESP32 board | Adafruit |
USB Power Supply | Adafruit |
Software | Description | Link |
---|---|---|
AdafruitIO | Online database | https://adafruit.io |
IFTTT | Online automation platform | http://ifttt.com |
Tools |
---|
00 Philips Head Screw Driver |
Soldering Iron |
-
Solder the pins to the bottom side of the MCP9600.
Tip: Put the pins in the breadboard to hold them in place when soldering.
-
Insert the ESP32 and thermocouple amplifier into the breadboard.
-
Follow the wiring diagram below to connect the thermocouple amplifier to the ESP32 using your jumper wires.
-
Connect the Thermocouple to the screw terminals on the MCP9600
The picture below use a generic ESP32 Dev board, new picture with the Adafruit Huzzah32 coming soon!
Clone this repo to your computer, or you can download the directory for this project here
Once you downloaded the project files you'll need to create a config.h file and fill in your AdafruitIO and WiFi credentials.
-
In the FreezerTempAlert folder create a new text file called config.h
-
Copy and paste the code below into that that file and save:
/************************ Adafruit IO Config *******************************/ // visit io.adafruit.com if you need to create an account, // or if you need your Adafruit IO key. #define IO_USERNAME "your-username" #define IO_KEY "your-key" /******************************* WIFI **************************************/ #define WIFI_SSID "your-ssid" #define WIFI_PASS "your-password" #include "AdafruitIO_WiFi.h" AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
-
Find your Adafruit IO credentials in the top right corner of the Adafruit IO webpage.
-
Copy and paste them in here between the quotes:
#define IO_USERNAME "your_username" #define IO_KEY "your_key"
Remember to treat your key like a password
-
Next you will need to add the WiFi SSID, or network name, and the password. Note: The code doesn't support WiFi networks that use a captive portal.
#define WIFI_SSID "your_ssid" #define WIFI_PASS "your_pass"
-
Open FreezerTempAlert.ino and change the threshold temperature to the temperature you wanted to be alerted at. The default temperature is -50 celsius.
// Set the temperature you want to be alerted at const float thresholdTemperature = -50;
-
Follow the first section of this guide to add the ESP32 extension to the Arduino IDE.
-
Install the libraries listed below using Arduino's Library manager. If you have used the library manager before here is a helpful guide.
- Adafruit IO Arduino
- Adafruit MCP9600
Note: If you're prompted to install other dependencies for these libraries, select Install All
-
With FreezerTempAlert.ino open in the Arduino IDE select Tools>Board>Adafruit ESP32 Feather
-
Select the active COM Port in Tools>Port
-
Note: If you output monitor prints out Connecting......._____ you'll need to press the boot button on your ESP32 board. You may have to press boot more than once for it to work.
-
Open the Arduino serial monitor to verify that everything is working properly on the board.
-
Go back to Adafruit.io and check that both the temperature feed and the temp_alert feed were created.
You'll use If This Than That (IFTTT) to set up automated alerts to your email any time the temperatures goes above a threshold. The threshold is set to -50c by default.
- Log in to your IFTTT account and press the Create button in the top navigation.
- Select the + button to add a trigger.
- Search for Adafruit
- Follow the prompts to connect and authenticate your Adafruit IO account.
- Once your account is connected choose the Any new data trigger.
- Select temp_alert from the drop down menu.
- Select the next + to set your action.
- Scroll down or search for the Email action
If this is the first time you're using the email action a pin will be sent to you to confirm that you are the owner of the email account.
- Customized the email message and select create action
- Finally select finish, your IFTTT service is ready to go.
Now that you project is built and your services are setup you can install the thermocouple in the freezer. You can use a binder clip or a magnet to keep it in place. The ESP32 board should be kept outside the freezer. Many breadboards come with an adhesive back, you can use that to secure your project to the side of the freezer.