Introduction: ESP8266 WiFi Module for Dummies

Picture of ESP8266 WiFi Module for Dummies

Overview of the ESP8266 WiFi Module

The ESP8266 is a really useful, cheap WiFi module for controlling devices over the Internet. It can work with a micro-controller like the Arduino or it can be programmed to work on its own.

The Internet of Things (IoT) has just been made a whole lot cheaper and easier!

The ESP8266 comes with factory installed firmware allowing you to control it with standard “AT commands”. You can also easily create and upload your own code and this makes it hugely powerful and flexible.

The ESP8266 was launched in 2014 and is rapidly growing in popularity. There is only one ESP8266 processor but it is found on many different breakout boards. These all differ in terms of which pins are exposed and the size of the flash memory etc. These breakout boards have evolved rapidly over the years and there is a lot of information to be found on the web. This is both a blessing and a curse as some of the advice is outdated or just plain wrong.

As a result it took me 3 days before I could get it to do anything! Some people are lucky but for me it was a battle to get anything working. At times I thought I had broken it but with some perseverance it always came back to life!

I’ve finally got it singing and dancing and it turns out to be easier than I thought!

I’ve consolidated all the useful info I found into one place and I thought I’d share this in an instructable. This will hopefully get you quickly up and running with all the basic functionality that you’ll need.

In this instructable were are looking at the ESP-01 breakout board.

This same approach should however apply to most (if not all) of the variants of the ESP out there.

Step 1: The ESP-01 in a Nutshell

Picture of The ESP-01 in a Nutshell
  1. It supports the 802.11 b/g/n protocol
  2. It can connect to your router and work as a client or it can be an access point itself or both!
  3. It is IP addressable and can be a Web Server
  4. The “standard” version has 2 digital pins that can be used for input or output. Eg: to drive LED’s or relays. These pins can also be used for PWM. Other versions have more pins exposed. For example the ESP-12, which is a good option if you need more pins. Either way the programming is still the same.
  5. Analog input is also available on the ESP8266 chip (ADC/TOUT) but it’s not wired up on the ESP-01.
  6. It can be combined with an Arduino or it can be programmed to work on its own
  7. There are various tools and development environments (IDE’s) to program it.
  8. And it has lots more….

In this demo the ESP8266 acts as a Webserver hosting a Web Page that you can interact with over WiFi.

With this demo you can start your own home automation project and control it from the web!

Step 2: What You’ll Need

Firstly let’s see if we can get it up and running.

A lot of sites recommend re-flashing the firmware and using various tools. You don’t need to do that just yet.

We’ll be replacing the firmware with our own code. In another instructable: The Simple Guide to Flashing Your ESP8266 Firmware I show you how to revert it back to an updated factory version. If you'll only be programming the ESP8266 with your own code - as we will be doing in this demo - then you don't need factory firmware. Your code is the firmware.

We'll be using the Arduino IDE as a programming tool but we don't need an Arduino itself. The ESP8266 has all the functionality we need.

Note: that after uploading your own code, your ESP8266 won't respond to AT commands any more. Your code has replaced the firmware. Using your code and the ESP8266 library in the Arduino IDE you'll have access to a richer set of commands. See the documentation here:

You can restore the firmware on the ESP8266 to go back to AT commands if you wish. See my other instructable: The Simple Guide to Flashing Your ESP8266 Firmware.

NB: It’s a 3.3V module and not 5V. The ESP-01 is more robust than I thought but you should set it up properly, especially if you’re using it with a 5V USB to Serial Programmer or micro-controller, otherwise you may fry it!

What you’ll need:

  1. An ESP8266 of course (use the ESP-01 variant or adapt your wiring accordingly)
  2. Breadboard
  3. 3.3V USB to Serial Programmer like the FTDI Basic (sometimes known as a UART: Universal Asynchronous Receiver/Transmitter). Some come with a jumper to switch between 5V and 3.3V.
  4. Breadboard Jumper Wires
  5. A separate 3.3V Power Supply. You do need one as the ESP8266 can chew a lot of mA (>250mA at times). The 3.3V output from the Serial Programmer or the Arduino is not sufficient. Without a separate power supply your ESP may be erratic and you will waste time trying to upload code.
  6. Led, push button, 330 ohm resistor, 10k ohm resistor, .1µF capacitor across your power supply (as standard practice).
  7. Add a Logic Level Converter into the circuit if you’re using a micro-controller or FTDI programmer at 5V

If you have an ESP8266 with a built in USB port then you don't need to go through any of this hassle. The Wemos D1 Mini is a good alternative. See this:

Step 3: The Components in More Detail

Picture of The Components in More Detail


I got my ESP-01 from:

You can have a look at the various versions here:

Breadboard Power Supply

A good power supply seems to be a crucial aspect for the ESP8266. A breadboard power supply is really useful, especially when you’re dealing with mixed voltages. The one shown here supplies 3.3V and 5.5V and plugs right into your breadboard. I should have got one a long time ago! The ESP8266 can chew a lot of mA (>300mA at times). If your ESP reboots or seems unreliable then you need a separate power supply for the ESP (keep a common ground though). Also connect a capacitor across 3.3V and ground to minimise spikes and to provide a small reservoir of power.

USB to Serial programmer

Get one that supports 3.3V or has a 3.3V/5V jumper otherwise if you only have 5V then you should use a bi-directional Logic Level Converter in between the programmer and the ESP8266. The FTDI Basic has a 3.3V/5V jumper on the back:

Logic Level Converter

Bi-Directional 5V & 3.3V. This is only required if you are using a 5V serial programmer.

Breadboard Jumpers

Include some JST jumpers as they’re handy for plugging onto modules with pins and then joining them to the breadboard. Include some male to female cables for this purpose. The ESP-01 isn't breadboard friendly so you'll need these.

Step 4: The Breadboard Layout

Picture of The Breadboard Layout

Looking at the breadboard, the FTDI programmer is the red board on top and the ESP8266-01 at the bottom. The FTDI programmer only needs 3 wires connected: the ground wire and the RX to TX and TX to RX on the ESP. On the left is the breadboard power supply (it would normally plug into the breadboard).

NB: The quality of the power supply to the ESP is one of the most important factors. There is a small capacitor (.1uF) across 3.3V and Ground to minimise spikes. If you are having problems with programming your ESP it may well be your power supply. What will help is to add another larger capacitor across 3.3V and Ground. eg: 10uF.

Step 5: The ESP-01 Pinouts

Picture of The ESP-01 Pinouts

The picture above of the ESP8266 pinouts is found all over the net. I think it may have originated from Neil “Kolban’s Book on ESP8266”. This is a fantastic resource and is available as a pdf download from: It’s 400 pages long, was updated in November 2016, and if you’re into serious ESP8266 development then this is the book to get. It’s free but make a donation if you can.

Breadboard wiring notes:

  • The wires are shown connecting to the front of the ESP-01 for clarity. Attach them to the same pins from behind. The ESP-01 is not breadboard friendly and JST connector male-female jumpers are handy for connecting it.
  • GPIO 0 must be held low for programming. This should be removed if you remove the FTDI and operate the ESP8266 on its own power supply.
  • CH_PD should be held high at all times.
  • The RESET pin is held high with a 10k ohm resistor and brought to ground by the RESET button which will reboot the chip. Press RESET every time before you upload code, and every time you connect or disconnect GPIO 0. The reset button will save you a lot of hassle.

When you power the circuit up the red LED on the ESP-01 should light up and the blue LED should flash briefly. Later when uploading code to the ESP the blue LED should flash continuously during the process. Any other LED combinations suggests that there is a problem.

NB: If you want to remove the Serial programmer and run the ESP on its own, make sure you disconnect GPIO 0 from ground and push the RESET button otherwise the ESP may not work properly.

Step 6: Schematic

Picture of Schematic

Step 7: Using the Arduino Instead of a Serial Programmer

You can also use an Arduino instead of your USB to Serial programmer.

A few things to note:

  1. On a 5V Arduino the digital output will be at 5V and this could fry your ESP2866. So either use a 3.3V Arduino or a Logic Converter chip
  2. The 3.3V Vout on the Arduino is insufficient to drive your ESP8266 and you could get unreliable results. Preferably use another 3.3V supply.
  3. As a recommended practice always upload a blank sketch to your Arduino before connecting any other devices to avoid any unpredictable results. A blank sketch has empty setup() and loop() functions.
  4. If you are using an Arduino Uno it only has one hardware TX&RX pair. To communicate with both the ESP8266 and the Serial Monitor at the same time you will also need to use the SoftwareSerial include file. It used to have a limitation on the baud rate but can now theoretically support a baud rate of up to 115200. A Mega 2560 has more hardware TX and RX pins so this could be a better way to go.
  5. And finally and importantly: Look closely at the TX and RX pins on the Arduino. You will notice that they have arrows next to them. The TX pin has an arrow pointing away from it. What this says is TX IN! What this really means is that the TX pin is actually the RX pin! And likewise the RX pin is actually the TX pin! So when using the Arduino as a serial adapter with another device you must connect RX to RX and TX to TX. I only discovered this nuance after several hours of pain! Why-oh-why did they label it like this?

Whilst I’m asking questions: why the ESP-01 was produced with so few of the useful pinouts exposed also baffles me! It is still a great starting point but if you need something more then go for the ESP-12.

To make things really simple, try an ESP-12 with a built in USB like:

Step 8: Programming Using the Arduino IDE

There are various tools to program the ESP8266 but the Arduino IDE (Integrated Development Environment) is by far the easiest for most folk.

To program the ESP8266 with the Arduino IDE you’ll need to download the latest version if you don’t already have it and then install the ESP8266 support. Note that you are only using the Arduino programming environment you don't need any Arduino hardware itself.

To download the Arduino IDE go to:

Start up the Arduino IDE and select the Boards Manager

Step 9: Setup the ESP2866 Board Manager

Picture of Setup the ESP2866 Board Manager

Start the Arduino IDE and select the Boards Manager under Tools / Board ..

Step 10: Install the ESP2866 Board Manager

Picture of Install the ESP2866 Board Manager

Find the esp8266, select it and click Install.

Step 11: Arduino Preference Setup

Picture of Arduino Preference Setup

Go to File / Preferences

Step 12: Boards Manager URL's

Picture of Boards Manager URL's

In the Additional Boards Manager URLs field enter the URL for the ESP8266 package which is:

Step 13: ESP8266 Setup in IDE

Picture of ESP8266 Setup in IDE

Select the “Generic ESP8266 Module” and go back to the Boards Manager again

Step 14: ESP8266 Options

Picture of ESP8266 Options

Setup you ESP-01 options. Select the appropriate COM port according to your PC.

Step 15: Talking to ESP8266

Picture of Talking to ESP8266

If you still have the original firmware on your ESP8266 you can try talking to it with the Serial Monitor.

  1. Open the Arduino Serial Monitor:
  2. Select the appropriate baud rate which is usually 115200 but could be anything down to 9600 depending on the firmware on the ESP.
  3. Also select “Both NL & CR”. Ie: New Line and Carriage Return characters after each “Send”.
  4. Type AT and press enter. The ESP should come back with OK. If not press the RESET button or try unplugging the USB cable and starting again. Make sure also that you have the right COM port selected. Also if you don’t have the “standard” firmware on your ESP it may not understand the AT command set. This is not necessarily a problem yet as you’ll be overwriting this with Arduino code later in this instructable.
  5. Type AT+GMR. This should come back with the version numbers of the firmware on your ESP. In another instructable I show you how you can restore the latest version of the “factory” firmware (if you want to).

Step 16: ESP8266 Arduino Code

Download code file (, unzip it and open it in the Arduino IDE.

Change the Router setting to yours. ie: change the SSID and PASSWORD fields.

Make sure your breadboard is setup correctly, and connect your USB cable to the Serial Programmer.

NB: When addressing the GPIO Pins in your code you should use the GPIO number. eg: 2 for GPIO 2 and not the physical pin number which will be different.

Step 17: Uploading Your Code to the ESP8266

Picture of Uploading Your Code to the ESP8266

Make sure you’ve closed ALL Serial port monitors on the same port, if you you’re using them. Eg: tools like CoolTerm. Open the Arduino Serial Monitor again, as you will need to see the IP address of the ESP after it loads.

NB: To upload your code you must have GPIO 0 grounded. You can leave it there whilst running your code in the browser. Press the RESET button before each load. If the upload fails, check your settings and try disconnecting and reconnecting the USB cable. Try Ctrl&U a couple of times. If all else fails try rebooting your PC. Sometimes the COM ports get a bit messed up.

The blue LED on the ESP should flash if the code is being uploaded successfully. The progress of the upload should look like the images above.

NB: If you want to remove the Serial programmer and run the ESP on its own, make sure you disconnect GPIO 0 from ground and push the RESET button otherwise the ESP may not work properly.

If your ESP8266 uploads are behaving erratically, improve your power supply.

Step 18: Let See What It's Doing

Picture of Let See What It's Doing

Switch over to the Arduino Serial Monitor and you should see the IP Address of the ESP. You could also log into your Router and check what’s connected there. The device will show up in the list of connected IP’s with a name like: ESP_1A6C4A.

Whilst you are in your router you could always reserve the ESP's IP address and set up some Port Forwarding so that you can connect to the ESP from outside your network - like the office..

You should see something like the above. Use that IP address in your browser.

Step 19: Let's Try It Out

Picture of Let's Try It Out

After clicking on a few links you’ll hopefully see the LED going on and off!

You also see that it can do PWM and dim the LED.

The ESP8266 can also handle Interrupts on the digital pins and also has analog input. The analog input pin though is not exposed on the ESP-01,

Internet Explorer works fine but for some reason FireFox seems very slow with the ESP. This may have something to do with the setup of the HTTP header.

Note: that after uploading your own code, your ESP8266 won't respond to AT commands any more. Your code has replaced the firmware. Using your code and the ESP8266 library in the Arduino IDE you'll have access to a richer set of commands. See the documentation here:

You can restore the firmware on the ESP8266 to go back to AT commands if you wish. See my other instructable: The Simple Guide to Flashing Your ESP8266 Firmware.

Step 20: ESP Resources

"Kolban’s Book on ESP8266" updated in November 2016 is for serious enthusiasts.

It is 470+ pages long and has an incredible amount of detail. You can get it for free but make a donation if you can.

He has now separated out the ESP32 and published a new book:


"Like the ESP8266, the ESP32 is a WiFi compatible microcontroller, plus it adds support for Bluetooth low-energy (i.e BLE, BT4.0, Bluetooth Smart), and nearly 30 I/O pins."


ESP Sites

AT Commands

Arduino Boards Manager

Notes on Flashing the Firmware:

I have published an instructable showing you how to flash the factory firmware onto your ESP8266.



ArsS1 (author)2017-08-24

its great and i have a question

i wanted a code to cheak connection , if connection with wifi is true set any port to high and In reverse set low this port

plz help me to creat this code :))))

tanx so much

TonesB (author)ArsS12017-08-24

Hi ArsS1

You'll see in the code this loop:

while (WiFi.status() != WL_CONNECTED) {

The property: WiFi.status() will tell what the connection status is. The While loop will continue looping and keep printing dots to your Serial Monitor screen until the ESP8266 has connected to your WiFi router.

ie: until WiFi.status() == WL_CONNECTED

So before this loop starts you can set a port to light up a Red LED, to show it hasn't connected yet, and after the code exits this loop you will know the WiFi has connected so you can now light up a Green LED instead or use an RGB LED to show different colours and statuses.

The various values of the status as defined in the Library are below, so you can play with these:


I hope this helps?

kimtyson made it! (author)2017-07-05

TonesB: This was a fantastic Instructable, thank you very much! I happened to have everything I needed to follow your instructions and have it running in just a few hours from scratch. I have added minimal lines to your code to print out more info about the ESP8266, specifically, the mac address and the address of any client connecting for special application processing.

The MAC address can be used for additional router security and to identify which ESP8266 is replying on a web page. The connecting client address can be used to refuse outside connections, debug, for logging or to alter content for different clients. I noticed several requests on the internet requesting this.

The mac address was easy. These lines come right after the print of the




The client IP took a little investigation but also required only 2 new lines to your code. It is invoked for every web page access by a client and is inserted in the code below - refer to the // comment to find where to place it.

// Read the first line of the request

String request = client.readStringUntil('\r\n');





So the serial monitor window gets these lines as a result.

Web Server started

You can connect to the ESP8266 at this URL:

Mac-Address=18:FE:34:D5:69:15 <--- unique for your device

New User



User disconnected

I have also added a picture of my setup. The temp sensor is not used, the red portion of the RGB LED is connected and the DIP switch is used to flip GPIO 0. Wire colours are not adhered to of course.

Thanks again, Cheers.

TonesB (author)kimtyson2017-07-05

Hi kimtyson - thanks for your feedback and the updates, they are much appreciated!

voyageurs60 (author)2017-02-10

Hello Tones - trying to upload your code to my ESP-01. Not sure of the firmware version. Does this matter? Below is the error message....

Error Message

Arduino: 1.8.1 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 1M (512K SPIFFS), ck, Disabled, None"

Sketch uses 232249 bytes (46%) of program storage space. Maximum is 499696 bytes.

Global variables use 33264 bytes (40%) of dynamic memory, leaving 48656 bytes for local variables. Maximum is 81920 bytes.

Uploading 236400 bytes from C:\Users\DJC-LI~1\AppData\Local\Temp\arduino_build_962768/ESP8266_Led_Control_PWM.ino.bin to flash at 0x00000000

................................................................................ [ 34% ]

................................................................................ [ 69% ]

......................................................................warning: espcomm_send_command: didn't receive command response

warning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed

warning: espcomm_send_command: wrong direction/command: 0x01 0x03, expected 0x01 0x04

error: espcomm_upload_mem failed

error: espcomm_upload_mem failed

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.


Was able to get it to load once... and the Arduino IDE Monitor show this... keeps repeating...

ets Jan 8 2013,rst cause:4, boot mode:(3,7)

wdt reset

load 0x4010f000, len 1384, room 16

tail 8

chksum 0x2d

csum 0x2d



------ End -----

Thanks for taking a look, not sure what is going on - Dan

TonesB (author)voyageurs602017-02-10

Hi Dan

It looks like a power supply
issue. Whenever the ESP8266 behaves erratically it's usually because
your power supply is not sufficient. To be on the safe side, whilst
prototyping, use a power supply that can provide at least 1A. Keep the
leads short and also put a 10uF and a .1uF capacitor across the + and -
to smooth it.

Otherwise, the upload is starting which shows that
everything else seems to be configured ok. On the firmware: any code
that you upload to the ESP8266 becomes the new firmware, so versioning
is not an issue. (Except in the unlikely event that you've bricked the
ESP8266 and it's a boot loader issue.)

So sort out the power supply and give it another go.

Gelfling6 (author)TonesB2017-04-22

So-far, I've been finding the same problem.. Most projects seem to be wired for the device to be powered off whatever it's plugged into (USB<-->FTDI , Arduino, etc.) and the regulators on those devices are at best going to give you 250mA, not even scratching the requirements if they intend on using the WiFi in any way.. ) I kinda cheat... Most of my breadboard projects, I've powered off reclaimed ATX Supplies.. I have 2, where the 3.3V output is rated up as high as 28A!! (that's 28000mA!!!!).. Absolutely no Brown-out (power loss), but also playing with fire if there is a short or wired in reverse.

I usually wire the supply to a separate rail on the breadboard, and common-GND everything.. VCC from the USB-FTDI and +3.3V from the supply, are _NEVER_ connected together! I've also run into quite a few FTDI modules, where, despite the switch being set to 3.3V, the VCC is still punching +5V. (Deek-Robot's version, with the slide switch, as example.)

nixrod (author)2017-04-18

Thanks for this great instructable!

I tried hooking up my esp01s a few months ago with no success using various tutorials from the web, which all contradicted each other slightly.
This one was very clear and concise. Thank you for having all the required information in one place.

TonesB (author)nixrod2017-04-18

Hi nixrod, thanks for the feedback. I had exactly the same problem trying to get my esp01 going and that spurred me on to write this instructable.

MichaelB247 made it! (author)2017-04-13

Great instructable! Got me through the initial exposure to ESPs! (except I missed turning off GPIO 0 from GND when using AT commands...that took me quite some time to figure out :D Thanks for posting all this!!

TonesB (author)MichaelB2472017-04-18

Hi Michael, thanks for the feedback and well done on a good looking proto board!

scanos (author)2017-04-04

Hi, thanks for the great instructable. It worked fine for me except I cannot get the led to dim. I am using an ESP-01 ESP8266, i.e. the one with 8 pins / 2 GPIOs 0 and ". Should it work? Can you clarify what you said about analogue signals., please

TonesB (author)scanos2017-04-07

Hi Scanos

I'm puzzled. The ESP-01
definitely has PWM as that's what I used in the original build and it
does work. Does the LED turn fully on and off ok? Maybe try other PWM values. ie: change the 512 (which is half way) to a lower value?

scanos (author)TonesB2017-04-10

Hi, I set the 512 to 128 and it worked. I also guess that I could have used a higher rated resistor. Thanks for that. I assume that I can use your program to read a voltage from a DSB1820 temperature sensor?

mccuaigm made it! (author)2017-03-24

Here is my setup, thanks for the tutorial, was a lot of fun getting the flashing to work, nice work

TonesB (author)mccuaigm2017-04-07

Awesome, thanks for the feedback.

smeem (author)2017-03-19

Tried doing this but it wont send back AT commands so i tried uploading the code anyways and it seemed to work but when it tries to connect and i watch it in serial monitor i get what i pasted below and nothing more

any thoughts?

Connecting to ASUS


TonesB (author)smeem2017-03-19

Hi Smeem

So it looks like the upload works ok.

Double check the pin settings as per Step 5 to make sure the ESP8266 can now operate out of programming mode. ie: "GPIO 0 must be held low for programming. This should be removed
if you remove the FTDI and operate the ESP8266 on its own power supply."

Also double check that you have specified your WiFi SID and Password properly and that your WiFi will allow incoming connections. It could be a security/access issue on your WiFi Router?

Also as with most "strange" issues with the ESP8266 it is usually always that the power supply is insufficient. It can't run off the Arduino power supply. Make sure you have a separate power supply capable of at least 500mA or more. Also put some capacitors across the + and -, close to the ESP8266. eg: a 10uF and a 1nF in parallel. The big one to provide some spare capacity and the small one to minimise power pikes.

Let me know how it goes.

smeem (author)TonesB2017-03-20

Silly me I dropped the ball majorly there, I forgot to disconnect GPIO0 from ground and run it after the reset. Thank you works well, wonderful tutorial

TonesB (author)smeem2017-03-20

Brilliant, thanks Smeem.

smeem (author)TonesB2017-03-21

Odd it still seems to not want to take at commands though

TonesB (author)smeem2017-03-21

Hi Smeem

Thanks for the question as I realise this wasn't explicit in the Instructable.

I've updated it to add the following:

Note: that after uploading your own code, your ESP8266 won't respond
to AT commands any more. Your code has replaced the firmware. Using your
code and the ESP8266 library in the Arduino IDE you'll have access to a
richer set of commands. See the documentation here:

You can restore the firmware on the ESP8266 to go back to AT commands if you wish. See my other instructable: The Simple Guide to Flashing Your ESP8266 Firmware.

smeem (author)TonesB2017-03-22

brilliant thank you ive already been working on some stuff but terrible with code thank you again for the instructable

LionelDP (author)2017-03-18

Thanks for the awesome tutorial! It worked perfectly.

TonesB (author)LionelDP2017-03-18

Hi Lionel

Thanks for the feedback. Much appreciated!

ps: I've started using the Wemos D1 Mini - it has the ESP-12 variant on it with lots more pins. It also has a USB connection - which makes it's a whole lot easier to use!

hemanth kumar reddy (author)2017-03-14

Can you plz look at this

small help thanks

coliscip (author)2017-01-21

Thank you very much! It's the first time when I programmed an ESP8266 (in fact NODEMCU 1.0). Be blessed!

as-WIN-th (author)2016-12-04

It works only once after I have uploaded the code. I was able to get the output on my Browser.

But when I power it off and on again, i assume that my ESP will automatically run on the previous code. But it did not. I even tried resetting the ESP no use!!..

What could be the reason?

Please help me

as-WIN-th (author)as-WIN-th2016-12-04

Okay, I found this Myself. Once the programming is complete I have to remove the GPIO 2 that was connected to ground prvsly.

I have another doubt, right now I am able to opean the page only on devices that are connected to my router, How can I open it on other devices?

PaulJ69 (author)2016-11-22


Is the firmware supposed to reboot after a reset? I disconnected GPIO 0 and did a reset but it didn't reboot till I also disconnected GPIO 1 and then did another reset. Powering off then back on also required that both GPIO's be disconnected before I got a reboot of the firmware. Is there anyway around not having to disconnect GPIO 1 when resetting?

craigy2210 (author)2016-11-13

hi can someone tell me how to connect the 8266 to my win10 laptop i plug it in via usb,i get the sound its connected but then nothing ive tried finding driver links...

Nothing thay helps me connect the esp8266 to my windows 10.

problem is i bought 5 off these for is a smalla project,all i want the board to do is turn something on and off but need it to do that at a a min distance of 25mtrs.i got the idea from a drone i bought.that goes about 30mtrs and i control my drone with my iphone 6.

So i thought well if i can control my drone via mobile ,then surely i can turn something on and off

I asked about and was told that the esp8266 is what i needed,as its a transmitter but thats the thing i didnt think id have to programme anything i thought plug and play off i go,

Ive thought alnog the lines of this im a rc helicopter,drone specialist and flight instructor of RC items and build helicopters,planes race built high speed rc could i not take one of my digital transmitters and wire this to the esp8266 then download ardiuno or even a app like the one to my iphone i use to fly my drone with and then once connected i can then turn the sep8266 into a on and off switch... via mobile

Any light into this project of what i need if anything what software and any programme writing ill need to put on the esp8266 to make it work.

Any help at all as it would be good to read a few comments and learn all the exciting things i could make

Johnson Selva (author)2016-10-01

dude i have this following error i'm using Arduino 1.6.11 will you able to solve this please..

C:\Users\Johnson\Downloads\ESP8266_LED_Control\ESP8266_LED_Control.ino:84:43: warning: multi-character character constant [-Wmultichar]

String request = client.readStringUntil('\r\n');


ESP8266_LED_Control:28: error: 'WiFiServer' does not name a type

WiFiServer WebServer(80);


ESP8266_LED_Control:30: error: 'WiFiClient' does not name a type

WiFiClient client;


C:\Users\Johnson\Downloads\ESP8266_LED_Control\ESP8266_LED_Control.ino: In function 'void setup()':

ESP8266_LED_Control:46: error: 'WiFi' was not declared in this scope



ESP8266_LED_Control:47: error: 'WIFI_STA' was not declared in this scope



ESP8266_LED_Control:52: error: 'WL_CONNECTED' was not declared in this scope

while (WiFi.status() != WL_CONNECTED) {


ESP8266_LED_Control:60: error: 'WebServer' was not declared in this scope



C:\Users\Johnson\Downloads\ESP8266_LED_Control\ESP8266_LED_Control.ino: In function 'void loop()':

ESP8266_LED_Control:72: error: 'client' was not declared in this scope

client = WebServer.available();


ESP8266_LED_Control:72: error: 'WebServer' was not declared in this scope

client = WebServer.available();


exit status 1

'WiFiServer' does not name a type

TonesB (author)Johnson Selva2016-10-01

Hi Johnson
Did you setup the ESP8266 board manager in the Arduino IDE first?
ie: as per Step 9 onwards. ie: to install the ESP8266 board manager and setup the URL in preferences? It sounds like the correct ESP8266 libraries are not being found by the compiler.

TonesB (author)TonesB2016-10-01

ps: This could also be because of a simple syntax error in your code. Check all your { and } and ; to make sure that they are all nested properly.

pvtryan (author)2016-09-24

This hard work really deserves a star, thanks for sharing.

TonesB (author)pvtryan2016-09-30

Hi pvtryan - thanks for your feedback it's much appreciated

JoeK17 (author)2016-09-11

nice!!! thanks for posting...

TonesB (author)JoeK172016-09-13

Thanks Joe, for reading and taking the time to comment.

JoeK17 (author)TonesB2016-09-13

you're welcome...

rbright (author)2016-08-31

In your excellent description you state:

"Switch over to the Arduino Serial Monitor and you should see the IP Address
of the ESP. You could also log into your Router and check what’s
connected there. The device will show up in the list of connected IP’s
with a name like: ESP_1A6C4A.

Whilst you are in your router you
could always reserve the ESP's IP address and set up some Port
Forwarding so that you can connect to the ESP from outside your network -
like the office.."


1) is it possible to specify & lock in an internal IP address that will be available on the Router e.g or is this just randomly allocated by the router? Maybe this is something in the Router I've not yet discovered ??

2) Have you been able to successfully set up Port Forwarding to the ESP. I've been able to do this OK with my TP-Link router to a Uno which is fitted with a Ethernet card connected that then use DuckDNS to give me a virtual permanent external IP from the outside world. Obviously this relates to my 1st question above where I want to have a permanent internal IP address which I can Port Forward to.

TonesB (author)rbright2016-08-31

Hi rbright

1. Yes, you should be able to reserve any IP address in your router for any connected device. Normally in one of the screens you'll see the IP and MAC addresses of all connected devices and there will usually be a "Reserve" button (or equivalent) that you can click for any specific device to setup the IP address you want to reserve.

2. Yes, this should work for you too. If you go to the website you will see your external IP address, and this is what you need. You are right that some Service Providers will change your external IP address from time to time. In which case you will need to use a Dynamic DNS Service something along the lines you mention or etc. Either way your router should be able to support this. Using Port Forwarding or Virtual Server settings in your router you should be able to map an external IP address and Port number to an internal IP address and Port number. For example: to (your device), or an external IP of say to The internal IP address eg: or whatever you've chosen for your device will be static if you've reserved it in your router.

I hope that helps?

mrinstructablesman (author)2016-08-29

I am using an ESP8266 12F with a relay connected to GPIO4. To adjust this code, do I simply change

int pinGPIO2= 2; //To control LED


int pinGPIO4 = 19; //To control LED

I can't seem to get the relay to trigger...

Hi mrinstructablesman

One thing to be aware of is that the Arduino IDE Code uses different Pin numbers to the Physical Pinouts on the board. I haven't used the 12-F but I would say you need to use Pin 4 and not pin 19 in your code for GPIO4.

Also are you driving your relay with a Transistor and Fly Back diode?

moustick (author)2016-08-26

Hi TonesB,

very great Instructable, like you are saying all the information is somewhere on the net and you you just make a so simple but so complet step by step tutorial. You should have a price for this one and the other one for flashing back the factory code. I had difficulty to start but with your guide now I can progress with the ESP, thank you.

If I can, I will like to had a comment for the Dummies like me, at STEP 15 you need to remove the GPIO 0 from ground(because you wired it as per the drawing in step 4 and 5) other wise you will stay in boot mode and the communication will not respond. Every time you are changing the configuration you need to reset the power so the new configuration is read by the ESP. Those two point look very basic when you have some experience but for Dummies like me you can save one evening.

Keep your good work

TonesB (author)moustick2016-08-30

Hi moustick

Thanks for your feedback, much appreciated. On the GPIO 0: I had no problems leaving it grounded. I do mention though that if you disconnect the Programmer you must remove GPIO 0 from ground and press the Reset button to reboot the ESP.

ereynoso (author)2016-08-22

Hi! Nice instructable! Regarding a stand alone operation, what kind of battery do you recommend? Is the Li-Ion max voltage too high for this module? I have plenty of spare cell phone Li-Ion batteries and it would be nice to be able to power my projects with them. Thanks!

TonesB (author)ereynoso2016-08-23

Hi ereynoso

Thanks for your feedback!
The ESP8266 datasheet says it can take a maximum input voltage of 3.6V.
A 3.7V Li-Ion battery after charging can be about 4.2V and this would
definitely be too high. So you would need a 3.3V voltage regulator in
your circuit. The ESP8266 can also draw quite a bit of current when
transmitting. The datasheet shows that this can be over 200mA and some
people say a lot more.

So bottom line: yes you can use Li-Ion batteries with a 3.3V regulator and if they have sufficient mAh for your application.

domiflichi (author)2016-08-22

Excellent Instructable, thank you for creating/posting it!

TonesB (author)domiflichi2016-08-23

Hi domiflichi

Thanks for your feedback! Much appreciated.

rbright (author)2016-08-22

Excellent summary of the current 'state of play' with ESP8266. I may be biased but I expect the Arduino IDE to take over from using NodeMCU although the arduino is not as memory efficient but then the ESP mas memory to spare and speed +.

Specifically the Arduino
IDE is intended to be used with genuine Arduino boards BUT with ESPs there is a
lot of other ‘interperating’ of code required as follows with EPSs but then
they have faster processor and stacks of memory to spare.

For the comparison I loaded
my basic modified version of BLINK into each as follows & you can see the additional memory requirements over a UNO when loading the same program using either a ESP-01 / ESP-12E :

Memory Used
Total Avail Memory

2450 Bytes



About This Instructable




Bio: I've been in IT and Software Development forever! My real passion though is where Software and Industrial Design meet. Especially micro-controller based gadgets and ... More »
More by TonesB:Appliance MonitorThe Simple Guide to Flashing Your ESP8266 FirmwareESP8266 WiFi Module for Dummies
Add instructable to: