Introduction: Simple Arduino Uno and ESP8266 Integration

About: I am an Electronics & Telecommunication Engineer, and my interest is in Internet of things, Arduino, Raspberry Pi, Programming, Web Designing, Robotics, Hacking, Web Security.

Our goal was to create an Esp8266 AT command library (based on the ITEAD library), that would work well on software serial on most ESP8266 devices, provided they have firmware that responds to AT commands (which is usually the manufacturer default).

We are distributing this preliminary library for testing and would appreciate your feedback and improvements through the Github Repository .

Hardware components:

  1. ESP8266
  2. Arduino UNO & Genuino UNO
  3. Logic Level Converter - Bi-Directional
  4. Breadboard
  5. Jumper wires

Software apps and online services:

  1. Arduino IDE
  2. circuito.io
  3. Firmware.ino

Step 1: Wiring

Connect the ESP8266 via Software Serial to your Arduino Uno board using a logic converter, as shown in the wiring figure attached.

Step 2: Connect to Your Wi-Fi

Open the Firmware.ino library from Github and enter your SSID and the password to your Wi-Fi:

const char *SSID= "WIFI-SSID";
const char *PASSWORD="WIFI-PASSWORD";

Step 3: Upload the Sketch to Your Arduino

Connect the Arduino to your computer and upload the sketch.

Step 4: Open Serial Monitor in Arduino IDE

Click on the Serial monitor button in the Arduino IDE (in the top-right corner). If everything is OK, you should see the following output on the serial monitor.

Step 5: Troubleshooting

If you get no response, try updating the ESP firmware to the one provided below. Use a 3.3v FTDI board like this one.

Hookup the ESP to the FTDI Get the ESP8266Flasher

Get the 1.1.1.1 Firmware

Flash the ESP

If you receive partial response from the esp8266 when using software serial, go to:

C:\ProgramFiles(x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial\src\SoftwareSerial.h

Change line 42:

#define _SS_MAX_RX_BUFF 64 // RX buffer size

To:
#define _SS_MAX_RX_BUFF 256 // RX buffer size.

This will enlarge the software serial buffer. Sometimes setting the baud rate on initialization fails, try resetting the Arduino, it should work fine. If for some reason, you are still having trouble, please comment here so we will try to locate the problem. If you have any improvement suggestions, please do a pull request on Github.
Generally, this code should work for all Arduino Uno ESP8266-01 versions.

Source:-

www.hackster.io

https://create.arduino.cc

Step 6: Contact Me (If Required)