The ESP8266 ESP-01 WiFi Module is a self-contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network. It is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor. With its compact size and comprehensive feature set, the ESP8266 ESP-01 is a versatile component that enables rapid deployment of IoT solutions.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground |
2 | GPIO2 | General Purpose I/O 2 |
3 | GPIO0 | General Purpose I/O 0 |
4 | RX | UART Receive Pin |
5 | TX | UART Transmit Pin |
6 | CH_PD | Chip Power-down Pin. Active high. |
7 | RST | Reset Pin. Active low. |
8 | VCC | 3.3V Power Supply |
#include <ESP8266WiFi.h>
// Replace with your network credentials
const char* ssid = "yourSSID";
const char* password = "yourPASSWORD";
void setup() {
Serial.begin(115200); // Start the Serial communication to send messages to the computer
delay(10);
Serial.println('\n');
WiFi.begin(ssid, password); // Connect to the network
Serial.print("Connecting to ");
Serial.print(ssid); Serial.println(" ...");
int i = 0;
while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
delay(1000);
Serial.print(++i); Serial.print(' ');
}
Serial.println('\n');
Serial.println("Connection established!");
Serial.print("IP address:\t");
Serial.println(WiFi.localIP()); // Send the IP address of the ESP8266 to the computer
}
void loop() { /* Nothing to do here */ }
Q: Can I power the ESP-01 with 5V? A: No, you must use a 3.3V power supply.
Q: How do I put the ESP-01 into programming mode? A: Ground GPIO0 and reset the module by pulling RST to ground momentarily.
Q: Can I use the ESP-01 with a 5V microcontroller like an Arduino UNO? A: Yes, but you will need a logic level converter for the RX and TX pins.
Q: How can I extend the range of the ESP-01? A: Use an external antenna and ensure that the antenna area is free from obstructions and interference.