Maker Hacks

Ideas, news and tutorials for makers and hackers โ€“ Arduino, Raspberry Pi, 3D printing, robotics, laser cutting, and more

  • Home
  • About Maker Hacks
  • Blog
  • YouTube Channel
  • Courses
  • Recommendations
  • Contact
You are here: Home / Hacks, Tips, and Tutorials / How to Make a DIY “Internet of Things” Thermometer with ESP8266/Arduino

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

Chris Garrett

FacebookTweetPin

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

FacebookTweetPin

by Chris Garrett Filed Under: Hacks, Tips, and Tutorials Tagged With: 3d printing, arduino, esp8266, iot

NB. This website uses affiliate links, so if you make a purchase after clicking we might get a couple of dollars in return. The amount you pay, and our opinions, are not affected by this, and any commission goes to help keep the site running.

Discover everything you need to know to be successful and have fun with 3D printing

3D PRINTING WORKSHOP

3d printing workshop

Get it now before full release and you canย choose your own fair price!

Understand 3d Printing, How 3d Printers Work, Trouble Shooting, Both With Video and Ebook Downloads, Plus the Opportunity to Ask Questions Live

FIND OUT MORE

« Warp-free ABS printing on the Wanhao Di3
2010 MacBook Pro SSD and Battery Upgrade »

The website for makers and hackers โ€“ Arduino, Raspberry Pi, 3D Printing and more

Get fresh makes, hacks, news, tips and tutorials directly to your inbox, plus access to the next 3D CAD and Printing online training!

For a limited time only – Get the Robot Building course absolutely free!

3d printing workshop

Maker Hacks on YouTube

  • Email
  • Facebook
  • Instagram
  • Twitter
  • YouTube

Recently Popular

  • 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

Find it here

Recent Posts

  • It’s my Birthday – a gift for you!
  • Raspberry Pi Amiga Emulation Part 2 – How to Setup Your Raspberry Pi 3/4 with PiMiga Amiga Emulator + Games Bundle
  • Glowforge Long-Term Review
  • Raspberry Pi Amiga Emulation Options
  • Raspberry Pi with actual Commodore 64 Keyboard – BMC64 Pi, NO Keyrah required!

The website for makers and hackers โ€“ Arduino, Raspberry Pi, 3D Printing and more

Get fresh makes, hacks, news, tips and tutorials directly to your inbox, plus access to the next online training!

Add your name and email address below:

Recently Popular

  • 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

Search

Get fresh makes, hacks, news, tips and tutorials directly to your inbox, plus access to the next online training!

Add your name and email address below:

The website for makers and hackers โ€“ Arduino, Raspberry Pi, 3D Printing and more

Get fresh makes, hacks, news, tips and tutorials directly to your inbox, plus access to the next 3D CAD and Printing online training!

For a limited time only – Get the Robot Building course absolutely free!

Add your name and email address below:

Recent Posts

  • It’s my Birthday – a gift for you!
  • Raspberry Pi Amiga Emulation Part 2 – How to Setup Your Raspberry Pi 3/4 with PiMiga Amiga Emulator + Games Bundle
  • Glowforge Long-Term Review
  • Raspberry Pi Amiga Emulation Options
  • Raspberry Pi with actual Commodore 64 Keyboard – BMC64 Pi, NO Keyrah required!

Copyright © 2020 Maker Hacks