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 | Type | Description |
---|---|---|
VIN | Power Input | Input voltage (5V) when powering the board externally. |
3V3 | Power Output | Provides 3.3V output for external components. |
GND | Ground | Ground connection. |
D0-D8 | GPIO | General-purpose input/output pins. Can be used for digital I/O or PWM. |
A0 | Analog Input | 10-bit ADC input (0-1V range). |
RX | UART Input | UART receive pin for serial communication. |
TX | UART Output | UART transmit pin for serial communication. |
EN | Enable | Enables the chip when pulled high. |
RST | Reset | Resets the microcontroller when pulled low. |
SD3, SD2 | GPIO/SDIO | Can be used for GPIO or SDIO functionality. |
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 network credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";
const int ledPin = D1; // GPIO pin where the LED is connected
void setup() {
pinMode(ledPin, OUTPUT); // Set the LED pin as an output
Serial.begin(115200); // Start the serial communication
delay(10);
// Connect to Wi-Fi
Serial.println("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:
Upload errors in Arduino IDE:
Wi-Fi connection issues:
Unstable operation or frequent resets:
Q: Can I use 5V sensors with the ESP8266 LoLin NodeMCU V3?
A: Yes, but you need a level shifter or voltage divider to step down the signal to 3.3V.
Q: How do I reset the board to factory settings?
A: Press and hold the "RST" button on the board to reset it.
Q: Can I use the board without Wi-Fi?
A: Yes, the ESP8266 can function as a standalone microcontroller without using Wi-Fi.
Q: What is the maximum range of the Wi-Fi module?
A: The range depends on environmental factors but is typically around 30-50 meters indoors.