Catalog / ESP8266 Cheatsheet
ESP8266 Cheatsheet
A comprehensive guide to the ESP8266 microcontroller, covering essential hardware details, programming with Arduino IDE, networking, and common troubleshooting tips. Ideal for quick reference and project development.
Hardware Essentials
Pinout Overview
The ESP8266 has multiple variants, but the ESP-12E is the most common. Key Pins:
|
Important Note: The ESP8266 is not 5V tolerant. Applying 5V to any pin can damage the chip. Always use a 3.3V power supply and level shifters if interfacing with 5V logic. |
Powering the ESP8266
Voltage |
ESP8266 requires a stable 3.3V power supply. A dedicated 3.3V regulator is recommended. |
Current |
ESP8266 can draw up to 300mA during WiFi transmission. Ensure your power supply can provide sufficient current. |
Decoupling Capacitor |
Use a 100nF capacitor close to the VCC pin to reduce noise and improve stability. |
Boot Modes
Flash Mode |
GPIO0: LOW, GPIO2: HIGH - Used for flashing new firmware. |
Normal Boot Mode |
GPIO0: HIGH, GPIO2: HIGH - Executes the program in flash memory. |
Serial Communication |
Use a USB-to-Serial adapter (e.g., FTDI) to communicate with the ESP8266 via UART. |
Arduino IDE Setup
Board Manager Installation
|
Board Selection
After installation, select your ESP8266 board from
|
Basic Code Structure
|
Common Libraries
|
For connecting to WiFi networks. |
|
For creating TCP client connections. |
|
For creating a web server on the ESP8266. |
Networking with ESP8266
Connecting to WiFi
|
Creating a Web Server
|
Access Point (AP) Mode
|
Troubleshooting and Tips
Common Issues
|
Debugging Techniques
Serial Monitor |
Use |
Exception Decoder |
In case of crashes, use the Exception Decoder tool in the Arduino IDE (Tools > ESP Exception Decoder) to get more information about the error. |
WiFi Scan |
Use |
Power Saving
|
Turn off WiFi to reduce power consumption. |
|
Disconnect from the WiFi network. |
|
Use |