Fork me on GitHub

Project Notes

#534 ESP-12 Programming

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

Build

Here’s a quick demo..

clip

Notes

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

Construction

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

Breadboard

Schematic

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:

programming_settings

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:

programming_upload

Credits and References

About LEAP#534 ESP8266

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

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics 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.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader