The ESP8266 is a Wi-Fi module great for IoT and Home Automation projects. This article is a getting started guide for the ESP8266 development board.

About the ESP8266
The ESP8266 is a $4 (up to $10) Wi-Fi module. It allows you to control inputs and outputs as you would do with an Arduino, but it comes with Wi-Fi.
So, it is great for home automation/internet of things applications.
So what can you do with this low cost module?
- create a web server
- send HTTP requests
- control outputs
- read inputs and interrupts
- send emails
- post tweets
If you want to create a web server with the ESP8266, we highly recommend following our tutorial: Build an ESP8266 Web Server
ESP8266 specifications
- 11 b/g/n protocol
- Wi-Fi Direct (P2P), soft-AP
- Integrated TCP/IP protocol stack
- Built-in low-power 32-bit CPU
- SDIO 2.0, SPI, UART
Comparing the ESP8266 with other Wi-Fi solutions on the market, it is a great option for most “Internet of Things” projects! It’s easy to see why it’s so popular: it only costs a few dollars and can be integrated in advanced projects. We’ve published dozens of free ESP8266 projects and tutorials.
There is a successor of the ESP8266 – the ESP32. The ESP32 combines Wi-Fi and Bluetooth and is dual core. Read the following article to find the differences between the ESP8266 and the ESP32:
ESP8266 Versions
The ESP8266 comes in a wide variety of versions (as shown in the figure below). The ESP-12E or often called ESP-12E NodeMCU Kit is currently the most practical version, in our opinion.

We highly recommend using the ESP8266-12E NodeMCU Kit, the one that has built-in programmer and lots of GPIOs. The built-in programmer makes it easy to prototype and upload your programs.
For a comparison between the different ESP8266 boards, you can read the following article:
ESP8266 Pinout
The most widely used ESP8266 development boards are the ESP-01, the ESP8266-12E NodeMCU Kit and the Wemos D1 Mini. We’ll show you the pinout for those boards. If you’re using another development board, make sure you have the right pinout.
ESP-12E NodeMCU Kit Pinout
Here’s a quick overview of the ESP-12E NodeMCU Kit pinout:
WeMos D1 Mini Pinout
Here’s the Wemos D1 Mini pinout:
ESP8266-01 Pinout
Here’s the ESP-01 pinout.
We recommend taking a look at our ESP8266 GPIO guide that shows in great detail the function of each GPIO and how to use them:
Programming the ESP8266 Using Arduino IDE
There are several ways to program the ESP8266. We often use Arduino IDE or MicroPython.
You can follow one of the next tutorials to get started with the ESP8266 in Arduino IDE or MicroPython:
- How to Install the ESP8266 Board in Arduino IDE
- Getting Started with Thonny MicroPython (Python) IDE for ESP32 and ESP8266
Recommended ESP8266 Projects
After installing the ESP8266 board add-on in your Arduino IDE or flashing MicroPython formware, you can start making projects with the ESP8266.
We have a compilation with more than 30 projects and tutorials with the ESP8266:
To access all our MicroPython tutorials with the ESP8266 click here.
Here’s a selection of some of our most popular and beginner-friendly projects with the ESP8266:
- Home Automation Using ESP8266 Course
- ESP8266 Wi-Fi Button – DIY Amazon Dash Button Clone
- ESP8266 Web Server
- ESP8266 Weather Forecaster
- ESP32 with DHT11 DHT22 Temperature Humidity Web Server using Arduino IDE
- Door Status Monitor using the ESP8266
- ESP8266 0.96 inch OLED Display with Arduino IDE
Watch the ESP8266 Video Review
This video is a bit outdated but gives you a simple introduction to the ESP8266.
I just ordered some of the units and I am looking forward to your next video on the subject, they look very interesting thanks. Cheers, TerrenceJ.
Yup they are very interesting! I’ll be working on a new project in a few days.
Check out this video in the meanwhile to see how you can request data from the web: youtube.com/watch?v=qU76yWHeQuw
Hi Rui, do you remember me?
I have a trouble with arduino.
What kind of bluetooth module acceptable for Arduino leonardo? I wanna connect my leonardo with my Laptop by bluetooth.
Do you have any solution for this problem?
Hi, i’ve heard this module draws way too much power for the Arduino to handle, and that it is recommended to use and external source.
Did you notice any issues by using the 3.3v arduino output?
Thanks.
Hi Zam,
That’s a good question, people say that the USB port can’t supply enough current.
And that’s correct according to the ESP8266 module datasheet.
But in practice I’ve never had any problems. And I’ve been playing with my module for hours.
It always worked for me like this….
Hi,
nice tutorial 🙂
have you checked out the range?
Hi Rui,
How do we assign a fixed IP address to the esp8266, like 10.0.0.5
Thanking you
Hi Leslie you can run this command: AT+CIFSR
And It returns the ip of your ESP8266
I know we are all trying to crack the code, but I think that until this firmware is at a usable level we may encounter difficulty. Thanks for your support
I miss some sample code demonstrating the transceiver’s use. Sure, it’s connected to the serial comm pins and therefore it would be driven by sending AT commands and reading back responses through Serial functions, but it would be nice to have a concrete example showing how to setup / close a connection, send / receive data, etc.
I know Helio and thanks for pointing that out.
I’m working on those tutorials. I was just creating a basic example to establish the serial communication.
I’ll be posting a few days a tutorial with ESP8266 as a webserver.
Thanks!
Hi Rui, nice tutorial!
So the RX and TX pins will not have problem when connected to RX and TX pins of Arduino UNO whose high value is +5V? Don’t we need to put a voltage divider or level converter in between?
awesome module, is cheap !!!
I like work in monitor mode, how i can work?
Hi fer,
What do you mean?
Hi, I hooked this up as described and I am getting [Vendor:www.ai-thinker.com Version:0.9.2.4]
ready
But any AT commands only return garbage. Any ideas why?
Hi Joe,
Have you set your Arduino IDE to Both NL and CR?
Nice tutorial. But i got stuck! I’m using Arduino Due. When I am giving commands on Serial monitor, I’m getting junk values, though I tried every possible baud rates. I also set it for NL CR mode but nothing happens. Please solve it.
Thanks
When you apply power to your module (with the serial monitor open) does it say “ready”?
Hi, how can I apply power to the module using the serial monitor?
You mean if I, for example, reset the arduino board?
Sorry I didn’t understand your question.
What do you mean by applying power using the serial monitor?
Ciao a tutti,
I’m trying to upload a firmware in a ESP-01.
when i try to connect my ESP to FTDI with GPIO0 free i get
dl.dropboxusercontent.com/u/17441460/Esp8266_gpio0Libero.png
but when i put GPIO0 to GND my ESP 01 start to send me junk
dl.dropboxusercontent.com/u/17441460/Esp8266_gpio0GND.png
that is the circuit
dl.dropboxusercontent.com/u/17441460/circuito.jpg
where i’m wrong?
thanks a lot,
Vince
What happens when you connect GPIO 0 to VCC?
Dear Author,
For the latest firmware please find it at drive.google.com/open?id=0B3dUKfqzZnlwRjFaNTUzZFptbzg&authuser=2
or wiki page: electrodragon.com/w/ESP8266
The old link had been changed, sorry for it, and thank you!
Thank your for letting me know! All links were updated!
i tried to connect the esp8266 to the arduino for home automation system.
but the firmware flasher shows error “Failed to connect”.
please reply!
Have you followed this step?
In order to update your ESP8266 to the latest firmware version available, you need to change your circuit! GPIO 0 must be connected to GND pin.
I am trying to connect the esp 8266 to the arduino and trying to control a bulb using it. But there is a problem flashing the firmware.
I made the connections according to the following link:
iot-playground.com/2-uncategorised/17-esp8266-wifi-module-and-5v-arduino-connection
I also connected the GPIO0 to gnd and rst,chpd,GPIO2 to 3.3v
But there is an error in flashing the firmware . “failed to connect”.
And also flashed blank code to the arduino before trying to update the firmware as instructed by some links.
Please help!!
When you connect your ESP8266 to your arduino and you open the serial monitor in the Arduino IDE.
If you type AT (with both new line and carriage return) does it return OK?
No it does not respond to the AT command.
It simply shows connection timeout.
Remove the GPIO0 from ground again, and open the arduino IDE serial monitor
And experiment with different baud rates, some modules come with 115200
We tried all possible combinations but to no success…
We also tried conncting a capacitor between vcc and ground and a pull up resistor between vcc and ch_pd .
But the module does nt reply to the AT commands
Can u give us a link for the correct connections??
That would be a great help…
Thanks
i tried to connect the esp8266 to the arduino for home automation system.
but the firmware flasher shows error “Failed to connect”.
please reply!
Have you followed this step?
In order to update your ESP8266 to the latest firmware version available, you need to change your circuit! GPIO 0 must be connected to GND pin.
It is not clear how to use the folders & files that I see when I go to the link you provided to “Download the latest version of firmware available”. How do I use these files with the firmware flasher?
Here’s the direct download link: https://docs.google.com/uc?export=download&id=0B_BzxRImIcd-YXVfZTIyYURqdGc
hi Rui,
thanks for the tutorials. I have download the firmware flasher and followed the steps as shown. However after setting my COM port and click start, there was no green check icon appeared. How do I solve this?
Cheers!
Are you being able to send AT commands to your ESP8266?
(For example opening the Serial monitor in your IDE, type AT and get OK back?)
I have 2 ESP8266-01 modules. I have made a breakout board with all precautions.
– used LM1117 – 3.3V regulator. An ATX power supply gives 5VDC to get 3.3 VDC at ESP Vcc
– Grounds are connected.
– CH_PD & RESET pulled up to Vcc by 10K.
– GPIO0 & GPIO2 pulled up with 6k8.
– I use a PC with COM1 serial port connected to a RS232 (MAX232) to TTL converter and TeraTerm.
– Connected ESP Rx through R/2R (R=4k7) level shifter to TTL Rx and ESP Tx to TTL Tx.
When I power up the ESP sends out the message on TeraTerm showing version 9.2.4 with READY. The blue LED flashes with transmit. This means connections are fine.
But the ESP does not respond to any AT commands. The blue LED does not flash when I send any AT command. I tried many baudrates with CR/LF combinations. I pressed ENTER and then Cntrl j. No response. This is same for both my ESP modules.
Can someone please help resolve this very basic issue? What is the configuration for version 9.2.4?
I made exactly the same experience. Did you resolve the problem yet?
Thanks!
Hi Rui,
Is it mandatory we need to update the Formware ?
If we directly run the Arduino code by connecting esp8266 will it not work ?
Please respond. We have ordered the necessary hardware.
Thx
How can update the ESP8266 firmware only by web server without connect any GPIO to GND or VCC/or AT Command?
You need to connect the GPIO to GND. That’s the most reliable way to update the firmware.
Hola, he intentado programar el modulo como pone en la guía pero en el programa no aparece el icono de correcto, ha estado durante 5 minutos y nada cambia, el led rx del arduino está parpadeando continuamente.
Hi Rui! I have the Arduino connected to the wifi ESP8266 module and when I run an empty code in the arduino it let me execute the AT commands in the serial monitor. Doing this all the AT commands are working (the module connects with the wifi modem). However, when I submit any Arduino code (other peoples code) that uses the ESP8266 to connect to the wifi modem (and thus the internet), it doesn’t work. I mean, the AT commands that the code sent are not doing anything, they are not even written in the serial monitor, neither the answers that should be received after executing them.
Do you have any clue on what can be happening?
Thank you!
Parabéns pelo blog
sugestão https://github.com/nodemcu/nodemcu-firmware
é o firmware que estou a utilizar, muito bom mesmo
Hello Rui,
Great series and really helpful for starting the experiments on ESP8266.
I am working on making camera module with OV7670 and arduino along with SD card.
Wanted to check if we can use these wifi modules for transferring the pictures taken via arduino , OV7670 to my server. Or using the eye-fi card is the only option.
Thanks in advance.
Rahul
Hi Rui,
I wanted to ask if you can do a tutorial that talks about an application that controls the brightness of a lamp using esp 8266 module and the Arduino Mega 2560 ca for me would be a great help and thank you in advance
Whats the reasoning behind RX->RX and TX->TX
Hi
Did everything like you said (was confused about the weird drawing with a ftdi) but solved that in the line that GPIO 0 must be connected to GND pin.
Flashed it, get the green check icon but …
Cant’t do nothing with it.
Not responce from arduino serial monitor whatever command I send.
Just blank.
Did it go wrong or what?
Ray.
Hi Everyone
If this module is able to work independently, without the use of aurdino board ? If yes then how ?
Thanks in advance.
Here’s how you can create a web server with only the ESP8266: https://randomnerdtutorials.com/esp8266-web-server/
thanks alot Rui
When I run AT+GMR, it returns the following output:
“AT+GMR
AT version:0.21.0.0
SDK version:0.9.5
OK”
Does anyone know what’s going on here? All the firmware updates I’m seeing are to AT version 0.9.5.0, but mine says it’s 0.21.0.0? The SDK seems to be up to date, at least…
Hi Rue & others,
I came across an interesting problem that I have had for about two days & have lost about 10 hours or so.
Microsoft have just done a update where they push out a new FTDI driver, which cripples the FTDI. What makes it confusing is that both RX & TX LEDS flash OK, but the driver sends only 0’s back to the PC.
I hear that some FTDI’s are bricked, but in my case all I needed to do was to roll back the driver to a 2011 driver.
Bearing in mind that the FTDI is probably the most popular chip to use, this might cause a few headaches.
Rue, you might like to pass this it on via your various information dissemination methods and perhaps put it in your most excellent
Home Automation book.
Lee
PS. Will you be doing an update on Home Automation in the future? Are you looking for feedback?
Hi Lee,
Thank you for your comment. You are right FTDI bricked counterfeit chips with the new updated. Luckily there’s a way to fix that! It’s explained already in the Home Automation Using ESP8266 eBook. It’s on Unit 2 in the heading “Extra Tips for Windows Users”. I hope this helps!
thanks again,
-Rui
Hi rui i have your post about esp8266, but i m having a problem i m using it with arduino uno . When i snd AT+RST i gives invalid instesd of ready. I m hoping that you could help me with it.
What’s the exact error message that you’re seeing? Which board are you using? The ESP-01?
Hi, All
I am trying to interface ESP8266 with LPC2148,
I have done hardware setup as:
VCC———–3V3(LPC2148)
GND———-GND(LPC2148)
RST———–GND(LPC2148)
CH_PD——-3V3(LPC2148)
RX————TX
TX————RX
RED LED is ON, but BLUE LED is not blinking?
What would be the problem.
Thank you all.
Hi,
I’m not sure I’ve never used that chip…
Level shift != voltage divider ?
I am beginner. Help me with this issue please.
Hi Alexandre,
Yes, they are different, but they kinda do the same thing.
A voltage divider simply divides the voltage in half and it can lower the quality of a signal. If you’re using a voltage divider at a higher baud rate your data might get corrupted.
A logic shifter allows you to lower the voltage without lowering its quality.
hello Rui,
is there any special firmware for special project?
if yes, which is the exact firmware for a web server?
can u share the link of this firmware?
Hi Sam,
Please follow this tutorial: https://randomnerdtutorials.com/esp8266-web-server/
Helllo Rui,
I am new to electronic,
I want to control my Lights and Fan using this setup, So i bought following
5 ESP 8266 – 01
2 5V 4 channel relay
10 AMS1117 3.3v
5v Power Supply (I am using mobile charger)
10 1K resistor
10 2N2222 transistors
I am able to upload the program to arduino PRO MINI (5v) module. but not able to hookup my ESP8266 – 01 and arduino PRO MINI (5v) and get it work. I tried connecting ESP8266 -01 to PC using USB to Serial module and my ESP8266 -01 response fast and easy. How I can hookup my ESP8266 to my 5v arduino PRO MINI?
I have tried this link
iot-playground.com/2-uncategorised/17-esp8266-wifi-module-and-5v-arduino-connection
but as i mention I am new to electronic I am not able to understand the diagrams shown there.
Please help I am stuck since last three weeks.
Thanks in Advance
Hi,
Do you want your ESP to maintain a communication with your Arduino?
Read this tutorial: https://randomnerdtutorials.com/sending-data-from-an-arduino-to-the-esp8266-via-serial/
hey, I have tried esp8266 development board, cause it doesn’t work. I have used your web server tutorial, but it doesn’t showip adresas and when I reupload the sketch, it says: “only one tcp server allowed”
You can only have one web server running at the time. After uploading the script, restart your ESP and send this command: print(wifi.sta.getip())
Hi
I have found that whenever the esp8266 quits an access point (after using AT+CWQAP),and power is switched off.After the power has been switched on again I found that it connects to the network I had quit .Is this expected?
Hi Rui,
I have had lots of trouble with the FTDI programmer and its power supply. Only after the connection of an external power supply everything worked fine. It seems, that the FTDI programmer does not deliver enough current with its 3,3 V power supply.
Regards, Michael
That’s a very common issue with some FTDIs.
Thanks for letting me know,
Rui
kindly please try to help me ..
i want to send and receive from android to arduino .. that means when i press a button on my android application to turn a LED on / off while the arduino is connected to a tft touch screen that is connected to the master arduino in my home which displays the current state for each zone in my home and control them .. i think that i need a cloud server (web server,hhtp server .. )
i have these components :
arduino uno / esp8266-01 / breadboard / wifi shield cc3000 /ethernet shield ..
waiting your reply
Hi Kareem,
You can do that, but I don’t have any tutorial on that exact subject…
Thanks a ton for this tutorial buddy!!! I was breaking my head over this for days!!! at last figured it out using your tutorial…Thanks a ton buddy
You’re welcome, I’m happy the tutorial helped 🙂
Thanks for sharing 🙂 it’s very usefull 🙂
You’re welcome,
Rui
Hey can you show us how to communicate 2 ESP8266’s togheter to send and reccive variables? 🙂
I don’t have any tutorials on that exact subject.
Thanks for asking,
Rui
Hi Rui!
I just wanted to start by saying thank so much for doing this tutorial. I just started doing IOT development and was wondering if you can do one on how to implement websockets into the esp8266 and how that connects to a raspberry PI? Not much info on the web about his stuff, but your tutorials have been great… Appreciate your knowledge sharing…
Thanks for the suggestion Maurice.
Rui
how to add code in ardunio software. plz help me this error coming when i am uploading code
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed
Please take a look at this guide: https://randomnerdtutorials.com/esp8266-troubleshooting-guide/
I need to make monitoring system by cellular phone app program, by monitoring server in my office.
I will use this module at IOT, Home Automation, New energy Power plant.
Hi.
You may find the ESP8266 web server tutorial a good starting point for your project:
https://randomnerdtutorials.com/esp8266-web-server-with-arduino-ide/
Excellent web info Rui !,
Hello , I’m new in IoT , just starting , and I’m trying to choose the right board , I can see for ESP8266 CH340G NodeMcu V3 Lua ESP-12E Micro USB ESP8266 CP2102 in alliexpress , but the CH340 and the CP2102 are two USB chip option , what is better , why ?,
And the Second doubt , If the ESP module has the NodeMcu Lua flashed inside , Can I use it with Arduino IDE ? , or must be reflashed ,
Thanks For the advice ,
Hi.
Both boards should work just fine. But, we usually use CP2102 (so, that’s the one we recommend).
If it comes flashed with LUA, you can use it with Arduino IDE wihout any problem.
Also, this article might help: https://makeradvisor.com/best-esp8266-wi-fi-development-board/
Regards,
Sara
ESP-01 is really very hard to get working. I tried for 2 weeks and their were no standard articles to get it working with arduino. Can you please share one and only specific article that can help me get working arduino with ESP-01 esp8266 chip?