• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
Maker Hacks

Maker Hacks

Ideas, news & tutorials for makers and hackers – Arduino/Raspberry Pi, 3D printing, robotics, laser cutting, and more

  • Home
  • About
  • YouTube
  • Recommendations
  • Contact

How to Make a DIY “Internet of Things” Thermometer with ESP8266/Arduino

You are here: Home / Hacks, Tips, and Tutorials / How to Make a DIY “Internet of Things” Thermometer with ESP8266/Arduino
FacebookTweetPin
Author: Chris Garrett

I needed a temperature monitor for my 3d printer enclosure. Here's how I made a DIY "Internet of Things" Thermometer with ESP8266/Arduino

ESP8266 thermometer with LED displayThermometers are useful things in general, but especially when printing ABS in an enclosure. Part of the point of an enclosure is temperature control, right?

When I built my IKEA enclosure I knew I was going to need a temperature monitor, but an off the shelf thermometer wasn’t going to be enough. I needed it to work over the internet!

Want to see exactly how I did it? Read on!

Here it is in action:

Expertly installed 3d printer enclosure temperature monitor
Expertly installed 3d printer enclosure temperature monitor

As you can see, I probably need to position it better 🙂 But it works!

As well as showing the temperature (which is handy in person and over the Octoprint webcam), using the ESP8266 it shoots the current temperature up to my website so I can monitor the temperature from anywhere.

I made an enclosure for it, but I made the enclosure contain the small breadboards because I am not done tinkering with it yet.

What you need

  • TMP36 – Temperature Sensor
  • TM1637 LED 4-Digit Display Module
  • Either ESP8266 esp-12e “NodeMCU” (Arduino Compatible) board
  • OR Adafruit HUZZAH ESP8266 development board
  • Mini bread boards

Of course if you buy through my links I get a small commission. Hey I have a site to run 🙂

Shop around, though, and you will be able to get all of this stuff pretty cheaply.

Getting the TM1637 LED display working with Arduino / ESP8266

All this assumes you already have your Node MCU (or equivalent) already working with your Arduino environment, or are using an Arduino. The Node MCU is cheaper (especially in quantity), but the Adafruit Huzzah has more support and is better made. Both are excellent ESP8266 modules, and both are Arduino compatible.

Starting with the display, I chose a very simple segmented display module based around the TM1637, this is because the Node MCU ESP8266 board doesn’t have a wealth of pins and also because I am lazy 🙂

Avishorp has kindly shared an Arduino library that makes it very easy. You can use any digital pins you choose. Just download the latest version of the library and put it in your Arduino libraries folder.

There are four pins to take care of:

  • Ground
  • Power
  • CLK
  • DIO

Ground and power are self explanatory, and the unit can be powered off 3.3v or 5v, whichever works for your situation. When you initialize your display you tell it which pins you are using for data, so in my case I set it up like:

#define CLK D5
#define DIO D4
TM1637Display display(CLK, DIO);

Once that is set up, in your loop you can display the number you want to show by just using:

display.showNumberDec(1234);

Easy eh?

Getting the temperature

TMP36 Temperature Sensor
TMP36 Temperature Sensor

You probably have a temperature sensor in your toolkit already, especially if you got an electronics starter kit at some point in your life.

Careful, they are small and delicate 🙂

These guys have three legs.

  • Power
  • Data (connect to analog input)
  • Ground

Again, power can be 3.3v or 5v. Just remember what these things read is whatever voltage between 0 and 1.75v reaches your analog input pin.

You can read more about temperature sensors and Arduino here. We are just going to use a basic equation to turn voltage into degrees C.

 int reading = analogRead(sensorPin); // current voltage off the sensor
 float voltage = reading * 3.3; // using 3.3v input
 voltage /= 1024.0; // divide by 1024
 float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree with 500 mV offset
 //to degrees C ((voltage - 500mV) times 100)
 temperature = temperatureC;
 
 display.showNumberDec(temperatureC); // send to the display

Sending the temperature to the web

If you are using an Arduino, congratulations, you are done!

BUT WAIT

We are using an “Internet of Things” device for a reason!

Sparkfun has a nice write up for how to write values up to a website. I will elaborate more about what I am doing on mine, including the website backend that receives these values, in a future article 🙂

 

Code (including a preview of the sending to the web stuff)

Related

Category: Hacks, Tips, and TutorialsTag: 3d printing, arduino, esp8266, iot
FacebookTweetPin

About Chris Garrett

Marketing Director by day, maker, retro gaming, tabletop war/roleplaying nerd by night. Co-author of the Problogger Book with Darren Rowse. Husband, Dad, 🇨🇦 Canadian.

Check out Retro Game Coders for retro gaming/computing.

☕️ Support Maker Hacks on Ko-Fi and get exclusive content and rewards!

Previous Post:Warp-free ABS printing on the Wanhao Di3
Next Post:2010 MacBook Pro SSD and Battery Upgrade

Sidebar

  • Facebook
  • Twitter
  • Instagram
  • YouTube

Recently Popular

  • Gweike Cloud Review
  • How to choose the right 3D printer for you
  • Glowforge Review – Glowforge Laser Engraver Impressions, Plus Glowforge Versus Leading Laser Cutters
  • Original Prusa i3 Mk3S Review
  • Best 3D Printing Facebook Groups
  • Elegoo Mars Review – Review of the Elegoo Mars MSLA Resin 3D Printer
  • Glowforge ‘Pass-Through’ Hack: Tricking the Front Flap of the Glowforge with Magnets to Increase Capacity
  • How to Make a DIY “Internet of Things” Thermometer with ESP8266/Arduino
  • Wanhao Duplicator i3 Review
  • IKEA 3D Printer Enclosure Hack for Wanhao Di3
  • Creality CR-10 3d printer review – Large format, quality output, at a low price!
  • 3D Printed Tardis with Arduino Lights and Sounds
  • Anet A8 Review – Budget ($200 or less!) 3D Printer Kit Review
  • Make your own PEI 3D printer bed and get every print to stick!
  • Upgrading the Wanhao Di3 from Good to Amazing
  • How to Install and Set Up Octopi / Octoprint
  • Creality CR-10 S5 Review

Copyright © 2023 · Maker Hacks · All Rights Reserved · Powered by Mai Theme