0% found this document useful (0 votes)
12 views

Programming ESP-12E _ ESP-12F _ NodeMCU With Arduino IDE - Circuit Journal

This document provides a comprehensive guide on programming the ESP-12E, ESP-12F, and NodeMCU boards using the Arduino IDE. It covers the necessary setup steps, including adding the ESP8266 board to the Arduino IDE, connecting the boards via USB, and uploading Arduino sketches. Additionally, it discusses the differences between the ESP-12E and ESP-12F, as well as various programming methods and required components.

Uploaded by

daniwwww
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Programming ESP-12E _ ESP-12F _ NodeMCU With Arduino IDE - Circuit Journal

This document provides a comprehensive guide on programming the ESP-12E, ESP-12F, and NodeMCU boards using the Arduino IDE. It covers the necessary setup steps, including adding the ESP8266 board to the Arduino IDE, connecting the boards via USB, and uploading Arduino sketches. Additionally, it discusses the differences between the ESP-12E and ESP-12F, as well as various programming methods and required components.

Uploaded by

daniwwww
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

How-To Guides Tools About Me

Programming ESP-12E / ESP-12F


/ NodeMCU With Arduino IDE
Written by Indrek Luuk

eG a i d e M
MediaGet a ide M
Downloading
Download

The ESP-12E and ESP-12F are ESP8266 boards. ESP8266 is a low-cost WiFi-enabled microchip.

This article will explain how to prepare your Arduino IDE to upload sketches into the ESP8266
microcontroller and connect to an ESP-12E / ESP-12F board over USB.

It is also possible to upload Arduino Sketches to ESP8266 over Wi-Fi. You can do that after you have
successfully established the USB connection since the program running on the microcontroller needs
to be able to receive code updates over the network.

My article about programming the ESP-12E / ESP-12F / NodeMCU over the Wi-
Fi connection:

https://circuitjournal.com/programming-esp8266-over-wifi

I have tested all the connections and external modules mentioned in this article with the ESP-12E,
ESP-12F, and NodeMCU boards.

It will probably also work with the older ESP-07 AND ESP-12 (without any letters), but I haven't
experimented with those myself.

https://circuitjournal.com/esp8266-with-arduino-ide 1/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

The only difference between the ESP-12E and ESP-12F is the antenna shape. The antenna of the newer
ESP-12F is supposedly better optimized.

NodeMCU is an ESP-12E or ESP-12F based board with added power and serial circuitry. It is a bit more
expensive than a plain ESP-12E or ESP-12F, but it is easier to get started.
eG a i d e M

MediaGet
a ide M

Downloading
Download

Table of content:

1. Preparing Your Arduino IDE for ESP8266

2. Arduino Code

3. Connecting to ESP-12E/ESP-12F Board Via USB


3.1. Connecting a USB-to-Serial Adapter to ESP-12E/ESP-12F
3.2. Uploading Arduino Code to ESP-12E/ESP-12F With a Programmer Board
3.3. Uploading Arduino Code to ESP-12E/ESP-12F With a Witty Cloud Development Board
3.4. Uploading Arduino Code to NodeMCU
3.5. Uploading Arduino Code to ESP-12E/ESP-12F With a NodeMCU Board

https://circuitjournal.com/esp8266-with-arduino-ide 2/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

Disclosure: Bear in mind that some of the links in this post are affiliate links and if you go
through them to make a purchase I will earn a commission. Keep in mind that I link these
companies and their products because of their quality and not because of the commission I
receive from your purchases. The decision is yours, and whether or not you decide to buy
something is completely up to you.

ESP Modules:

A plain ESP-12E or ESP-12F

NodeMCU

Video tutorial:

Programming ESP-12E / ESP-12F / Nod…


Nod…

First, make sure you have the latest version of Arduino IDE:
https://www.arduino.cc/en/Main/Software

https://circuitjournal.com/esp8266-with-arduino-ide 3/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

eG a i d e M
MediaGet

a ide M
Downloading
Download

Then we need to add the ESP8266 to the Boards list.

Open the Arduino IDE Preferences panel.


On Windows: "File->Preferences"
On Mac: "Arduino->Preferences..."

Add the following URL to the "Additional Boards Manager URLs":


http://arduino.esp8266.com/stable/package_esp8266com_index.json

If you already have some existing board URLs, click on the little sub-form button after the field and
add the ESP8266 board URL to the end of the list.

https://circuitjournal.com/esp8266-with-arduino-ide 4/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

Open Arduino Boards Manager


"Tools->Board->Boards Manager..."

And search for "ESP8266" and click "Install."


Note: it may take a couple of seconds for the Boards Manager to download new board data before
you can search.

https://circuitjournal.com/esp8266-with-arduino-ide 5/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

Now you should see the "ESP8266 Boards" sub-menu under Boards.
Select "NodeMCU 1.0 (ESP-12E Module)" (it works for both ESP-12E and ESP-12F).

1. Preparing Your Arduino IDE for


ESP8266

In all of the following examples, I am going to use the simple "Blink" sketch.
"File->Examples->01.Basic->Blink"

Free AI Code Generation

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever


void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

2. Arduino Code
The next step is to connect the ESP-12E / ESP-12F module physically to your computer.

https://circuitjournal.com/esp8266-with-arduino-ide 6/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

There are a couple of different options depending on the board type and the tools you have.

If you have a dedicated USB-to-serial adapter board, you can use it to program the ESP-12E / ESP-12F.

Full (automatic reset) Simple (manual reset)

Required components:

A plain ESP-12E or ESP-12F

https://circuitjournal.com/esp8266-with-arduino-ide 7/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

USB-to-serial adapter
(the red board in the image is functionally the same as the black one in the schematic)

A bunch of jumper wires

10k pull-up resistors

A capacitor for the power input

Optionally you can solder the ESP module onto an adapter board:

ESP-12E/ESP-12F adapter board

IMPORTANT! The 3.3V power output of the USB-to-serial adapter is too weak to run the ESP-
12E / ESP-12F module. You need to use an external 3.3V power source.

Full (automatic reset) - if your USB-to-serial adapter has RTS output available, you can wire up fully
automatic connections. It means that you can click "Upload" in the Arduino IDE, then it will
automatically reset the ESP module and enter into programming mode. After a successful upload, it
will reset again, and your program will run.

Simple (manual reset) - some simpler adapter modules do not bring the RTS signal out as an
accessible output (even though the USB-to-serial chip on the board probably has it). In that case, you
need to connect the GPIO_0 pin to the ground and then reset the device manually. After successful
upload, you need to disconnect the GPIO_0 pin from the ground and reset again.

The ESP8266 has three different boot modes selected by the state of GPIO_15, GPIO_0, and
GPIO_2 at start-up.

https://circuitjournal.com/esp8266-with-arduino-ide 8/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

MODE GPIO_15 GPIO_0 GPIO_2

SDIO (Boot SD Card) 1 x x

UART (Upload Code) 0 0 x or 1

FLASH (Normal Running) 0 x or 1 x or 1

1. SDIO (Boot SD Card) - this mode is irrelevant for us. Since we never want to use it, we can connect
the GPIO_15 to GND via a 10k resistor.

Note: technically, you could also connect the GPIO_15 directly to the ground without a resistor. But if
you accidentally define GPIO_15 as output in your Arduino code and now set the pin to HIGH, it will
create a short circuit and probably damage the microcontroller.

2. UART (Upload Code) - we need to activate this mode to upload new code. Both GPIO_15 and
GPIO_0 pin need to be pulled down to the ground at the boot-up time. GPIO_2 may be left
unconnected (or pulled up to 3.3V).

3. FLASH (Normal Running) - this mode is for running your code. GPIO_15 must be pulled to the
ground, and GPIO_0 and GPIO_2 must be left either floating or pulled up to 3.3V.

Please note that the RX and TX signals need to be crossed:


USB-to-serial TX -> ESP's RX
USB-to-serial RX -> ESP's TX

The "chip enable" (EN/CH_PD) pin has to be pulled up to 3.3V. Otherwise, the ESP8266 will not run

You can make your life easier by soldering the module onto an adapter board.

It has the EN/CH_PD pull-up and GPIO_15 pull-down resistors pre-soldered. It also makes the ESP-
12E/ESP-12F breadboard and jumper wire friendly.

If your USB-to-serial adapter has a CH340 USB-to-serial chip on it, you may need to download
and install the CH340 drivers for your operating system:
https://sparks.gogo.co.nz/ch340.html

https://circuitjournal.com/esp8266-with-arduino-ide 9/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

If it has an FTDI or CP2102 USB-to-serial chip, the drivers should be included with your
operating system.

Now you can plug a USB cable into the USB-to-serial adapter, and it should show up in Arduino IDE.

Before connecting the USB. In my case, COM10 appeared after connecting


the USB cable to my USB-to-serial adapter.

Full (automatic reset)


If you have already opened the "Blink" example (File->Examples->01.Basic->Blink), you can now click
on the "Upload" button.

After a successful upload, you should see a blue LED blinking on the board.

Simple (manual reset)


If you made the simple connections, connect the GPIO_0 pin to the ground and reset the ESP-12E /
ESP-12F module. Now it should be in programming mode.

If you have already opened the "Blink" example (File->Examples->01.Basic->Blink), you can now click
on the "Upload" button.

3.1. Connecting a USB-to-Serial Adapter to ESP-


After the upload has finished, you need to disconnect the GPIO_0 pin from the ground and reset the
device again.
12E/ESP-12F
After a successful upload, you should see a blue LED blinking on the board.

The easiest way to load your sketch into a plain ESP-12E / ESP-12F is to buy a programmer board.
These are solderless, and the ESP module snaps onto it.

There are different types available. I have these two:

https://circuitjournal.com/esp8266-with-arduino-ide 10/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

Programmer type 1 Programmer type 2

These programmer boards cost from 10 to 20 USD, but the good news is that you need to buy only
one.

Required components:

A plain ESP-12E or ESP-12F

ESP-12E/ESP-12F programmer module

If your programmer board has a CH340 USB-to-serial chip on it, you may need to download
and install the CH340 drivers for your operating system:
https://sparks.gogo.co.nz/ch340.html

If it has an FTDI or CP2102 USB-to-serial chip, the drivers should be included with your
operating system.

Now you can plug a USB cable into it, and it should show up in Arduino IDE.

Before connecting the USB. In my case, COM10 appeared after connecting


the USB cable to my programmer board.

If you have already opened the "Blink" example (File->Examples->01.Basic->Blink), you can now click
on the "Upload" button.

After a successful upload, you should see a blue LED blinking on the board.

https://circuitjournal.com/esp8266-with-arduino-ide 11/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

Note! The programmer board's biggest downside is that you can't use it after soldering the ESP
module to your circuit.

One workaround is to do later updates over the Wi-Fi connection.

3.2. Uploading Arduino Code to ESP-12E/ESP-


My article about programming the ESP-12E / ESP-12F / NodeMCU over the Wi-
Fi connection:
12F With a Programmer Board
https://circuitjournal.com/programming-esp8266-over-wifi

The plain ESP-12E / ESP-12F module is not breadboard-friendly. So you most likely want to solder it
onto an adapter module.

The footprint of this adapter board matches the Witty Cloud Development Board.

If you buy one set of the Witty Cloud Development Board, you will get a USB board + an ESP-12F
board with some extra sensors.

https://circuitjournal.com/esp8266-with-arduino-ide 12/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

You can use the Witty USB board to program your plain ESP-12E / ESP-12F soldered onto the adapter
board.

Required components:

Witty Cloud Dvelopment Board

A plain ESP-12E or ESP-12F

ESP-12E/ESP-12F adapter board

HT7333-A 3.3V linear voltage regulator

IMPORTANT! You can't plug it into the Witty USB board immediately! The white adapter board
expects VCC to be regulated 3.3V, but the Witty board gives out 5V from the USB.

You need to remove the 0 Ohm resistor that connects the adapter board's VCC directly to the
VCC of the ESP8266.

https://circuitjournal.com/esp8266-with-arduino-ide 13/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

Then solder a 3.3V voltage regulator to the back of the white adapter board. It has a footprint for it. I
have used an HT7333-A.

IMPORTANT! Please note that the middle pin of the regulator footprint is Vin. Some voltage
regulators have the middle pin as Vout (like AMS1117) - you can not use these.

Unfortunately the footprint of the HT7333-A chip is a little smaller than the footprint on the board.
But you can still solder it onto the PCB.

The input of the HT7333-A can be 3.5V to 12V. It means that now you can power the board with
any voltage source in the range of 3.5V to 12V.

After these modifications, you can plug your ESP-12E / ESP-12F on top of the Witty Cloud USB board.

https://circuitjournal.com/esp8266-with-arduino-ide 14/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

If your board has a CH340 USB-to-serial chip on it, you may need to download and install the
CH340 drivers for your operating system:
https://sparks.gogo.co.nz/ch340.html

If it has an FTDI or CP2102 USB-to-serial chip, the drivers should be included with your
operating system.

Now you can plug a USB cable into it, and it should show up in Arduino IDE.

Before connecting the USB. In my case, COM10 appeared after connecting


the USB cable to my Witty board.

3.
3.3. Connecting
Uploading to ESP-12E/ESP-12F
Arduino Code to Board
ESP-12E/ESP-
If you have already opened the "Blink" example (File->Examples->01.Basic->Blink), you can now click

Via USB a Witty Cloud Development Board


on the "Upload" button.
12F With
After a successful upload, you should see a blue LED blinking on the board.

NodeMCU is an ESP-12E or ESP-12F based board with added power and serial circuitry. It is a bit more
expensive than a plain ESP-12E or ESP-12F, but it is easier to get started.
eG a i d e M

MediaGet
a ide M

3.4. Uploading Arduino Code to NodeMCU


Downloading LOOK what my wife
designed!

Download

Click to order!
https://teespring.com/get-the-electronic-scream

https://circuitjournal.com/esp8266-with-arduino-ide 15/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

Required components:

NodeMCU

If your NodeMCU board has a CH340 USB-to-serial chip on it, you may need to download and
install the CH340 drivers for your operating system:
https://sparks.gogo.co.nz/ch340.html

If it has an FTDI or CP2102 USB-to-serial chip, the drivers should be included with your
operating system.

Connecting a USB cable to the NodeMCU module is enough. It should show up in the "Tools-
>Port" menu.

Before connecting the USB. In my case, COM10 appeared after connecting


the USB cable to my NodeMCU board.

If you have already opened the "Blink" example (File->Examples->01.Basic->Blink), you can now click
on the "Upload" button.

After a successful upload, you should see a blue LED blinking on the board.

3.5. Uploading Arduino Code to ESP-12E/ESP-


12F With a NodeMCU Board
You can use a NodeMCU board to upload your Arduino code to a plain ESP-12E / ESP-12F.
eG a i d e M

MediaGet Ads by
a ide M

Send feedback Why this ad?

Downloading
Download

https://circuitjournal.com/esp8266-with-arduino-ide 16/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

Required components:

A plain ESP-12E or ESP-12F

NodeMCU

A bunch of jumper wires

10k pull-up resistors

NodeMCU is an ESP-12E or ESP-12F based board with added power and serial circuitry. It means that
if you disable the module soldered onto the NodeMCU board, you can attach an external ESP module
instead of it.

https://circuitjournal.com/esp8266-with-arduino-ide 17/18
4/17/25, 11:51 AM Programming ESP-12E / ESP-12F / NodeMCU With Arduino IDE - Circuit Journal

1. To disable the onboard ESP chip, you need to connect the EN pin on the NodeMCU board to
GND.

2. Connect RX to RX and TX to TX

3. Connect RESET to RESET and D3 (it maps to GPIO_0) of the NodeMCU board to GPIO_0.

These connections ensure that the external ESP module goes properly into programming mode when
you click "Upload" in the Arduino IDE.

4. Pull the EN/CH_PD of the external ESP module to 3.3V and GPIO_15 to GND.

5. And finally, connect the 3.3V pin of the NodeMCU module to VCC and GND to GND.

If your NodeMCU board has a CH340 USB-to-serial chip on it, you may need to download and
install the CH340 drivers for your operating system:
https://sparks.gogo.co.nz/ch340.html

If it has an FTDI or CP2102 USB-to-serial chip, the drivers should be included with your
operating system.

Now you can plug a USB cable into the NodeMCU. It should show up in the "Tools->Port" menu.
eG a i d e M

MediaGet
a ide M

Downloading
Download

Before connecting the USB. In my case, COM10 appeared after connecting


the USB cable to my NodeMCU board.

If you have already opened the "Blink" example (File->Examples->01.Basic->Blink), you can now click
on the "Upload" button.

The code is uploaded into the external module since the onboard soldered chip is disabled.

After a successful upload, you should see a blue LED blinking on the board.

Privacy Policy

Version: 6d524cb p: 0 ms s: 1 ms e: 5 ms

https://circuitjournal.com/esp8266-with-arduino-ide 18/18

You might also like