Introduction: ESP8266 As Arduino

Picture of ESP8266 As Arduino

ESP8266 as Arduino

So this Lazy Old Geek (L.O.G.) heard about this ESP8266 IC. Basically, it’s a microcontroller that does WiFi. There are many Instructables with this chip and many with an Arduino. But most of these are using the ESP8266 as a sensor/WiFi connected to a standard Arduino.

Well, what I wanted to do was use the ESP8266 as an Arduino without having to use a standard Arduino.

The ESP8266 is a microcontroller similar to the AtMega328 used in the standard Arduino, e.g., Arduino UNO.

Now there is already a lot of information on doing this but I found it confusing, hard to figure out, sometimes misleading so I hope to simplify and clarify the process.

Special thanks to Lady Ada, Adafruit and the Adafruit HUZZAH ESP8266 breakout module. As usual she provides thorough, useful information.

Also, much of my information comes from this website:

There are many versions of ESP8266s. Some of the cheaper ones are ESP-01, ESP-03. I think right now they go up to ESP-12. Plus there are other variations.

ESP-01 $2.88 ebay

ESP-03 $2.25 ebay

Cheaper on

Step 1: Hardware Problems

Picture of Hardware Problems

Most communications with the ESP8266 is serial. Most computers use USB to serial converters, like FTDI chips.

PROBLEM: The ESP8266 IC requires 3.3Vdc instead of the more common 5Vdc. Also, it may need up to 250mA of current.

SOLUTION1: So some ESP8266 modules have built in 3.3Vdc regulators and are compatible with 5Vdc USB to serial devices.

Adafruit HUZZAH ESP8266 Breakout( picture)

SOLUTION2: So many FTDI converters have the option of converting logic to 3.3Vdc. And most have a 3.3Vdc supply. The problem is that most of the power supplies are in the FT232 IC and are only capable of supplying about 50mA of current. (see picture) This is also true of the PL2303 serial converters that I use a lot of.

So a separate 3.3Vdc power source is needed.

PROBLEM: The ESP-01 module has 2x4 header that is not compatible with breadboards.(see first picture)

SOLUTION: I took some long lead female headers and bent them with a little S-curve so that they will fit in a breadboard. (see pictures)

PROBLEM: The ESP-03 module has 2mm spacing on connectors which are not compatible with 0.1” breadboards.

SOLUTION: I have some 2mm headers so I soldered some male pins to the ESP-03. (see picture), then I took some 2mm female headers and wired them to some 0.1” headers. In this case I soldered them to a 2x4 headers so that I could plug them into the connector for the ESP-01.

Well, this works pretty good for breadboarding. (see picture) but I wanted something more permanent so I may make it into a PCB.

Step 2: ESP8266 As Arduino

Picture of ESP8266 As Arduino

Okay, there are many articles on how to do this. Most are very confusing. One of the better ones is:

The one I used the most is:

ESP8266 Requirements


3.3Vdc supply 250mA or greater. I used an AMS1117 3.3 regulator. This is powered by USB 5V. (The USB requirement is that the 5Vdc has a minimum 500mA of current.)

USB to Serial 3.3Vdc. I use a PL2303 device.


WARNING: Some newer PL2303 modules have 5Vdc on TX. This could damage the ESP8266 modules.



Arduino Environment v 1.6.4 or greater

ESP8266 Setup


These are instructions from

Installing with Boards Manager

Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).

Install Arduino 1.6.4 (or greater) from the Arduino website. Start Arduino and open Preferences window. Enter into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas. Open Boards Manager from Tools > Board menu and install esp8266 platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).



UTXD RXD of USB-Serial

CH_PD 3.3V

Reset Pushbutton to Gnd

URXD TXD of USB-Serial

GPIO0 Pushbutton to Gnd



TIPS: Make sure TX from serial goes to ESP-01 URXD and RX goes to UTXD

On my breadboard setup, instead of pushbuttons, I used two pin jumpers.


Connect USB-serial to PC and ESP-01, connect power if separate

Start Arduino 1.6.4

Select ‘Tools’ ‘Port’ whatever # your USB-serial is on

Select ‘Tools’ ‘Board’ ‘Generic ESP8266 Module’

Select ‘Tools’ ‘CPU Frequency’ ‘80MHz’ Not sure why

Select ‘Tools’ ‘Flash Size’ ‘512K (64K SPIFFS)

Select ‘Tools’ ‘Upload Speed’ ‘115200’ Some ESPs may be 9600

Put ESP8266 into Flash mode:

Ground GPIO0

Briefly ground Reset

Release GPIO0

(If you have an LED on GPIO0, it should be about ½ intensity)

Load a sketch. (You can use Blink if you change it from D13 to D2)

If it works, In the Arduino environment bottom window, you will see a string of red dots as it is programming.

TIPS: While the sketch is programming, the blue LED on the ESP-01 will flash. If you have an LED on GPIO0, it will turn off when programming is complete.

So if you’re lucky and followed my instructions you should have successfully programmed the ESP-01 with Arduino

For the ESP-03, you would expect the same procedure to work but not quite.

First you have to connect a 10K resistor from GPIO15 to ground.

Second it doesn’t have an easily accessed Reset pin.

Well, I did some research and apparently the CH_PD pin when pulled to GND will work as a Reset.



UTXD RXD of USB-Serial

CH_PD 1K resistor to 3.3V

CH_PD Pushbutton to Gnd

URXD TXD of USB-Serial

GPIO0 Pushbutton to Gnd



GPIO15 10K to ground

Put ESP8266 into Flash mode:

Ground GPIO0

Briefly ground CH_PD (Reset)

Release GPIO0

(If you have an LED on GPIO0, it should be about ½ intensity)

So this also works for the ESP-01.

Here is a schematic of my breadboard setup.

Step 3: Firmware

Picture of Firmware

What I discovered was that loading sketches overwrites the original software which is used by many of the basic Instructables and probably with a lot used when the ESP8266 is connected to a standard Arduino.

So I needed a way to reflash it back to ‘original’ software.

The one I use is ESP8266_flasher.exe

This is on Google Drive. Up at the top there is a little icon down arrow that will say Download. Load it to your PC.

Now there is a version of firmware there but it’s not the latest.

Official version?

Again, this is Google Drive.

What I did is click on 0.952 support Smar

Then click on v0.9.5.2 AT Firmw

Then click on Download and save it to your PC remembering where it is.


Run ESP8266_Flasher

Click on ‘Bin’ , select bin file

Select correct COM port

Now setup ESP8266 into flash mode as above.

Click on ‘Download’

Program should start Writing. This takes a while

Says Leaving… Failed to leave Flash mode

Ignore message, should be finished.


Easy way to Test is to use Arduino, select port, open serial monitor

Set it to 115200 baud rate and Both NL & CR

On command line enter AT+RST

NOTE: I just noticed it says SPI Speed: 40MHz,( though crystal is 26MHz)

On command line enter AT+GMR

SDK version: 0.9.5

Step 4: Conclusions

Picture of Conclusions

So this seems to work pretty reliably.

You don’t have to load a bootloader onto the ESP8266.

It does seem to take a little longer to program/flash.

It’s a little harder to set it up for flashing. But I’m looking into automating some of that with an FT232 module. (My old USB-BUB doesn’t work anymore.)

I need to explore some of the WiFi capabilities of the ESP8266.


kevinmaker2018 (author)2017-08-25

Good news, NEW VERSION ESP-01M WIFI Module on sale. It is designed for IOT project with super mini size.

hemanth kumar reddy (author)2017-03-14

Can you plz look at this

small help thanks

MegaDAS (author)2016-12-23

useful, thank you

chyy0906diy (author)2016-12-22

ok , good

pcsdias (author)2016-03-08

Would it be possible to connect the FTDI DTR pin to the ESP8266 RST in the same way it is in the Arduino Uno in order to automatiize the flashing process?

msuzuki777 (author)pcsdias2016-03-08

I believe it is possible. I was just looking and found that Sparkfun is doing this with the ESP8266 Thing. Apparently with a capacitor.

I haven't tried this yet,but it looks promising.


eszjm (author)msuzuki7772016-07-26


I tried and it worked (not with capacitor but with help of RTS pin on USB-TTL chip - soldering plus wire to nRST)

2 wire:

[USB-TTL chips] DTR --> ESP-GPIO

[USB-TTL chips] RST --> ESP-RST

Jumpers: switch between normal and bootloader mode Unfortunately it must be removed manually after programming

Arduino IDE: works, but under flashing don't open and use terminal monitor window

esomers (author)2016-03-23

I have to reset the esp a lot... it doesn't seem to load the code on it correctly. I have to reset it often and it will randomly work. Once it works once, it'll keep going until you turn it off.. any ideas what might be causing this?

dmnr (author)esomers2016-07-01

maybe decoupling capacitor, poor power suply, etc

msuzuki777 (author)esomers2016-03-23

I had a lot of problems when I first started with these.

I had problems with FTDI 232 USB adapters. If you have different types, I would try them.

You will have probably have better luck if you have at least 200mA 3.3v source.

If you have several different ESP8622s, try them.

If you're using ESP-03s like I did, make sure the pins are soldered to the PCB.

For some reason, I had trouble with the PCB I made that could program ESP-01 and ESP-03s. It worked fine with ESP-01s but not ESP-03. I made a separate PCB just for ESP-03s and that worked fine.

If you have 01s and 03s, I found it a lot easier to program ESP-01s.

Make sure your USB adapter is 3.3V and not 5V.

Hope this helps.


esomers (author)msuzuki7772016-03-23

Hey. I started testing them and it seems to work when I upload the code but the more you reset/power cycle it.. the worse it gets. To a point where it won't even boot the code at all... unless you re-upload the sketch. I'm guessing the memory in the microcontroller might be faulty. I ordered a nodemcu dev board.. it has a ESP-12 on it. Gonna try my luck with that and see if the problem persists...

msuzuki777 (author)esomers2016-03-23

Yes, I've had some intermittent problems with my IP Clock. Mostly it just stops working until I recycle power.

By the way, I'm pretty sure the memory and program are stored on a separate RAM chip and not on the ESP8266 microcontroller. (Not that that makes much difference).


kabot (author)2016-05-01

good job

RalphG4 (author)2015-08-24

Hello sir, can I make use of arduino uno as USB to serial converter to program the esp8266?

If yes, can you explain how.. Thanks a lot..

mhaqq (author)RalphG42016-02-07

yes, you can use arduino uno as a USB to serial converter to program the esp. i've been using arduno uno to upload sketches to a custom arduino a company i work with built and i've tried it on my esp8266 and it works perfectely. basically you'll just have to remove the ATmega chip from the uno connect tx of the uno to the rx of the esp; rx of the uno to the tx of the esp; 3.3V of the uno to the esp; GND of uno to the GND of the esp and your connection is done. now you can connect the arduino to PC and start uploading :)

msuzuki777 (author)mhaqq2016-02-07

You're probably correct. I did some further research on this. Apparently, the ESP8266 has a snapback circuit that will handle 5Vdc (at least it won't be damaged). Also the newer UNOs have a 3.3Vdc regulator that is good for up to 150mA which should be fine for programming.

(I did see some documentation for older UNOs which said that 3.3Vdc is limited to 50mA)


msuzuki777 (author)RalphG42015-08-24

While some Arduinos like the UNO have a USB to serial converter in them, the circuitry is not readily accessible. I wouldn't try to use one and wouldn't recommend it. USB converters like the PL2303 are relatively cheap on ebay. My current favorite is the even cheaper CP2102, which does work with the ESP8266.


RalphG4 (author)msuzuki7772015-08-24

Thanks for your response sir. But I don't understand what you mean about "the circuitry is not readily accessible" since the RX and TX of UNO's USB to serial converter is accessible through pin 0 and pin 1. And we can remove the Atmega chip from the board (assuming DIP version).

Sorry for insisting to use Arduino as USB to serial converter 'cause it will take me a month to receive the product from ebay.

P.S.: I tried browsing the internet for a project that uses arduino as usb-serial converter to program esp8266 but i haven't seen yet

msuzuki777 (author)RalphG42015-08-24

I didn't think about removing the AtMega. That's a big help. Does this have an FTD 232 chip on it? One other problem is that most are set up for 5V operation. I think some have a 1K resistor in series with TX and RX and this might be enough but to be sure, you should probably put a voltage resistor divider on the FTD232 TX line. The RX line should work fine with the ESP8266.

Another problem is the 3.3Vdc needed by the ESP8266. The Arduino has a pin for that but it is usually connected to the FTD232 3.3Vdc output which only has about 50mA available. This might be enough to flash ESP8266 but might not. I think the ESP8266 needs up to 250mA.

Also, another warning: I had problems using the FTDI232 when flashing it back to original. Apparently other people have done this successfully but I had three that didn't work.

Voltage divider. Connect Arduino serial TX to a 1K resistor (this may already be there). Then connect that to a 2K resistor tied to ground. The signal between the two resistors should be about 3.3Vdc.

Might work. Good luck.


RalphG4 (author)msuzuki7772015-08-24

Thank you for the info, it's a big help. I'll notify you about this soon.

BallscrewBob made it! (author)2015-11-27

The newer ESP-01 require even less to program using Arduino but stick to IDE 1.6.5 not 1.6.6. I use one of the chinese breadboard PSU adaptors so I can have both 3.3 V and 5 V. Adaptors are pretty easy to make for breadboard too. Attached some pics of adaptor and a small flash jig that works great for the newer ESP's which are black and in most cases have a little more memory. The switch is just for flash or run position that's all it needs. no resistors or anything

Dodutils (author)2015-11-26

you may also buy the electrodragon little SMD bread that give ESP 12E a standard Pin OUT size and accept 5V input :-)

Dodutils (author)Dodutils2015-11-26

it also have reset & falsh button that is usefull

Capri2794 (author)2015-08-09

Can ESP 12 be used as Arduino too?

Is the process of using it as Arduino the same as using other ESPs?

msuzuki777 (author)Capri27942015-08-12

All of the ESP series are based on ESP8266s so theoretically the ESP-12 should work. I don't have any so can't verify. I did have some problems with the ESP-03 that I didn't have with the ESP-01. The Adafruit HUZZAH ESP8266 has an ESP-12 in it.


smitex (author)msuzuki7772015-08-13

yes esp12 can work with arduino ide too

JaneE3 (author)2015-08-12

JaneE3 (author)2015-08-12

yes, it can

if your want it and you are in USA, you can place order on this link, it is very fast:

shinystuff (author)2015-07-30

I am sure your tutorial is awesome, but something else caught my eye in it. I swear this is the most genius way to make a radiator for a component, which has only a SMD pad for that purpose. Awesome thinking!

msuzuki777 (author)shinystuff2015-07-30

Thanks. I noticed it was getting a little hot and wanted something quick. The tab is pretty small but nut and bolt did the job.


JohnnyC5 (author)2015-07-28


Excellent tutorial!
Could you clarify what exact software you used to draw the scheme?

msuzuki777 (author)JohnnyC52015-07-29

I use Cadsoft Eagle (free) to make my schematics.


JohnnyC5 (author)msuzuki7772015-07-29

Thank you!

You made my day!

msuzuki777 (author)JohnnyC52015-07-29

Glad to help.


james.heires (author)2015-07-23

Now that I have this working, has anyone located an I2C library that I can load/include from the Arduino IDE, in order to implement I2C on ESP8266? I want to interface to BMP180 temp/humidity sensor without Arduino hardware.

msuzuki777 (author)james.heires2015-07-23

According to the latest documentation, I2C is supported:

I haven't tried it.


james.heires (author)msuzuki7772015-07-26

Thanks, msuzuki777,

I see guidance that before using, call "Wire.begin(int sda, int scl), i.e. Wire.begin(0, 2) on ESP-01" to define which pins to use.

However, when I try this, my sketch doesn't compile. I get an error suggesting that TwoWire::begin() takes just one parameter:

"espa_thingspeak_v03.ino: In function 'void setup()':
espa_thingspeak_v03:195: error: no matching function for call to 'TwoWire::begin(int, int)'
espa_thingspeak_v03.ino:195:18: note: candidates are:
In file included from espa_thingspeak_v03.ino:8:0:
C:\Users\Donatech\Documents\Arduino\hardware\esp8266com\esp8266\libraries\Wire/Wire.h:53:10: note: void TwoWire::begin()
void begin();
C:\Users\Donatech\Documents\Arduino\hardware\esp8266com\esp8266\libraries\Wire/Wire.h:53:10: note: candidate expects 0 arguments, 2 provided"

Any thoughts?

msuzuki777 (author)james.heires2015-07-26

I don't know anything about thingspeak but it looks like the Wire.h, Wire.cpp in your library are not compatible with the sketch. You might try looking for the correct library.

It might be this one:

but I'm just guessing.


james.heires (author)msuzuki7772015-07-26

Are you sure? It looks to me as if the Wire.cpp has 2 parameters, which is what my sketch is providing. It looks as if the Arduino compiler is expecting only one parameter. Perhaps the Wire.cpp that has 2 parameters is not in the correct folder? Where does the esp8266 board manager (json) expect libraries to be located? Is it any different from standard Arduino IDE?

In other words, when my sketch #includes <Wire.h>, where does the IDE look for it, and link it to my sketch? Perhaps there are 2 versions of this library, and the IDE is finding the wrong one...

msuzuki777 (author)james.heires2015-07-26

I am not sure. And I don't know what the IDE does with duplicate libraries.

I wondered myself where the libarires were going when you use board manager and found this:

which says it's going into something called %APPDATA% which is not easy to access.

However, in your case, I would look at the error message you posted which says something about:


which is not what I would have expected.

Anyway, hope this helps.


diy_bloke (author)2015-07-05

looks great. Was just wondering your incoming TX signal, isnt that 5 Volt? or do you get the voltage for the FT232 from your 3V3?

msuzuki777 (author)diy_bloke2015-07-05

Good question. I am using a PL2303 to convert USB to serial and it is 3.3V logic. And most of the FT232 converters have an option to switch it to 3.3V signals. Usually most 5V Arduinos will work with the 3.3V signals so I'm pretty sure it should work with either 5V or 3.3V Arduinos and ESP8266s.


diy_bloke (author)msuzuki7772015-07-05

tnx, so the level on yr Tx is 3.3 Volt

msuzuki777 (author)diy_bloke2015-07-19

I have a warning for you. While the PL2303 modules I've been using are set to 3.3Vdc Tx, I just got a batch of new PL2303s from ebay and their Txs are set for 5Vdc.


diy_bloke (author)msuzuki7772015-07-20

That is good to know. Tnx. My module has both voltages, but seems the TX is also set for 5 Volt. Have been using a voltage divider for my ESP8266 module and that worked well

RanT1 (author)diy_bloke2015-07-24

I've been using CP2102 modules I get for about US$3 from ebay. The advantages are that they bring all the handshaking signals that aren't on the FTDI-style header out to other header pin pads, and there's a solder jumper that can set them to either 3V3 or 5V for Vcc. The logic outputs are always 3V3, regardless of the Vcc settings.

The CP2102 has an onboard regulator that's good for up to 100mA of 3V3, _but_ it appears the maker left out the recommended bypass cap to save a few cents, so you might want to add one if you're connecting to gadgets that don't already have them.

msuzuki777 (author)RanT12015-07-24

Good to know. I used to have one but don't know where it is. Just checked and ebay has a listing for $1.58.



diy_bloke (author)RanT12015-07-24

Thanks. I know that module (or a comparable) pretty well as I have it. Didnt really check for a bypass capacitor, but i will keep that in mind. Tnx

msuzuki777 (author)diy_bloke2015-07-20

If you have PL2303s there is a way to convert them to 3.3Vdc. You have to cut or lift pin 4 of the PL2303 and solder the pin to 3.3Vdc. I haven't tried it yet as my eyes are pretty bad and have to use a magnifier to see. By the way, I bought 3 FTDI232 modules and they couldn't complete a flash download ESP8266.

Right now I'm having some trouble with ESP-03s, I can flash v9.52 but they won't respond to AT commands.


msuzuki777 (author)diy_bloke2015-07-06

Yes, it is.


About This Instructable




Bio: Lazy Old Geek
More by msuzuki777:Senior MomentsWeather Station 5IP Time Clock Part 2
Add instructable to: