Introduction: Get Started With ESP8266 Using "AT Commands" Via Arduino

Picture of Get Started With ESP8266 Using "AT Commands" Via Arduino

ESP8266 Wifi Module is an integrated chip designed for communicating to the world of the internet through Wifi radio signals. It is the link between a project and the internet. It has on-board processing and memory that allows it to be integrated with electronics through its GPIOs. The ESP8266 can be used to connect your Arduino projects to the internet.

In this instructable, you will get started with the basics of ESP8266 and how to program it using an AT commands.

Step 1: Parts

These parts are needed to program your ESP8266:

1 - ESP8266

2 - Arduino Uno

3 - Resistor 330 Ω

4 - Resistor 180 Ω

5 - Jumper Wires

6 - Mini Breadboard

Step 2: Connecting the ESP8266

One of the ways to programming the ESP8266 is throughout the Arduino micro-controller board. The ESP8266 is programmed using AT commands; when received, it replies with an acknowledgment. The ESP8266 is powered up using a 3.3 Volts power source, An Arduino Uno will be able to power up the ESP through its regulated 3.3 V power pin.

The ESP8266 is connected to the Arduino through TXD, RXD, GND, and the VCC pins to the RX, TX, GND and 3.3 V pins, respectively (If you are using an Arduino MEGA). The TX received from the Arduino should be connected to a voltage divider so that RXD of the ESP8266 receives a signal of 3.3 volts logic and not 5 volts. If the signal is received in 5 volts, the ESP8266 will malfunction. The voltage divider will be explained in the next step.

If you are using an Arduino Uno, then follow the steps:

Arduino --------------------------------------------------- ESP8266

Pin 10 (Software RX) -----------------------------------> TXD

Pin 11 (Software TX) -------> Voltage Divider -----> RXD

GND --------------------------------------------------------> GND

3.3 V --------------------------------------------------------> VCC

3.3 V --------------------------------------------------------> CH_PD

Step 3: The Voltage Divider

Picture of The Voltage Divider

The voltage divider is used to produce an output voltage that is a fraction of the input voltage. We will use the voltage divider between the TX of the Arduino and RXD of the ESP8266 to produce an output voltage of 3.3 V.

I have used a 180 Ω resistor and a 330 Ω resister, as R1 and R2, respectively.

Use this website if you have different resistor values.

Step 4: Programming

After the connection of the pins mentioned above, the following code is uploaded to the Arduino to enable serial communication between the serial monitor and the ESP8266 through the Arduino. When a command is entered into the serial monitor on the computer the Arduino will relay it to the ESP8266. Download the Arduino code attached and upload it to the Arduino Uno board.

Step 5: AT Commands

Picture of AT Commands

There are many AT commands that can be used to program the ESP8266 Wifi module. Check them out here. The following AT commands should be written in the Arduino’s serial monitor (in order) to program the ESP8266:

  1. “AT” This will check if the module is connected properly and its functioning, the module will reply with an acknowledgment.
  2. “AT+RST” This will reset the wifi module. Its good practice to reset it before or after it has been programmed.
  3. “AT+GMR” This will mention the firmware version installed on the ESP8266. (Optional)
  4. “AT+CWLAP” This will detect the Access points and their signal strengths available in the area.
  5. AT+CWJAP=”SSID”,”PASSWORD” This connects the ESP8266 to the specified SSID in the AT command mentioned in the previous code.
  6. “AT+CIFSR” This will display the ESP8266’s obtained IP address.
  7. If the user wants to disconnect from any access point then use the following AT command AT+CWJAP=””,””
  8. “AT+CWMODE=1” This sets the Wifi mode. It should be always set to Mode 1 if the module is going to be used as a node (Like our mobile’s connection to the access points)
  9. After this step is done, repeat step 2 to reset the Wifi Module. “AT+RST”

Now you can connect your ESP8266 to the internet and get started with IoT.


Ahmer07 (author)2017-11-04

I have tried as described above but I ain't getting any response from ESP8266-01 on sending AT commands. What could be the problem?

AliA430 (author)Ahmer072017-11-11

have you tried uploading any other code to the esp before following this guide?

esp8266-01 doesn't respond upon sending " AT " if the esp doesn't have the AT firmware in it , there are many tutorials on how to upload the AT firmware to esp follow those then try sending " AT " hopefully you will receive response from esp then

digitalmeth (author)2017-07-06

Guys I need some help. I follow all the steps with the connections, voltage divisor and everything, but when I type "AT" in the console I get an upside-down question mark. The question mark is not even from the module, because if I disconnect the RX and TX I still get the mark.

What happens with the GPIO0 pin, does it have to be connected (GND is to program the module)?

Previously I programmed the module with a code to blink the on-board diode and it worket perfectly, did it lost the ability to communicate with AT commands? (even though I dont think the problem is in the module).

Please help me, I am grateful in advance!

digitalmeth (author)digitalmeth2017-07-06

And one note, arent the 0 and 1 pins on Arduino UNO R3 the RX and TX pins?

digitalmeth (author)digitalmeth2017-07-06

Also, I have the GPIO15 and GPIO2 pins connected to GND.

KashifM8 (author)2016-04-07

warning: espcomm_sync failed

error: espcomm_open failed

error: espcomm_upload_mem failed

when i upload code then it gives this error???????

a1m918 (author)KashifM82016-08-29

PRESS the RESET button just before the IDE says "UPLOADING" while hold down the FLSH button. See the image attached.

I am guessing that you are using Arduino IDE version 1.6.10. Try using version 1.6.9.

FABLAB Dhahran (author)KashifM82016-05-04

Hey KashifM8,

Make sure that you have selected Arduino UNO under Tools --> Board.

I haven't faced this problem before! If you figured out a solution then please share it with us.

Good luck :)

RomaR6 (author)FABLAB Dhahran2016-05-05

can you help me please?

i do all this step and connected it to the router but now i need to controll on led with esp8266 (turn on and turn off) from computer wifi ?

what i need to do that?

help me if you can please.

KashifM8 (author)KashifM82016-04-14

i am applying 3.3 voltage from arduino . I have also checked by voltage regualtor 3.3..I am using esp8266-12 module

FABLAB Dhahran (author)KashifM82016-04-14

Please check the power that you're supplying to the ESP. If you're sure it's ok, then make sure of all your connections.

NguyenT32 (author)2016-08-05

Interesting!!. Thanks

aagrawal35 (author)2016-04-30

it's not taking any commands
n just showing garbage values regularly non stop

Hey aagrawal35!
If you followed the same steps mentioned above, and connected everything correctly. Then open your serial monitor and click on "Both CR & NL" (Next to the baud rate).

Best of luck.

ROPHI (author)2016-03-16


FABLAB Dhahran (author)ROPHI2016-03-17

Thanks ROPHI

Cgiff (author)2016-03-16

great project, thanks for sharing

FABLAB Dhahran (author)Cgiff2016-03-17

You're welcome :)

Stay tuned for more

Jonathanrjpereira (author)2016-03-16

Great Instructable for beginners with the ESP8266 like me.

Enjoy it :)

ROPHI (author)2016-03-16


mchenaoua (author)ROPHI2016-03-16

I'm glad you find it INTERESTING :D

ROPHI (author)2016-03-16


About This Instructable




More by FABLAB Dhahran: Ladder Shelf Ludo Candle Holder
Add instructable to: