ESP8266 As Arduino

Introduction: 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.

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

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

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.

Procedure:

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.

Connections:

ESP-03

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

GPIO2

GND 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

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.

Fix It! Contest

Water Contest

Creative Misuse Contest

67 Discussions

Thanks !!you finally cleared my Doubt of that - what whapped to its wifi features and communication firmwares , whenever i program it using ide for using its ports Gpios ??? or it can proctect its Original wifi fermwar to allowing it to rewrite code for gpios !! but now i wanna ask , can i use esp88 standalone as working wifi and with its gpio to be use at same time ?????

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?

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...