ESP8266 is a low cost Wi-Fi capable microcontroller created by Espressif, a Shanghai based company. There are various modules that use the ESP8266 microcontroller that are listed below.


Non-exhaustive list of modules. For a complete list, see

These boards typically require an adapter board for about CAD$0.35 each if you plan on playing with it on a standard DIP breadboard.


ESP-01 modules expose only a couple GPIO pins. The ESP-01 package does not expose the EN pin which means you will not be able to put the chip in deep sleep and have it come back automatically.


These are about $2.00 USD each


These are about $1.80 USD each.


The difference between the ESP-12E and the ESP-12F is the on-board antenna.

Quick Usage[edit]

The ESP8266 runs on 3.3v and is not 5v tolerant. Use a voltage divider on the RX pin to step 5V to 3.3V. Applying more than 3.6V to any pin will damage the chip. Each pin can source a maximum of 12mA compared to 20-40mA for most Arduinos. There is one ADC but with a voltage range of 0.0-1.0V.


ESP8266-12E Wiring

To power on and play with the ESP8266, connect:

  1. Vcc to 3.3v
  2. GND to ground
  3. GPIO-15 to ground via 10k resistor
  4. GPIO-2 to Vcc via 10k resistor
  5. GPIO-0 to Vcc via 10k resistor (connect to ground directly to program)
  6. TXD to RX via Logic Level Shifter (connect to TX pin on Arduino board without the Atmel chip if you're using the board as a USB-UART device)
  7. RXD to TX via Logic Level Shifter (RX pin on Arduino board, same as above)
  8. RST to Vcc via 10k resistor. (Connecting this to ground will reset chip)
  9. EN (or CH_PD on some boards) to Vcc via 10k resistor

If you use an adapter board, the board might already include a couple resistors for GPIO-15 and the EN pins and can be ignored.

A logic level shifter is required if your USB serial adapter is only 5v. Simply connect the 3.3v side to the LV side of the logic level shifter and the serial side to the HV side.

If your USB serial adapter has DTR, use 2 10K resistors to form a voltage divider and connect the reset pin between the divider for automatic reset when code is uploaded. Otherwise, reset the ESP8266 manually by shorting out the RST pin to ground while simultaneously connecting GPIO-0 to ground to enter programming mode.

Arduino IDE[edit]

To write custom code for the ESP8266, start the Arduino IDE.

Add the ESP8266 boards:

Additional Arduino boards in IDE
  1. File -> Preferences -> Additional Boards Manager URLs, add:
  2. Tools -> Board -> Board Manager -> Search for ESP8266 -> Install
  3. Select NodeMCU 1.0 (ESP 12-E Module)

To upload your code to the ESP8266:

  1. Power off the ESP8266
  2. Connect GPIO-0 to ground (disconnect from the 10k pull up)
  3. Power on the ESP8266
  4. Compile & Upload code in Arduino IDE

You may wish to change the upload speed from the default 115200 baud to speed up the upload process.

Boot Modes[edit]

When the ESP8266 boots, it will go into one of 3 boot modes depending on the GPIO pins:

0V 0V 3.3V Uart Bootloader
0V 3.3V 3.3V Boot sketch (SPI flash)
3.3V x x SDIO mode (not used for Arduino)
  • Uart Bootloader mode is used to upload code to flash
  • Boot sketch (SPI flash) mode is used to boot from flash memory

Deep Sleep[edit]

When using ESP.deepSleep(30e6), GPIO 16 should be connected to the RST pin. The ESP8266 will wake itself up by sending a LOW to RST which will reset the device.

AT Command Reference[edit]

New out of the box, the stock firmware (ESP8266 NONOS SDK) will boot and begin accepting AT commands immediately over serial at 115200 baud. You will see garbage being dumped when the ESP8266 boots because the espressif boot ROM will write a boot log at 74880 baud (




 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 2408, room 16 
tail 8
chksum 0xe5
load 0x3ffe8000, len 776, room 0 
tail 8
chksum 0x84
load 0x3ffe8310, len 632, room 0 
tail 8
chksum 0xd8
csum 0xd8

2nd boot version : 1.6
  SPI Speed      : 40MHz
  SPI Mode       : QIO
  SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000



+CWLAP:(3,"HP-Print-9D-Officejet Pro 8610",-84,"94:57:a5:95:cc:9d",1,25,0)
+CWLAP:(3,"Hi Clayton!",-82,"a8:4e:3f:74:52:a8",1,18,0)
+CWLAP:(3,"Winternet is Coming",-75,"88:1f:a1:2e:a7:8a",4,-24,0)
+CWLAP:(0,"HP-Print-AC-ENVY 4500 series",-79,"50:65:f3:ea:39:ac",4,30,0)
+CWLAP:(3,"HP-Print-9C-Officejet Pro 8620",-67,"6c:c2:17:1e:da:9c",11,15,0)
+CWLAP:(3,"Lannon's Guest Network",-76,"ba:8d:12:63:d8:7c",11,13,0)



To flash the stock firmware (NON-OS), get the SDK and the flashing tools from:

Source code can be found at:


Constantly Crashing[edit]

You absolutely need some decoupling capacitors because the initial power-on current draw might be enough to cause the microprocessor to crash. When this happens, you will see a stack printout over and over over the serial console similar to:

ets Jan  8 2013,rst cause:2, boot mode:(3,0)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d

Soft WDT reset


ctx: cont
sp: 3ffffc20 end: 3fffffc0 offset: 01b0
3ffffdd0:  00000000 4000420c 60000200 3ffef00c  
3ffffde0:  00000100 40004ac0 00000100 003fe000  
3ffffdf0:  00000100 3ffeefcc 3fffc718 003fe000  
3ffffe00:  0000049c 00e8a101 40105584 0000049c  
3ffffe10:  3ffeefcc 0000049c 003fe000 0000049c  
3ffffe20:  3fffc718 3ffeefcc 000003fe 401001f0  
3ffffe30:  003fe000 4022e2e6 000003fe 4023a800  
3ffffe40:  3ffef46c 4022e39f 3ffeefcc 0000049c  
3ffffe50:  000003fd 3fffff20 3ffeefcc 4022e382  
3ffffe60:  ffffff01 55aa55aa 00000003 00000020  
3ffffe70:  00000020 000000c2 000000c2 aa55aa55  
3ffffe80:  000003ff 4022e86c 3ffeefcc 3ffeefcc  
3ffffe90:  00000001 feefeffe feefeffe feefeffe  
3ffffea0:  40105789 00000001 3ffeefdc 4022ea64  
3ffffeb0:  3ffedf30 3ffeefcc 00000001 3fffff20  
3ffffec0:  3fffff40 3ffef003 00000003 00000020  
3ffffed0:  3ffef08c 3fffff81 00000001 4022eb36  
3ffffee0:  3fffff20 4023a460 3fffdad0 3ffee348  
3ffffef0:  3ffef3cc 3fffff40 3ffeefcc 4022eb05  
3fffff00:  3ffeefcc 4022eb6c 3ffee2e0 00000000  
3fffff10:  402013a8 feefeffe 3ffeefcc 4022e48a  
3fffff20:  3ffee300 000000db 000000db 40203440  

This issue seemed to have disappeared once I put a 100uF and 0.1uF capacitor on the power rails.

See Also[edit]