The ESP8266 LoLin NodeMCU V3 is a low-cost Wi-Fi microcontroller board based on the ESP8266 chip. It features a built-in USB interface for easy programming and a variety of GPIO pins for connecting sensors, actuators, and other devices. This board is widely used in IoT (Internet of Things) applications due to its affordability, compact size, and robust wireless capabilities.
The ESP8266 LoLin NodeMCU V3 has a total of 30 pins. Below is the pinout description:
Pin Name | Function | Description |
---|---|---|
VIN | Power Input | Accepts 5V input from USB or external power supply. |
3V3 | Power Output | Provides 3.3V output for external components. |
GND | Ground | Common ground for the circuit. |
D0-D8 | GPIO Pins | General-purpose input/output pins. Can be used for digital I/O or PWM. |
A0 | Analog Input | 10-bit ADC pin for reading analog signals (0-1V range). |
RX | UART Receive | Serial data input for UART communication. |
TX | UART Transmit | Serial data output for UART communication. |
EN | Enable | Active-high pin to enable the module. |
RST | Reset | Resets the microcontroller when pulled low. |
SD3, SD2 | SPI Pins | Used for SPI communication (shared with GPIO). |
SCL, SDA | I2C Pins | Used for I2C communication (shared with GPIO). |
Powering the Board:
Programming the Board:
Connecting Sensors and Actuators:
The following example demonstrates how to connect the ESP8266 LoLin NodeMCU V3 to a Wi-Fi network and control an LED connected to GPIO pin D1.
#include <ESP8266WiFi.h> // Include the ESP8266 Wi-Fi library
// Replace with your Wi-Fi credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";
const int ledPin = D1; // GPIO pin for the LED
void setup() {
Serial.begin(115200); // Initialize serial communication
pinMode(ledPin, OUTPUT); // Set the LED pin as an output
// Connect to Wi-Fi
Serial.print("Connecting to Wi-Fi");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nWi-Fi connected!");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP()); // Print the device's IP address
}
void loop() {
digitalWrite(ledPin, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(ledPin, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
The board is not detected by the computer:
Wi-Fi connection fails:
GPIO pins not working as expected:
INPUT
, OUTPUT
). Upload errors in Arduino IDE:
Can I power the board with a battery?
Yes, you can use a 3.7V LiPo battery connected to the VIN and GND pins. Ensure the battery voltage does not exceed 5V.
What is the maximum current the GPIO pins can handle?
Each GPIO pin can source or sink up to 12mA. For higher currents, use an external transistor or relay.
Can I use the board without Wi-Fi?
Yes, the ESP8266 can function as a standalone microcontroller for non-Wi-Fi applications.
How do I reset the board?
Press the "RST" button on the board or pull the RST pin low momentarily.