Programming ESP8266 With Arduino IDE : The Easy Way

3010
0

The ESP8266 WiFi Module is a self-contained SOC that can give any microcontroller access to your WiFi network. It’s an extremely cost-effective board with a huge and ever-growing community. Each ESP8266 module comes pre-programmed with an AT command set firmware. This module has a powerful on-board processing and storage capability that allows it to act as a standalone microcontroller.

Following 2 easy steps, you can upload Arduino sketches on your ESP8266 using Arduino IDE.

  • Configuring the IDE
  • Making the circuit

Parts List:

  1. ESP 8266 Module.
  2. Jumper wires.
  3. A breadboard.
  4. One USB to TTL converter, a.k.a UART converter.

Configuring The IDE:

In order to bring support for ESP8266 chips to the Arduino environment, you need to add ESP8266 Arduino Core in the IDE.

NOTE: You must have Arduino IDE version 1.6.4 or higher. The latest version is highly recommended. Download the latest version of IDE from Arduino.cc.

  1. Install Arduino 1.6.8.
  2. Start Arduino and open Preferences window.
  3. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. (See the first image)
  4. Open Boards Manager from Tools > Board menu and install esp8266 platform. (See the second image)

Add URL to "Preferences" in Arduino IDE

Add URL to “Preferences” in Arduino IDE

Select ESP8266 board from Board Manager

Select ESP8266 board from Board Manager

Making The Circuit:

ESP8266-01 wiring for uploading program
ESP8266-01 wiring for uploading program
ESP8266-12E wiring for uploading program
ESP8266-12E wiring for uploading program

ESP-01:

  1. Connect GPIO0 to Ground (set it LOW or 0)
  2. Connect CH_PD toVcc (set it HIGH or 1)

ESP-12(E/F):

  1. Connect GPIO0 to Ground (set it LOW or 0)
  2. Connect GPIO15 to Ground (set it LOW OR 0)
  3. Connect GPIO2 to Vcc (set it HIGH or 1)
  4. Connect CH_PD toVcc (set it HIGH or 1)

Pin Vcc and GND should be connected to power supply’s +ve and -ve rail respectively. TX and RX of ESP8266 should be connected to RX and TX of USB to TTL converter respectively.

NOTE: You can replace the USB to TTL converter with an Arduino UNO board, but you have to upload a blank sketch or “bare-minimum” sketch to the Arduino so that the MCU of the Arduino board doesn’t interrupt. Connect TX and RX of the ESP8266 to RX and TX of the Arduino UNO respectively.

Conclusion:

You are done! Now just select your ESP8266 board from Tools > Board menu, write any program, and click on Upload button. The ESP8266 will run as standalone microcontroller now.

To have a clear idea, read the article FLASH AT FIRMWARE TO ESP8266 also.

About Rik

Myself Rik and I am founder of Riktronics. I study Electronics and Communication Engineering in IIE. My hobby is playing with electronics and making various projects, mainly about embedded systems. Love to do coding, and making tutorials about electronics/programming. Contact me in any need at abhra0897@gmail.com My blog : riktronics.wordpress.com

Leave a Reply