ESP-12F: ESP8266 Module - Minimal Breadboard for Flashing

127K10520

Intro: ESP-12F: ESP8266 Module - Minimal Breadboard for Flashing

In this Instructable I will show you how to build the minimal circuit in order to flash a user program to the ESP-12F ESP8266 module.

This instructable is following the first testing of the module and is the second of my ESP8266 collection.

It can be used to flash a sketch done with Arduino IDE as I will show you here but the same circuit can be used in order to flash back again the AT commands software or to upgrade the SDK.

STEP 1: Parts Needed

The Hardware needed is the same as in my the first test plus a breadboard.

Here is the list:

  1. ESP-12F Module from ebay for example around 2.31USD
  2. An USB to serial TTL UART Module (like CP2102 from ebay for exemple): 1.24USDA
  3. 3.3V Power supply like MB102 from ebay: two for 1.67USD
  4. A Breadboard starting from a few dollars on ebay for example
  5. An optional ESP-12 adapter like this ones from ebay: 3 for 1.20USD

If you are using the ESP-12 Adapter follow this step in order to solder the ESP-12F module on the adapter.

STEP 2: Mount the Power Supply on the Breadboard

Please set the to jumpers on both sides of the breadboard to 3.3v.

Then plug the power supply on the breadboard.

STEP 3: Wire the ESP-12F on the Breadboard

If you are using the adapter module like mine then you can see on the first photo that no space remains on the sides for wirering.

So the wireing has to be done before putting the module on the breadboard.

Wire in such a way that you have the corresponding pins of the module available on the breadboard in the same order. I have labelled on one of the picture the pins.

At the end of this step you have the power supply on one side the ESP-12F on the other leaving plenty of space on the breadboard.

STEP 4: The Minimal Circuit

First lets see the schematic. You can find some ressources for example on ESP8266 Arduino Github.

  • EN (CH_PD) Enable Pin has to be pulled up (R1)
  • RESET Pin has to be pulled up (R3). In order to retart the module we connect also a push button to ground (S1)
  • In all of the boot modes
    • GIO15 has to be pulled down (R2)
    • GIPO2 has to be pulled up (R4)
  • GIPO0 has to be pulled up (R5) for running the program (flash boot). I has to be low in order to enter programming mode (UART). For this we add the S2 push button.
  • We also connect the USB to Serial port
    • GND are connected together
    • RX module is connected to TX serial
    • TX module is connected to RX serial

Furthermore we add a capacitor between VCC and GND.

STEP 5: What the Breadboard Should Look Like

If you are not using the adapter module the breadboard should look like in this drawing.

We connect all the pins of the ESP-12F in the same order on the breadboard in order to have them in advance wired.

It makes a lot of wires but this will be usefull for our future testing. For a final design I would use only the usefull wires.

STEP 6: Real Wiring

As we are using the adapter module we do not have to connect R1 and R2. They are already in the adapter module.

C1 has to be placed the closer possible to the module.

STEP 7: First Program

We are doing here a very simple program.

Start Arduino IDE and if not done already follow this instructions to install ESP8266 addon: http://esp8266.github.io/Arduino/versions/2.3.0/d...

Entrer this first program:

/* example from  http://www.arduinesp.com/examples  */
/* to be flashed directly to ESP8266 */
int ledPin = 2;
void setup() 
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

STEP 8: Select Board

Select Generic ESP8266 Module in boards.

Look at all the other settings.

Select the right COM port.

STEP 9: Flash

Run "Upload" in Arduino IDE.

Get ready for restarting the module: keep pressed the FLASH button.

When "esptool.exe .... -cp COM...." appears in the messages area then quickly press and release RESET. Then release FLASH button.

You should see in the messages area the flashing process.

After the flashing the you should see the the blue led blinking.

STEP 10: Using Wifi to Control GPIO2

This is another simple sketch.

It creates a http server on the ESP8266 allowing you to turn on and off GPIO2.

Set in line 16 and 17 the credetials to you WiFi network.

Have a look on you Serial connection on your computer. This will show you the IP address of esp8266.

This shetch showed me one thing: the LED on the ESP-12f is connected between VCC and GPIO2.

STEP 11: Files

Here is the Fritzing file of the Hardware.

6 Comments

i got to the download stage, pushing all the right buttons, got garbage symbols on the monitor. Here are the error messages. Any help?
sptool v0.4.13 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to ck
setting baudrate from 115200 to 115200
setting port from COM1 to COM11
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: can't receive command response header
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 12 instead of C0
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Hi,

thankyou for your manual.

I have an issue, in the step 9, I cannot select the port bacause it's grey.

If I connect my Arduino, the port comes back black.

I have checked more times the connections, but seems that all is linked as described by you.

Can you give me some suggestion?

Thankyou!!!

Dear Sir,

Please, I want to upload one program in the module ESP8266 12 F,

but without success.

See the picture in the attachment.

I work all as You said here.

Only direct connection PC-Arduino UNO-ESP826612f.

VCC 3.3V, GND, TX-TX i RX-RX.

My initial source program is on desktop of the PC.

How can I solve this noted problem on the picture!?

A lot of Thanks.

Vladimir Đorđević,

Serbia.

Hello, I think you have to connect as follows:

TX to RX

RX to TX

Hi Sir,

I made the same project. It works fine but there is one issue. Communication of webpage with esp8266 goes off randomly and I need to push reset button for esp to make that connection again and then it works fine again for some random period of time. My router is working properly and everything is as per you mentioned in this page.

Please help me how to get rif of this issue.

Thanks

I found most of what you posted useful. However mine still would not load. I found out (possibly)the chip I got had bad firmware or wrong firmware. I went to http://dembryo.com/how_to_esp12f and down at the bottom they had download for a gui that did load the nodeMCU firmware. After updating, loading of the firmware I only had to hit the reset while holding down flash button on my custom board (made from your schematics thank you), just prior to load. It then worked great.

Thank you

Sherm