How to Setup the ESP8266 Arduino IDE with the NodeMCU V3 (ESP8266 ESP12e)
The easy way to use the ESP8266 is with the Arduino IDE and this
ESP8266 Arduino tutorial shows you how to install drivers into the
Arduino IDE to program the ESP8266. It then shows you an example sketch
The Lolin nodeMCU V3 breakout
board is an ESP-12E style ESP8266 breakout board which makes it very
easy to use an ESP8266 device - you just plug it into a micro USB
connector and its ready.
Lolin nodeMCU V3 Board
The board includes its own 3V3 power supply regulator, a reset button, a Flash button and a
USB-to-serial chip (CH340G on mine). You can just plug it into a USB
port (micro USB connector) and start using it.
When you follow the instructions
below, you can program the Lolin NodeMCU as if it were any other Arduino
device. This is convenient since it uses the same familiar Arduino IDE
Note: Just so you don't get confused: Lolin is a manufacturer name - I
originally thought it meant some kind of extended range radio (similar
to a Lora device).
Warning: The Lolin nodeMCU V3
comes with the LUA scripting language flashed into it. Using the ESP8266
Arduino IDE as described below will overwrite the contents of the ESP8266. To get
LUA back you can re-flash the firmware.
(LUA is interactive scripting language - requiring no compilation,
working through a serial interface - but you need to learn another
Starting the nodeMCU
When you power up the nodeMCU for the first time you will see this
message - when you connect a serial terminal on the PC - such as Tera Term
- at 9600, 8 bits, 1 stop bit, no parity (8 1 N):
This is a LUA interface which is an interactive script system - you can
commands directly at the prompt to get the ESP8266 to perform. However
the rest of this page shows you how to use the Arduino programming
environment to program the board in C/C++ as you would with any other
If you continue past this point and Flash the Arduino sketch then
the LUA environment will be overwritten. If you want to use LUA again
you will need to re-flash the firmware.
ESP8266 Arduino Tutorial
Install USB To Serial Drivers
The first step in setting up the ESP8266 Arduino IDE is to plug in
the NODEMCU and check the Windows device Manager for an entry in the
If you don't see the NodeMCU showing up as shown below then you will
need to install drivers. The other possibility is that the NodeMCU is
using too much power - I found it would not work from a powered hub but
only from direct connection to the PC USB port. It needs 400mA!
External Power Source
Note: You can add an external power source to the Vin connection on
the board with voltage >5V. Also connect ground labelled 'G' to complete the circuit.
Warning: The AMS1117 absolute maximum input voltage is 15V - do not go above this i.e. do not supply a voltage to 'Vin' above 15V.
ESP8266 Arduino IDE Boards Manager
To setup the board use the board manager:
Add the following text to the "Additional Boards Manager URLs":
This will allow NODEMCU boards to appear in the main menu alongside boards such as the Arduino Uno.
Now Install the nodeMCU Boards
Start the Boards manager dialogue. Click Boards Manager...
Search for and install the "esp8266 by ESP8266 community" Entry.
Now select the nodeMCU 1.0 (ESP-12E Module) entry - this is the base
type for nodeMCU. nodeMCU is actually the firmware running on an ESP8266
Now check that you have similar information to the following - especially these:
Board "nodeMCU 1.0 (ESP-12E Module)"
Upload speed "115200baud"
CPU frequency "80MHz"
Flash Size "1M (3M SPIFFS)"
Warning: I originally set the Flash Size to 4M no SPIFF -
only the WiFi scanner example below worked - The SPIFFS is a virtual
file system that allows programs to occupy a space separate to the wifi
operational part - its like having a virtual SD card so make sure you
use the setting above (or at least allow some SPIFFS room).
ESP8266 Arduino Example Sketch
Use the ESP8266 Arduino IDE to load the following sketch - just
copy to white area of the IED and hit the upload button. This shows you a
quick example of the ESP8266 Arudino wifi capability.
// Set WiFi to station mode and disconnect from an AP if it was previously connected
// WiFi.scanNetworks will return the number of networks found
Serial.println("no networks found");
Serial.println(" networks found");
// Print SSID and RSSI for each network found
// Wait a bit before scanning again
ESP8266 Arduino Example Output
Here's the typical output from the sketch using the serial monitor.