Introduction: Get Your ESP8266-12 Ready for AT Commands

Picture of Get Your ESP8266-12 Ready for AT Commands

ESP8266 is a System on Chip (SoC) which is widely used on Internet of Things (IoT) for its "tiny in size and low in price". I purchased two of this chip at VolumeRate.com for $5.42 each six months ago and until last week I decided to play with it, to twist my mind with codes :D

There are so many tutorials out there to get started with this ESP8266 such as :

I read them all and tried the different wiring methods but I still could not get it run the AT commands through Serial connection. Three days I kept tinkering until it finally works. I am so delighted. Seems like the ESP8266 has so many versions of default setting from manufacturer.

Then I decided to write this instructables so that other people who encounter the same problem with their ESP8266 modules can solve it faster.

Here I use ESP8266-12 complete with the breadboard adapter and 3.3V power regulator. It is said that you can safely connect it to the 5V power supply but surely not recommended. It is also said that this wifi module will draw more current than that your PC/Laptop usb port can provide. But I think it will not draw too much power on AT commands which are mostly used for setting up the module. And yes I plug it in 3.3V on my Arduino UNO which is powered by my laptop usb port :D [do this at your own risk as I did it at mine].

On the second picture, you'll see that GPIO4 and GPIO5 labels are swapped on adapter board. Some site says that the board fix it. I will figure it out on my next project :D

Step 1: Soldering

Picture of Soldering

Firstly I solder the ESP-12 on adapter board. You should take deep breath then hold your breath to solder those tiny pins. Ha ha .. not really, but sure you need a good quiet place and steady breathing to get a good soldering result.

Secondly, I solder the 3.3V power regulator at the bottom of the board.

Then comes the pin headers. On my first ESP-12, I soldered the pin headers normally. Later I found that it is not breadboard friendly because the adapter board takes the whole width of breadboard. No way for jumper wires to connect to ESP-12 pins unless you put some wires from the bottom of the board to the open space.

Second try, I mod the pin headers so that they come out half on top and half on the bottom of the board. I put the headers from the bottom heading top and solder from the top [image #1]. Then use cutter or wire cutter or tweezers to remove the black plastic that holds the pins [image #2]. I saw that the bottom headers are longer then the top headers, while we do need the top headers long enough to connect with the female header jumper wires. So I would say that you should put the headers from top to bottom and then solder the bottom part of the pins [image #3]. Now we can sit the ESP-12 on breadboard and also connect the pins using female header jumper wires.

On image #4 you see that I solder a 104 (0.1 uF) decoupling capacitor across VCC and GND, that's when I was desperate making this module to work (-_-" ) some articles said that we only need it when we have several unwanted auto-resets. Finally I removed the cap and keep it in the box. Who knows I might need it later ...

Step 2: Wiring

Picture of Wiring

Prepare 6 resistor with high value, 10K or above. I put four of them as pull-up resistors (connect to 3.3V) and two of them as pull-down resistors (connect to GND). I do need these resistors to make it works while some people don't.

  • GPIO15 (grey) -> pull-down
  • GPIO2 (blue) -> pull-up
  • GPIO0 (purple) -> pull-up
  • CH_PD (green) -> pull-up
  • REST (orange) -> pull-up
  • TXD (black) -> Arduino TX (pin D1)
  • RXD (white) -> Arduino RX (pin D0)
  • VCC (red) -> breadboard V+ rail
  • GND (brown) -> breadboard GND rail
  • Arduino 3.3V (red) -> breadboard V+ rail
  • Arduino GND (black) -> breadboard GND rail

If you are lucky enough, you should be able to run AT Commands by now. If you are not, don't be sad, you have the chance to explore the fun of flashing firmware later. Just keep reading ;-)

Step 3: Arduino Serial Monitor

Picture of Arduino Serial Monitor
  • Plug your Arduino to USB port.
  • Open your Arduino IDE.
  • Open the "Tools" menu.
  • Select your board : Arduino/Genuino Uno.
  • Select your Arduino COM port.
  • Open Serial Monitor.
  • On the bottom right part select "Both NL & CR"
  • Then select your serial baud rate. My esp-12 default is 9600. Some got 115200 for default.

Some people get "Ready" on their serial monitor screen but I don't. To test if it works or not, type "AT" (without double quotes) and press enter. If it works, you will get a reply message "OK". Then you can continue with other AT Commands listed here:

http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module#AT_Commands

https://room-15.github.io/blog/2015/03/26/esp8266-at-command-reference/

If it doesn't reply "OK" to you, then continue to next step.

Step 4: Putty Terminal Emulator

Picture of Putty Terminal Emulator

Three Alternatives to Arduino Serial Monitor by James Lewis.

Here I use Putty Terminal Emulator on Windows 10.

  • Pick "Serial" on the radio button.
  • Type in your Arduino COM port on "Serial line".
  • Type in "76800" baud rate on "Speed". This is default speed for ESP8266 boot message.
  • Press the "Open" button.

By looking at your boot message, you can search what kind of problem that prevent your ESP-12 communicating through AT Commands. In my case I got this message :

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)  

load 0x40100000, len 25020, room 16 
tail 12 
chksum 0xef 
ho 0 tail 12 room 4 
load 0x00000000, len 0, room 12 
tail 0 
chksum 0xef 
load 0x00000000, len 0, room 4 
tail 0 
chksum 0xef 
csum 0xef 
csum err 
ets_main.c 

Searching on the net, I found the solution the next day saying that we should flash the firmware with SPI mode : DOUT (Dual Read Operation). I was following the instructables by RaviP6 for flashing esp8266 firmware and I flashed successfully, only that AT Commands still not working and I got that error message at boot. Back to the flasher tool, there is no "DOUT" option as mentioned can fix the problem. Keep searching the net and I found another more advance flasher tool with more options.

Step 5: Flashing a Firmware

Picture of Flashing a Firmware

  • For flashing a new firmware to ESP-12 we need to put the GPIO0 to pull-down resistor (purple wire).
  • Download ESP Flash Download Tool V1.2 to your local drive and unpack it on a folder.
  • Download ESP8266_AT_V00180902 Command Firmware and unpack it on the same folder with Flasher Tool so that it will be easier to find.
  • Run Flash_Download_Tool_v1.2.exe
  • Pick your downloaded firmware into Download Path Config.
  • Set the ADDR : 0x00000.
  • Set the SPI Mode : DOUT.
  • Set your Arduino COM Port.
  • Set the baud rate 115200 (or 9600).
  • Press the start button.

Hopefully everything goes well or you might get another version of ESP-12 with different problem to solve :D

Now put back the GPIO0 wire (purple) to pull-up resistor and reset your ESP-12.

Go back to Step 3 (Arduino Serial Monitor) to see if the AT Commands is now working or not.

Good luck, Pals. Please share in comment section if you encounter different problem or you have solution to any ESP-12 Getting Started problem ^_^

Comments

diy_bloke (author)2016-11-16

allow me just one more remark.
You ordered at volumerate.com (DX). I am not sure how the various prices were 6 mo ago but currently that module plus adapter plate will cost you 5 usd at the link you provided.
I think most people know aliexpress, but just want to point out that the module is much, much cheaper there. I saw prices of 1.84 USD. only need to add a 30 ct adapter plate.

the price of 5USD at volume rate is even higher than the wemos d1 mini at aliexpress that includes an usb plus voltage regulator plus pin headers.

So if you are new at this, check aliexpress, not just Volumerate.com

chienline (author)diy_bloke2016-11-16

That was last year, and yes price will vary, some offer chip only without adapter board. I love shopping at DX because they offers free shipping to my country. Other online stores have cheaper price but the shipping fee will be much more expensive than the item we are going to buy :D

But thank you for the information for others, and also for me. I will take a look at other module like wemos d1 mini maybe ;)

diy_bloke (author)chienline2016-11-16

I used to shop at DX a lot, love the store, but lately went to aliexpress. They offer free shipping too. Anyway, may be different on where one is located but it pays to shoparound.

The Wemos mini D1 is a good board, especially for development. Once that is done, just the ESP8266-12 on an adapter plate is a good choice for the final project, especially if you want to go low power

Leonegeek (author)2016-10-09

Hello, i don't have the tension regulator, to work i should take off the resistor on the middle?

chienline (author)Leonegeek2016-10-10

Did you mean voltage regulator? The middle resistor is zero ohm and it will connect to nowhere without the regulator, so I would say just leave it there as is. Without a voltage regulatoryou have to make sure that you feed it with 3V to 3.6V max according to the datasheet. Otherwise it will not work properly or maybe fried over-voltage.

diy_bloke (author)chienline2016-11-14

I think that if you remove it and do not use a regulator your chip will not get a Vcc voltage anymore. Mind you, if you do NOT use a voltage regulator, the Vcc pin is where you put your 3.3 volt and it goes directly to the V+ of the esp chip. When you solder in a regulator and put 5 volt on the Vcc that 5Volt still goes directly to the V+ of the esp chip, so you need to interrupt that connection so the 5V doesnt go immeditely to the espchip but first to the regulator in and from the regulator out to the chip. That interruption of the powerline is made with that 0 ohm resistor.
Therefore it is not a matter of ' just leave it' but rather 'you must leave it'.

It does connect to somewhere: it connects the Vcc pin to the V+ of the module.
On the other hand... if you put in the regulator you MUST remove the 0 ohm resistor, otherwise the in and out of the regulator are connected and you would be putting 5Volt on yr chip

chienline (author)diy_bloke2016-11-14

Thank you. I get what you mean. In short : keep the 0 ohm resistor if you are using 3.3V and remove it if you decide to use 5V.

diy_bloke (author)chienline2016-11-15

correct, sorry if i was longwinded about it :-)

ChristopherE7 (author)2016-06-15

Thank you for posting this tutorial! It tooks me days to get my ESP8266 12-E working, and with the resistors, it worked!!

chienline (author)ChristopherE72016-06-15

Yes, the pull up and pull down resistors seem like doing nothing but they keep the pins' state stable when not connected ^^
You are welcome ^^

baz1l (author)2015-11-08

I've been using these boards for almost a year now in their various forms and after some frustrating hours now find them easy to use and very useful. DO NOT under any circumstances try powering them with 5 volts this will destroy them there are many breadboard friendly 3.3 volt voltage regulators available use them. ESP's are very power hungry (up to 250mA) but will work off a usb port (500mA) but put a 10uF electrolytic cap across the power rails, most of my early problems with them was not having a good enough power supply. also take care driving darlington transistors as I have burned out two esp's driving them, put a 22K resistor between the GPIO and the base of the transistor. I'm working on various projects with them including model train speed control, burglar alarm sensors and rain sensor to name but a few, if I ever get any finished I will post them here.

gomibakou (author)baz1l2016-02-03

I think the max current each GPIO can source is 12mA, without checking the datasheet.

chienline (author)gomibakou2016-02-04

Yes, most people said that it is power friendly. Maybe depend on what sensor is plugged in it and the size of data it transmit :)

Yes @baz1l, please post your project on Instructables. We are all eager to see and learn :)

gomibakou (author)chienline2016-02-06

I cannot undersand who you could burn darlington transistors.. 12mA even less are more than enough to drive regular transistors because darlington configuration is made exactly to be used when the source cannot drive regular transistors, aka, when you normally need 20mA with darlington you could reduce this to 5mA, for example (i assume you are talking about saturation mode). Of course always use resistros to the base of transistors. Anyway in my opinion 12mA is just in the limit... but i don't think those chips are intended to be interfaces for sensors like microcontrollers can be, just their main purpose is being a WIFI adapter then, GPIO helps to connect with outside -local- world.

baz1l (author)gomibakou2016-02-06

I was using TIP121 transistors, their DC base current is 120mA according to their datasheet, initially I tried 4.7k resistors, made the mistake of not reading data first I had assumed that hey would be similar to Arduino. These device are pretty amazing check out this video

https://www.youtube.com/watch?v=SSiRkpgwVKY

baz1l (author)2016-02-04

Don't know if any of you guy's have come across this web site but I have found it very useful, http://nodemcu.readthedocs.org/en/dev/.

chienline (author)baz1l2016-02-04

This link is very useful indeed ;)
Thanks for sharing it to this community :)

baz1l (author)2016-02-04

Don't know if any of you guy's have come across this web site but I have found it very useful, http://nodemcu.readthedocs.org/en/dev/.

gomibakou (author)2016-01-31

It doesn't hurt having a decoupling capacitor in the supply. I used them normally, they are cheap and solve a bunch of heaches.

chienline (author)gomibakou2016-01-31

Yes, surely put one there. As now there is a finding that 100nF is not enough to cure, I am thinking of upgrading the size of the cap as long as it fits your project box :D

http://www.esp8266.com/viewtopic.php?f=6&t=497

gomibakou (author)chienline2016-02-03

Use a big electrolytic capacitor, 220uF, 470uF... you choose, together the 100nF ceramic. The electrolytic helps to supply the extra current the ESP can demand and smoothen the supply level, a "tank" capacitor. The ceramic is for bypassing high frequencies.

I had no problem with the ESP using that configuration (I use some lineal regulators from TI), until the RX pin was burnt (i suppose because it's not asnwering since i turned off-on the supply). I assume the FTDI board did something weird because RX is only connected to the FTDI (3.3V configuration), perhaps a voltage higher than 6V or so, dunno. The fact is the RX is not working anymore. Use some diode -zener- clamping just in case, as i'll do next time, or some transistor configuration.

chienline (author)gomibakou2016-02-04

Yes, this unique ESP chips have so many unpredictable problems. 10 people will encounter 10 different problems, can we call this bugs? But many succeeded too. So let's post any cool projects with it (^_^ )

Mine is halt temporary because I still can't find out how to ICMP Ping with it :D

paulle (author)2015-11-13

I wish you show the picture of how you solder the 3.3 v regulator

chienline (author)paulle2015-11-13

ah.. that tiny little guy :D
I missed that shoot. Well, I put little solder on the pads (on board). I used tweezers to hold the chip. Heat up (melt) the solder on the center pad and put your chip on it as best-aligned as possible. You then press the chip pins with your soldering iron tip, it will melt down the solder below. Just remember not too hot/too long or you will fry the chip. Ypu can add some more (not too much) solder on top for it will met down, fill the gap, and unite with the solder on the pad.

Sorry for no photos of that process. Tips from me is : take deep breath, make yourself calm, and do this in a peaceful quiet room :)

paulle (author)chienline2015-11-13

i never use the chip before. I just do not know which pin should go to what on the adapter module board.

chienline (author)paulle2015-11-13

If that is the case, you can refer to its shape. There are three pins on one side and one wide pin on the other side. Just align it with the solder pads on the board :)

chienline (author)2015-11-08

A year. Wow.. we should listen to experienced user like you :)
Can't wait to see your projects on instructables :)

mrmuzzio (author)2015-11-06

Nice tutorial, but I suggest you check the power delivered to the esp when you feed 5v to this board. I've discovered in the ones I bought here:

http://www.dx.com/p/esp-12e-wi-fi-module-adapter-b...

that the bottom regulator is bypassed by the smd resistor in the middle of the board on the other side. In the ones I have it's labelled 00 and you should remove them to prevent over powering the esp.

Good luck!

gomibakou (author)mrmuzzio2015-11-06

I found the same issue with mine, i was wondering what the resistor was doing there bypassing the vcc pin.

mrmuzzio (author)gomibakou2015-11-06

If you remove the center resistor the regulator provides a safe 3.3 v to the esp with a 5v supply, at least in my boards

chienline (author)mrmuzzio2015-11-07

Well, tracing the board resistors I draw it like this. This is view from top of the board, so power regulator is face-down.

The left 103 resistor is CH_PD pull-up resistor.

The Right 103 resistor is GPIO2 pull-down resistor.

Well, the middle 000 (Zero ohm) resistor is connecting Vin and Vss of the power regulator, I don't even know what the function is. Can someone explain further? I think we better replace it with 104 decoupling capacitor (^_^ )

gomibakou (author)chienline2015-11-07

I guess it was simply done to bypass the regulator just in case you use an external 3.3V source, in fact i think the designers were smoking something weird when they thought about that. You can connect different supplies in the same rail but caution, minimun you need some resistors to keep the balance between the different sources but this is a simple adapter board, so, makes no sense for me. This is a 00, aka a jumper wire... so..bypassing the regulator with a 5V supply that can fry the chip? unless you use a 3.3v supply. The module is not designed for direct 5V volts, so simple, even if they claim it does (have you seen any 3V TTL interface for RX-TX? i haven't so...).

chienline (author)mrmuzzio2015-11-06

Thank you. I will try it with one of my board later. 5V is more convenient I think. We can use any smartphone powerbank :)

chienline (author)gomibakou2015-11-06

This is the fun of learning electronic I think :D I will take a look on the board later. But so far I don't remove anything from the adapter board. Yet I dare not try to feed it with 5V :D

chienline (author)mrmuzzio2015-11-06

I have read that kind of tutorial too, but I don't understand what they mean by that. And also the shunt resistor part. Yes there are some extra holes on the adapter board around VCC and GND, but no tutorial about what they are for. And no extra component on the package. My best guess is that the holes are intended for what they say about "shunt resistor" or maybe for "decoupling capacitor". So many version about this chip. But lack of official manual and also the chip itself has no manufacture standard or has different standard on different version of production.

chienline (author)mrmuzzio2015-11-06

I wrote : "It is said that you can safely connect it to the 5V power supply but surely not recommended."
I never try to feed it with 5V yet. I use 3.3V from my Arduino UNO. But to be added here, once I plugged the power wires wrong on the breadboard, 3.3V (uno) to GND rail and GND (uno) to 3.3V rail. It took me a minute before I realized what I had done. But luckily, nothing happened. So I wonder if there is a shortcircuit protection on the chip, can anyone with better knowledge explain to us here? :)

About This Instructable

25,348views

155favorites

License:

Bio: Just an ordinary person who loves #thinking and #tinkering
More by chienline:DSLR Cowboy HolsterWoven Tag Hiding PlaceDouble Spaces Inhaler
Add instructable to: