80 MHz to 160 MHz
80 MHz to 160 MHz
4 MB (30 MHz crystal oscillator)
IEEE 802.11 b/g/n Wi-Fi protocol support
Wi-Fi direct (P2P) and soft-AP modes
WPA/WPA2 encryption support
UART (Serial Communication)
SPI (Serial Peripheral Interface)
I2C (Inter-Integrated Circuit)
I2S (Inter-IC Sound)
GPIO (General Purpose Input/Output) pins | 11 |
Analog-to-Digital Converter (ADC) inputs | 1 |
Onboard voltage regulator (3.3V, 1A)
Power-saving modes | sleep, deep sleep, and hibernate |
25.6 mm x 34.2 mm
DIP-16 (Dual In-Line Package)
-20C to 85C
-40C to 125C
FCC (Federal Communications Commission) certified
CE (Conformit Europene) certified
Advantages
Compact size and low power consumption make it suitable for battery-powered devices
Highly integrated SoC reduces the need for external components
Supports a wide range of development platforms, including Arduino and MicroPython
Affordable and readily available
Applications
home automation, wearable devices, smart sensors, and more
robotic arms, robotic platforms, and autonomous vehicles
smartwatches, fitness trackers, and health monitors
remote monitoring, automation, and control
By leveraging the ESP-12 D1 Mini V2 Board's features and capabilities, developers can create innovative and connected devices that can interact with the internet and other devices, enabling a wide range of IoT applications.
ESP-12 D1 Mini V2 Board Documentation
Overview
The ESP-12 D1 Mini V2 Board is a compact, low-cost, and highly-integrated Wi-Fi System on a Chip (SoC) board based on the ESP8266EX chip. It is a popular choice for IoT projects due to its small size, low power consumption, and ease of use.
Hardware Specifications
Microcontroller: ESP8266EX
Wi-Fi: 802.11 b/g/n
Flash Memory: 4MB
SRAM: 520KB
Interfaces: UART, SPI, I2C, I2S, SDIO, GPIO
Operating Voltage: 3.3V
Operating Current: 150mA (average)
Code Examples
### Example 1: Wi-Fi Connection and HTTP Request
Description: This example demonstrates how to connect the ESP-12 D1 Mini V2 Board to a Wi-Fi network and send an HTTP request to a web server.
Code:
```c
#include <WiFi.h>
// Wi-Fi credentials
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
// HTTP request URL
const char url = "http://example.com";
void setup() {
Serial.begin(115200);
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to Wi-Fi...");
}
Serial.println("Connected to Wi-Fi");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// Send HTTP request
WiFiClient client;
HTTPClient http;
http.begin(client, url);
int httpResponseCode = http.GET();
if (httpResponseCode > 0) {
String response = http.getString();
Serial.println(response);
} else {
Serial.println("Error sending HTTP request");
}
http.end();
delay(5000);
}
```
### Example 2: GPIO Output Control
Description: This example demonstrates how to use the ESP-12 D1 Mini V2 Board's GPIO pins to control an LED.
Code:
```c
const int ledPin = 2; // GPIO2
void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
Serial.println("LED on");
delay(1000);
digitalWrite(ledPin, LOW);
Serial.println("LED off");
delay(1000);
}
```
### Example 3: I2C Communication with a Sensor
Description: This example demonstrates how to use the ESP-12 D1 Mini V2 Board's I2C interface to communicate with a BMP180 temperature and pressure sensor.
Code:
```c
#include <Wire.h>
#define BMP180_ADDRESS 0x77
void setup() {
Serial.begin(115200);
Wire.begin();
// Initialize I2C communication
Wire.beginTransmission(BMP180_ADDRESS);
Wire.write(0x00);
Wire.endTransmission();
}
void loop() {
// Read temperature and pressure data
int tempData = readI2CReg(BMP180_ADDRESS, 0x00);
int pressData = readI2CReg(BMP180_ADDRESS, 0x01);
float temperature = (tempData / 16.0) - 273.15;
float pressure = (pressData / 256.0) + 300;
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" C");
Serial.print("Pressure: ");
Serial.print(pressure);
Serial.println(" mbar");
delay(1000);
}
int readI2CReg(int address, int reg) {
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
Wire.requestFrom(address, 2);
int data = (Wire.read() << 8) | Wire.read();
return data;
}
```
These examples demonstrate the basic functionality of the ESP-12 D1 Mini V2 Board and its potential applications in IoT projects.