Introduction: Use Arduino Due to Program and Test ESP8266

If you want to program an ESP8266 (Wifi SoC) you will normally use a USB to serial adapter like this one. In case you do not have one but you have an Arduino Due laying around you can rig the Arduino as a bridge to program and test the ESP8266. Please be aware it does not make sense to buy an Arduino Due just for this purpose because it is usually more expensive than the FTDI chip (USB to serial).

Arduino Due is in particular good for this purpose because it does not need any level shifters. Arduino Due works at 3.3V which is compatible with the ESP8266. Here you have the steps how to do this:

Step 1: Get Your Materials

This is easy. As the title of this project says, you need an Arduino Due, the ESP8266 chip and some wires.

Step 2: Wiring

The wiring is fairly simple. If you use a switch you can prepare the wiring for both programing and serial monitoring. The wiring is fairly simple. Vcc on ESP8266 goes to 3.3V on Arduino Due. GND from ESP8266 obviously goes to GND on Arduino Due. CH_PD from ESP8266 goes to 3.3V. RX from ESP8266 goes to TX1 on Arduino and the TX from ESP8266 goes to RX1 on Arduino. GPIO0 is connected to GND for programing or disconnected if it's just running the software.

Step 3: Program Arduino Due to Act As a Bridge

This is a very simple step. You need to know at what speed your ESP8266 works. In case you do not know it you can just try. In most of the cases the speed would be either 9600 or 115200. Set Serial1 on Arduino at that speed. Basically the program reads from Arduino main serial and transfer the data back and forth with Serial1 on Arduino Due.

Step 4: Test the Bridge

Once you programmed the Arduino Due you can test the connection with ESP8266. Just open the Serial Monitor and make sure the speed matches the speed you set for Serial (not Serial 1) which is the connection between the computer and Arduino and not between Arduino and ESP8266. ESP8266 is pre-programmed to support a series of AT commands. You can try them.

Step 5: Program the ESP8266

You can use any IDE to program the ESP withe Arduino bridge you just created. In case you want to use Arduino to program the ESP8266 you need to use this release of Arduino. Once installed and made sure you set the port to the one connected to Arduino you need to set ESP8266 as target and the programmer to esptool.

Comments

author
JeganJJ (author)2017-04-03

Hi,

I try to give AT commands to my ESP8266 through Arduino due,But its not responding,the connections are correct,i gave AT cmd via arduino ide serial monitor but esp8266 not showing anything,

Can you please help me,

Thanks for Advance

author
hemanth kumar reddy (author)2017-03-14

Can you plz look at this

https://www.instructables.com/community/security-s...

small help thanks

author
newSogn (author)2016-04-02

Alright I have officially tried everything and the conclusion that I am running into is that this is no longer a viable way to program the esp8266 and on top of that I dont think there is support for the esp8266 01. I could be wrong I hope I am but It just is not working. I have worked on this all day but I cant get it. I tried the 1.6.1 ide but I think the problem is the esp8266 core that you used is not gone, I cant find any older versions anymore. It really stinks tho this would have been a great way to program my esp8266. |: if anyone can help it would be appreciated.

author
TonyF12 (author)newSogn2017-01-19

Have you seen this:

I hope you are OK by now, but the video is very nice guys! Tony

author
beautifulsmall (author)newSogn2016-09-18

Just got this working with Arduino IDE 1.6.11 but had to set the PC side speed to 57600 and the ESP side at 115200, the Due does the buffering.Tried it with 115200 both ways and it looked like it uploads but never runs. Had some problems synchronizing the upload and held the due in reset until the UPLOADING starts when re-programming the Due. Took a few goes to program the ESP but it works repeatably now.

author
BrenoJ (author)beautifulsmall2016-11-11

can u help me? i tried all the rates but due dont sees the serial1 as available

author
BrenoJ (author)2016-11-11

I'm using arduino 1.6.12 and just cant get it working. The firmware uploads into arduino due but serial monitor shows nothing. can someone helpe me?

author
beautifulsmall made it! (author)2016-09-18

Thanks for the article.

WP_20160918_21_32_36_Pro.jpg
author
newSogn (author)2016-04-02

I was wondering if maybe you could update this tutorial I am trying to do this very thing and It wont work because esptool is no longer an option for a programmer.

author
LucineiJ (author)2015-10-07

try use Arduino IDE 1.6.1

I have same error to program Atty86.

author
newSogn (author)LucineiJ2016-04-02

How did you add the board support for the arduino 1.6.1 I have always used the boards manager

author
RainerR2 (author)2015-05-24

Thanks for this article!

Arduino 1.6.4 keeps no "programmer" "esptool" any longer. All other settings under "programmer" don't work with the DUE!

Always get

"warning: espcomm_sync failed"
"error: espcomm_open failed"

Any help?

author
newSogn (author)RainerR22016-04-02

Has anyone figured this out yet?? I am running into this problem now as well

author
DavidL123 (author)RainerR22015-09-01

I get this error also :(

author
RainerR2 (author)DavidL1232015-09-19

Any news? I really need this for my project...

Rainer from Germany

author
anistor (author)2015-05-25

Some information I missed:

1. The code works with the Arduino IDE 1.6.1 (now obsolete) specially created for ESP8266. I have not tested this with 1.6.4.

2. This works exclusively with Arduino Due. Other Arduino boards supporting multiple UART work only at 5V and the ones working at lower voltages (3.3) do not support multiple UART (Serial1 not working).

author
patricktlo (author)anistor2015-07-05

Couldn't I use an arduino uno (for example) and use voltage dividers or something like the IC CD4050 to make it work?

author
TheTwim (author)patricktlo2015-12-28

You can take a look at this.

author
madmedix (author)2015-05-20

This code doesn't compile. To wit:

Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Duemilanove or Diecimila, ATmega328"

sketch_due_serial1.ino: In function 'void setup()':

sketch_due_serial1:3: error: 'Serial1' was not declared in this scope

sketch_due_serial1.ino: In function 'void loop()':

sketch_due_serial1:8: error: 'serial1' was not declared in this scope

sketch_due_serial1:9: error: 'Serial1' was not declared in this scope

sketch_due_serial1:14: error: 'Serial1' was not declared in this scope

'Serial1' was not declared in this scope

Capture.PNG
author
HaziqS (author)madmedix2015-10-28

The Problem Is Arduino Due and Duemilanove is not The Same Board.... U need To Install Arduino Due Board from the Board Manager and Use Arduino Due Programming Port :D Cheers.

author
anthonyjclarke (author)2015-07-12

Nice quick giude too check my ESP8266's...

author
sdcharle (author)2015-06-13

Nice. Why not just post the Due code as text, though?

author
tomatoskins (author)2015-04-27

This is a really cool idea! I love all sorts of arduino projects! Thanks for sharing.

About This Instructable

63,485views

70favorites

License:

More by anistor:Illuminance Monitor with ESP8266 - IoTTemperature Monitor with ESP8266 - IoTBasic Security with ESP8266 - IoT
Add instructable to: