Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Advik Singhania
Published © GPL3+

Using ESP8266 WiFi Module with Arduino Micro

In this tutorial, you'll learn how you can use two serial interfaces to talk to Arduino Micro and the ESP8266 module.

BeginnerProtip1 hour15,920
Using ESP8266 WiFi Module with Arduino Micro

Things used in this project

Hardware components

Arduino Micro
Arduino Micro
×1
ESP8266 ESP-01
Espressif ESP8266 ESP-01
The ESP 01 module should have the Ai-Thinker firmware or Espressif's latest supported firmware
×1
Breadboard (generic)
Breadboard (generic)
×1
Electrolytic Capacitor, 10 µF
Electrolytic Capacitor, 10 µF
Rated 25 - 50V. These are polarized component, with the longer leg being positive oone. Keep that in mind.
×2
Linear Regulator (Low Dropout)
Linear Regulator (Low Dropout)
LM1117T 3.3V linear voltage regulator
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram

Code

Arduino Micro and ESP8266

Arduino
/* Project Name : Using ESP-01 module with Arduino Micro
 * For : Arduino Micro/Leonardo/Due/Pro Micro (ATMega 32U4) & ESP8266 01 WiFi Module with Ai-Thinker Firmware
 * Author : Advik Singhania
 * Created On : 30th October, 2020; 04:24 AM IST
*/

void setup() {
  Serial1.begin(115200); // ESP-01 module operates at 115200 baud rate
  Serial.begin(9600);    // while the Serial Monitor uses 9600 baud rate
}

void loop() {
  while(Serial1.available()>0) // While the data output is available on the Serial1 interface(the ESP-01 module)
    Serial.write(Serial1.read());//Write it into the Serial Monitor
  while(Serial.available()>0) // while the data is available input is available in the Serial Interface
    Serial1.write(Serial.read());//Send it to the ESP-01 Module
}

Credits

Advik Singhania
3 projects • 6 followers
A student pursuing Computer Sciences. Learning Python, C and C++ and like to tinker with Arduino, CircuitPython and Raspberry Pi.

Comments