Stufin
Home Quick Cart Profile

Lolin Node MCU base

Buy Now on Stufin

Microcontroller

ESP-8266EX

Operating Frequency

80 MHz to 240 MHz

Flash Memory

4MB (32Mb)

SRAM

96 KB

Wi-Fi802.11 b/g/n

GPIO Pins

13

ADC Resolution

10-bit

UART, SPI, and I2C InterfacesYes

Power Management

Built-in voltage regulator

USB Interface

Micro-USB

Operating Temperature

-40C to 85C

Power Consumption

< 200mA (typical)

Conclusion

The Lolin Node MCU Base is a feature-rich and versatile microcontroller board that provides a cost-effective and compact platform for building IoT projects. Its Wi-Fi connectivity, microcontroller capabilities, and wide range of interfaces make it an ideal choice for a wide range of IoT applications.

Pin Configuration

  • Lolin Node MCU Base Pinout Documentation
  • The Lolin Node MCU base is a popular Wi-Fi development board based on the ESP-8266EX microcontroller. It provides a range of features and peripherals, making it an ideal choice for various IoT projects. Here's a detailed explanation of each pin on the Lolin Node MCU base:
  • Pinout Structure:
  • The Lolin Node MCU base has a total of 30 pins, divided into three rows of 10 pins each. The pins are labeled on the top side of the board. Here's the pinout structure:
  • Row 1 (Top Row):
  • 1. 3V3: 3.3V power output from the onboard voltage regulator.
  • 2. RST: Reset pin, active low. Connect to a push-button or a reset circuit to reset the board.
  • 3. A0: Analog input pin, can be used as a digital input/output pin.
  • 4. TX: UART transmit pin, used for serial communication.
  • 5. RX: UART receive pin, used for serial communication.
  • 6. D0: Digital input/output pin, can be used as an interrupt pin.
  • 7. D1: Digital input/output pin, can be used as an interrupt pin.
  • 8. D2: Digital input/output pin, can be used as an interrupt pin.
  • 9. D3: Digital input/output pin, can be used as an interrupt pin.
  • 10. GND: Ground pin, provides a common ground connection.
  • Row 2 (Middle Row):
  • 11. Vin: Input voltage pin, connect to a power source (typically 5V or 3.3V).
  • 12. VU: Unregulated input voltage pin, connect to a battery or an unregulated power source.
  • 13. GND: Ground pin, provides a common ground connection.
  • 14. D4: Digital input/output pin, can be used as an interrupt pin.
  • 15. D5: Digital input/output pin, can be used as an interrupt pin.
  • 16. D6: Digital input/output pin, can be used as an interrupt pin.
  • 17. D7: Digital input/output pin, can be used as an interrupt pin.
  • 18. D8: Digital input/output pin, can be used as an interrupt pin.
  • 19. RXD2: UART receive pin for the second UART.
  • 20. TXD2: UART transmit pin for the second UART.
  • Row 3 (Bottom Row):
  • 21. SDA: I2C data pin, used for I2C communication.
  • 22. SCL: I2C clock pin, used for I2C communication.
  • 23. SCK: SPI clock pin, used for SPI communication.
  • 24. MISO: SPI master in, slave out pin, used for SPI communication.
  • 25. MOSI: SPI master out, slave in pin, used for SPI communication.
  • 26. SS: SPI slave select pin, used for SPI communication.
  • 27. D9: Digital input/output pin, can be used as an interrupt pin.
  • 28. D10: Digital input/output pin, can be used as an interrupt pin.
  • 29. D11: Digital input/output pin, can be used as an interrupt pin.
  • 30. EN: Enable pin, active high. Connect to a power source or a pull-up resistor to keep the board enabled.
  • Connecting the Pins:
  • When connecting the pins, ensure that you:
  • Use a breadboard or a PCB with the correct pin spacing (2.54mm) to connect the Node MCU base to other components.
  • Use jumper wires or dupont wires to connect the pins to other components, modules, or sensors.
  • Follow the recommended pinout structure to avoid confusion and ensure proper connections.
  • Refer to the datasheet and documentation for specific components or modules you're using to ensure compatibility and correct connections.
  • Remember to handle the board with care, as the pins are fragile and can be easily damaged. Avoid applying excessive force, bending, or twisting the pins, as this can cause damage to the board or the pins.

Code Examples

Lolin Node MCU Base Documentation
The Lolin Node MCU Base is a popular IoT component that integrates the ESP-8266 microcontroller, a Wi-Fi module, and other essential components into a single compact board. This documentation provides an overview of the component's features, specifications, and examples of how to use it in various contexts.
Features and Specifications:
Microcontroller: ESP-8266EX (32-bit LX6 microprocessor)
 Wi-Fi Module: Integrated 802.11 b/g/n Wi-Fi module
 Memory: 4MB Flash, 96KB SRAM
 GPIO: 16 digital pins, 1 analog pin
 USB: Micro-USB port for programming and power supply
 Operating Voltage: 3.3V
 Dimensions: 49mm x 25mm
Example 1: Wi-Fi Connected LED Blink
This example demonstrates how to connect the Lolin Node MCU Base to a Wi-Fi network and control an LED using the built-in GPIO pins.
```c
#include <WiFi.h>
const char ssid = "your_wifi_ssid";  // Replace with your Wi-Fi SSID
const char password = "your_wifi_password";  // Replace with your Wi-Fi password
const int ledPin = 16;  // GPIO 16 for LED control
WiFiClient client;
void setup() {
  Serial.begin(115200);
  pinMode(ledPin, OUTPUT);
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("Starting LED blink...");
}
void loop() {
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
}
```
Example 2: MQTT Publishing Sensor Data
This example demonstrates how to connect the Lolin Node MCU Base to an MQTT broker and publish sensor data using the built-in Wi-Fi module and a connected DHT11 temperature and humidity sensor.
```c
#include <WiFi.h>
#include <PubSubClient.h>
#include <DHT.h>
const char ssid = "your_wifi_ssid";  // Replace with your Wi-Fi SSID
const char password = "your_wifi_password";  // Replace with your Wi-Fi password
const char mqttServer = "your_mqtt_broker";  // Replace with your MQTT broker URL
const int dhtPin = 14;  // GPIO 14 for DHT11 connection
WiFiClient espClient;
PubSubClient client(espClient);
DHT dht(dhtPin, DHT11);
void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to Wi-Fi...");
  }
client.setServer(mqttServer, 1883);
}
void loop() {
  float temperature = dht.readTemperature();
  float humidity = dht.readHumidity();
if (!isnan(temperature) && !isnan(humidity)) {
    char temperatureString[10];
    char humidityString[10];
    dtostrf(temperature, 4, 2, temperatureString);
    dtostrf(humidity, 4, 2, humidityString);
client.publish("home/temperature", temperatureString);
    client.publish("home/humidity", humidityString);
Serial.println("Published sensor data to MQTT broker");
  } else {
    Serial.println("Error reading sensor data");
  }
delay(10000);
}
```
These examples demonstrate the versatility of the Lolin Node MCU Base in IoT projects, from simple Wi-Fi connected LED control to more complex applications involving sensor data publishing to an MQTT broker.