ESP32 Node MCU Development Board with Wifi and Bluetooth (CP2102 Driver, 30 PIN)
The ESP32 Node MCU Development Board is a microcontroller-based development board that features the ESP32 system on a chip (SoC), which integrates Wi-Fi, Bluetooth, and a range of peripherals. With 30 GPIO pins, this board offers a versatile platform for building IoT projects. This documentation provides an overview of the board's features, pinouts, and code examples to get you started.
ESP32 SoC with Wi-Fi and Bluetooth capabilities
CP2102 USB-to-UART driver for programming and communication
30 GPIO pins for connecting sensors, actuators, and other peripherals
Onboard 3.3V voltage regulator for powering external devices
Micro-USB connector for programming and power supply
The ESP32 Node MCU Development Board has a 30-pin header with the following pinouts:
| Pin | Function |
| --- | --- |
| 1-5 | GPI0-4 |
| 6-10 | GPI5-9 |
| 11-15 | GPI10-14 |
| 16-20 | GPI15-19 |
| 21-25 | GPI20-24 |
| 26-28 | VCC, GND, EN |
| 29-30 | RXD, TXD |
### Example 1: Wi-Fi Connection and HTTP Client
This example demonstrates how to connect to a Wi-Fi network and send an HTTP request using the ESP32's Wi-Fi capabilities.
```c
#include <WiFi.h>
#include <HTTPClient.h>
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
const char serverUrl = "http://example.com";
WiFiClient wifiClient;
HTTPClient httpClient;
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
Serial.println("Initializing HTTP client...");
}
void loop() {
if (WiFi.status() == WL_CONNECTED) {
httpClient.begin(wifiClient, serverUrl);
int httpResponseCode = httpClient.GET();
if (httpResponseCode > 0) {
Serial.println("HTTP response code: " + String(httpResponseCode));
String responseBody = httpClient.getString();
Serial.println("Response body: " + responseBody);
} else {
Serial.println("Error sending HTTP request");
}
httpClient.end();
} else {
Serial.println("Error: Not connected to WiFi");
}
### Example 2: Bluetooth Low Energy (BLE) Peripheral
This example demonstrates how to use the ESP32's Bluetooth capabilities to create a BLE peripheral that advertises a custom service.
const char deviceName = "ESP32_BLE_Peripheral";
const char serviceName = "ESP32_Service";
const char serviceUUID = "ESP32_Service_UUID";
const char characteristicUUID = "ESP32_Characteristic_UUID";
BLEServer server;
BLEService service;
BLECharacteristic characteristic;
void setup() {
Serial.begin(115200);
BLE.begin(deviceName);
server = BLE.getServer();
service = server->createService(serviceUUID);
characteristic = service->createCharacteristic(characteristicUUID, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);
}
void loop() {
server->startAdvertising();
Serial.println("Advertising BLE peripheral...");
These examples demonstrate the basic functionality of the ESP32 Node MCU Development Board. With its Wi-Fi and Bluetooth capabilities, this board is ideal for building IoT projects that require wireless communication.