Maker.io main logo

ESP8266 IoT Temperature Sensor

2019-06-06 | By ShawnHymel

License: Attribution Capacitors Resistors

In the fourth episode of my Bantam Tools milling machine video series, I show how to create a double-sided printed circuit board (PCB) for fast and easy prototyping.

 

To view parts 1 - 3 click the links below.

In an effort to create a reason for why someone might need a double-sided PCB, I threw together a quick-and-dirty Internet of Things (IoT) sensor using an ESP8266 and an MCP9808 temperature sensor. As to be expected, I used KiCad to create the PCB. In a sense, I created a sort of “temperature sensor throwie.”

If you would like to create your own version of this throwie or use it as the basis for your own IoT sensor design, you are more than welcome to download the schematic, layout files, and code from the following GitHub repository:

https://github.com/ShawnHymel/esp8266-temp-proto

If you are curious about the electrical design, it can be found in PDF form here.

You will need to mill your own board or send out the KiCad layout files for production by a professional manufacturer. If you want solder mask and silkscreen, you will need to run a new set of gerbers from within KiCad.

 Cover-image

Next, order the parts found in the bill of materials (BOM) and solder them to the board. You will need to connect a Serial-to-USB converter to upload code to the board.

1_connect

Press and hold both buttons. Release the RESET button while still holding the PROG button. After 1-2 seconds, release the PROG button. This will put the ESP8266 in bootloader/programming mode. From here, you can upload the esp8266-temp-get.ino Arduino sketch found in the Firmware section of the repository. Don’t forget to update the WiFi SSID and password along with your server’s IP address.

With Python installed, run the server.py program found in the Software section of the repository. This will run a simple web server that listens for HTTP requests on your computer. Plug in power to the ESP8266, and it should connect to your network. After a moment, it will sample temperature from the sensor and send that to your web server. Temperature readings should be printed to the console.

2_command

And there you have it! A fast prototype of an IoT device that transmits temperature data over WiFi to a local server.

制造商零件编号 MBR120VLSFT3G
DIODE SCHOTTKY 20V 1A SOD123FL
onsemi
¥5.54
Details
制造商零件编号 LTST-C171KRKT
LED RED CLEAR SMD
Lite-On Inc.
¥1.94
Details
制造商零件编号 NPTC051KFXC-RC
CONN HDR 5POS 0.1 TIN SMD
Sullins Connector Solutions
¥7.65
Details
制造商零件编号 S2B-PH-K-S
CONN HEADER R/A 2POS 2MM
JST Sales America Inc.
¥0.81
Details
制造商零件编号 RC0805FR-07220RL
RES 220 OHM 1% 1/8W 0805
YAGEO
¥0.81
Details
制造商零件编号 RC0805FR-0710KL
RES 10K OHM 1% 1/8W 0805
YAGEO
¥0.81
Details
制造商零件编号 RC0805FR-074K7L
RES 4.7K OHM 1% 1/8W 0805
YAGEO
¥0.81
Details
制造商零件编号 RC0805FR-071KL
RES 1K OHM 1% 1/8W 0805
YAGEO
¥0.81
Details
制造商零件编号 1825910-6
SWITCH TACTILE SPST-NO 0.05A 24V
TE Connectivity ALCOSWITCH Switches
¥1.30
Details
制造商零件编号 AP2112K-3.3TRG1
IC REG LINEAR 3.3V 600MA SOT25
Diodes Incorporated
¥4.15
Details
制造商零件编号 MCP9808-E/MS
SENSOR DIGITAL -40C-125C 8MSOP
Microchip Technology
¥11.40
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum