Introduction: Programming ESP8266 ESP-12E NodeMCU V1.0 With Arduino IDE Into Wireless Temperature Logger

Picture of Programming ESP8266 ESP-12E NodeMCU V1.0 With Arduino IDE Into Wireless Temperature Logger

Back in late 2014 and early 2015, your truly came across

this nifty WiFi Chip ESP8266 (the ESP-01) and have to battle among the inconsistent documentations from various sources. For the spur moment, he documented his frustrations (findings) as an instruction guide ESP8266 guide or on instructables ESP8266 guide . In due course, the ESP8266 WiFi has opened a whole new window of opportunity for him and his padawans.

The caveat at the moment of writing in 2014/2015 was to find a way to eliminate the “middle” MCU, the well-loved Arduino Uno (or Arduino Mega). It doesn’t make sense to forgo the ESP8266 that sports a 32bit CPU by using an Arduino Uno that sports an 8bit CPU for computations. Over the several months of dec14 to sept15, several IDE flavours/methodologies was released on the Internet to use standalone ESP8266, e.g to use ESP8266 and the available IO pins sans the Arduino Uno or Arduino Mega. From retrospective view, the cost of deploying an IoT framework to collect data has gone down drastically with just the standalone ESP8266 alone as the sentinel device. The flavours of standalone mode are ESP8266 Lua, and ESP8266 Arduino IDE. Check out the reference section for details.

also on blog:

Programming ESP8266 ESP-12E NodeMCU v1.0 with Arduino IDE as wireless temperature logger
wireless temperature logger ESP8266 NodeMCU v1.0 with Arduino IDE Streaming IoT sensor data using ESP8266 NodeMCU v1.0 ESP12-E with Arduino IDE Streaming sensor data using ESP8266 NodeMCU v1.0 ESP12-E with Arduino IDE to Thingspeak.

Step 1: Parts Needed

In this write up, yours truly is introducing the use of NodeMCU v1.0 (black) with ESP8266 Arduino IDE 1.6.5. There are lots of write up on the NodeMCU v0.9 or ESP8266 ESP-01 and variants with LUA, but information is scarce for NodeMCU v1.0 and ESP8266 Arduino IDE. This post is also a superseding update of an earlier how-to post of using ESP8266 ESP-01 with Arduino Mega and the temperature data is streamed to thingspeak .

Parts needed


1x DS18B20 temperature sensor with 4.7k resistor across vcc and data pin

1x NodeMCU v1.0 (black)

1x Access Point Connected to Internet


ESP8266 Arduino IDE

Source code available at the footer

Thingspeak account setup, and API key acquired.

Step 2: Methodology

Picture of Methodology

Caveat: the physical pin2 on NodeMCU v1.0 does not corresponds to pin D2 in Arduino IDE. Check out the URL in the references.

1. It is assumed that the Access Point is able to access to internet, and a thingspeak account is set up accordingly.

2. Connect 3.3v and gnd from NodeMCU v1.0 to DS18B20 respectively.

3. Connect data from DS18B20 to pin4 on NodeMCU v1.0 (in code, it will be used as pin2)

Connect microUSB to NodeMCU v1.0

Step 3: Methodology

Picture of Methodology

1. Launch ESP8266 Arduino IDE, Select Tools -> Board -> NodeMCU v1.0; and ensure parameters are correct. Refer to screenshot.

2. Ensure the libraries required are installed, Select Sketch -> Include Libraries -> Manage Libraries or add zip library

3. Program the source code to read DS18B20 using one wire protocol and the acquired data to be sent to thingspeak. (source code at the end)

Step 4:

Picture of

1. Compile & upload source code to NodeMCU v1.0

Step 5:

Picture of


data update of sensor data on thingspeak.

Step 6: Observation, Implications, What's Next


Having done the above, congratulations on sending sendor data using NodeMCU v1.0 with Arduino IDE. Now the biggest question comes begging, does this ESP8266 Arduino IDE supports all the fancy pansy libraries supported on vanilla Arduino IDE?? That is for us to discover and update on the git hub page.


Internet enable any of your creations realised on Arduino Uno (or mega) have become even simpler than previously thought. Yours truly traversed the era of sending serial data, packing data for Ethernet, WiFly, ZigBee, and now ESP8266. ESP8266 is very convenient to use.

What’s next?

Alright, time to internet enable my sous vide setup: temperature sensor DS18B20 data streamed over the Internet to a cloud computing facility to compute PID and then output the control data over the internet to control the state of the solid state relay that in turn controls the AC appliance. Earlier yours truly have controlled a IoT lamp from a virtual machine, now is to connect the dots.

Step 7: References


KenBlanch (author)2017-05-24

Hi I am trying this project but I get a Error compiling for board NodeMCU 1.0 (ESP-12E Module), Message when verifying the sketch I have tested the Print_IP_Address sketch it works OK but if I add the line #include <OneWire.h> or #include <DallasTemperature.h> I get the error could someone tell me how to fix this.

#include <DallasTemperature.h>

diegofer29 (author)2017-02-13

buenas noches, empeze a utizar la tarjeta hace poco, el problema es que cuando la utilizo en mi pc me funciona bien , pero cuando la conecto a una fuente externa y trato de enviar el programa me sale error. lo publque aqui por que es lo unico que encontre de la nodemcu1,0 gracias por responder

ErickB46 (author)diegofer292017-04-20

has encontrado algo al respecto?

logico (author)2016-08-29

Hi, Great project.
is it possible to read and display from several sensors and send over wifi ?


surgupta (author)2016-06-07

getting error

In file included from D:\nodemcu\programs_arduin0\temperature_logger\temperature_logger.ino:6:0:

C:\Users\WTC\Documents\Arduino\libraries\OneWire/OneWire.h:108:2: error: #error "Please define I/O register types here"

#error "Please define I/O register types here"


exit status 1

Error compiling for board NodeMCU 1.0 (ESP-12E Module).

MuhammadD19 (author)surgupta2016-06-09

same here. how can we fix this error?

rickylee64 made it! (author)2016-04-29

Neat project. Went together pretty smoothly. Took me a few goes to set up the Arduino IDE with ESP8266. Now to add more DS18B20 probes and install them in my solar hot water!

shinteo (author)rickylee642016-04-29

congratulations! looking forward to see your solar hot water system. hook me up to the URL when it is ready.

PeterP101 (author)2016-01-31

Hi, man

This is my first big project. I want try this but Arduino Ide said:

'connectWifi' was not declared in this scope

....please help me, what i should do? :)

Bernyboogie (author)PeterP1012016-02-18

if you have arduino ide version 1.6.7

cut & paste....

void setup()

void loop()

to the bottem of the sketch.

PeterP101 (author)Bernyboogie2016-02-22

works great, thanks!!!

GokulP3 (author)2015-12-19

I couldnt find the arduino sketch!!!!!!!!!!!!!

detox888 (author)GokulP32016-01-26

CalvinM1 (author)2016-01-08

Is there a way to connect a 16X2 LCD to it?

shinteo (author)CalvinM12016-01-10

with or without a LCD "backpack"?

About This Instructable




Bio: Your focus determines your reality
More by shinteo:Seal the DealHome Automation ChatbotPrivacy Goggles an Urban Armour
Add instructable to: