Fork me on GitHub

Project Notes

#534 ESP-12 Programming

The basics of programming an ESP-12 with the ESP8266 core for Arduino.


Here’s a quick demo..



I bought some ESP-12E ESP8266 modules a while back, along with some adapter boards but they’ve been sitting in a drawer ever since. Time to crack them open!

These notes cover the basics of programming the devices with ESP8266 core for Arduino, using the Arduino IDE.

ESP-12 Features

  • 20 active pins
    • GPIO 0-15 all have a built-in pull-up resistor, just like in an Arduino.
    • GPIO16 has a built-in pull-down resistor.
    • GPIO2 has a built-in LED (may be on GPIO1 on other boards)
  • 4Mib flash
  • Requires 3.3V supply
  • PCB trace antenna


I’m using a breadboard layout with:

  • the ESP-12 on an adapter board
  • separate 3.3V power supply for the ESP
  • CH340 USB to TTL adapter
  • level-shifter for 5V signals to/from the USB to TTL adapter



Demo Sketch

The ESP12Programming.ino sketch is a simple demonstration of GPIO input and output:

  • button press (GPIO13)
  • sequences output on GPIO 2, 4, 5, 12, 14, 16.

An LED bargraph module is used for display of the GPIO output.

Programming with ESP8266 core for Arduino

My selected settings in the Arduino IDE:


The adapter boards have fixed pull-up/down resistors included:

  • 10kΩ pull-down on GPIO15
  • 10kΩ pull-up on CH_PD

Externally (on the breadboard):

  • 10kΩ pull-up on RESET (with pushbotton to pull-down)
  • 10kΩ on GPIO0 (switchable as pullup/pull-down)

Programming mode is engaged by:

  • set GPIO0 to pull-down
  • toggle reset

Run mode is engaged by:

  • set GPIO0 to pull-up
  • toggle reset

Compile and push the code with the Arduino IDE:


Credits and References

About LEAP#534 ESP8266
Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects, usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting (IMHO!).

The projects are usually inspired by things found wild on the net, or ideas from the sources such as:

Feel free to borrow liberally, and if you spot any issues do let me know. See the individual projects for credits where due. There are even now a few projects contributed by others - send your own over in a pull request if you would also like to add to this collection.