The ESP-01 is a compact Wi-Fi module that enables microcontrollers to connect to a Wi-Fi network. Based on the ESP8266 SoC (System on Chip), it is a popular choice for Internet of Things (IoT) projects due to its low cost and ease of use. The module can be programmed using the Arduino IDE, which makes it accessible for hobbyists and professionals alike. Common applications include home automation, sensor networks, and wireless data logging.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground |
2 | GPIO2 | General Purpose Input/Output 2 |
3 | GPIO0 | General Purpose Input/Output 0 |
4 | RX | UART Receive Pin |
5 | TX | UART Transmit Pin |
6 | CH_PD | Chip Power-Down, active high |
7 | RST | Reset Pin, active low |
8 | VCC | Power Supply (3.0V to 3.6V) |
#include <ESP8266WiFi.h>
// Replace with your network credentials
const char* ssid = "yourSSID";
const char* password = "yourPASSWORD";
void setup() {
Serial.begin(115200); // Start serial communication at 115200 bps
WiFi.begin(ssid, password); // Connect to Wi-Fi
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP()); // Print the local IP address
}
void loop() {
// Nothing to do here
}
Q: Can I use the ESP-01 with a 5V power supply? A: No, the ESP-01 requires a 3.3V power supply. Using 5V can damage the module.
Q: How can I extend the number of GPIOs available on the ESP-01? A: You can use an I/O expander or shift register to increase the number of controllable pins.
Q: Is it possible to use the ESP-01 for deep sleep applications? A: Yes, the ESP-01 supports deep sleep mode for low-power applications, but it requires additional wiring to connect the RST pin to a GPIO for wake-up.
Remember to always follow the manufacturer's datasheet and guidelines for the most accurate and detailed information on the ESP-01 module.