Programming ESP-12E _ ESP-12F _ NodeMCU With Arduino IDE - Circuit Journal
Programming ESP-12E _ ESP-12F _ NodeMCU With Arduino IDE - Circuit Journal
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:
2. Arduino Code
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:
NodeMCU
Video tutorial:
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
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
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).
In all of the following examples, I am going to use the simple "Blink" sketch.
"File->Examples->01.Basic->Blink"
// 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);
}
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.
Required components:
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)
Optionally you can solder the ESP module onto an 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
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.
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.
After a successful upload, you should see a blue LED blinking on the board.
If you have already opened the "Blink" example (File->Examples->01.Basic->Blink), you can now click
on the "Upload" button.
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.
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
These programmer boards cost from 10 to 20 USD, but the good news is that you need to buy only
one.
Required components:
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.
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.
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:
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.
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
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
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.
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.
MediaGet Ads by
a ide M
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:
NodeMCU
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
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