02Lesson
Robotics Lab: NodeMCU (ESP8266) Lesson and Pinout
Select a board in Robotics Lab to see its specifications, pin functions and component guide.
Board overview
Robotics Lab board guide · NodeMCU / Amica · 2015
A tiny Wi-Fi board built around the ESP8266 chip: it plugs into a breadboard, is programmed over USB from the Arduino IDE and gets online all by itself. It is the classic starting point for smart-home gadgets, phone-controlled robots and sensors that send their readings to the internet.
- Clock
- 80 MHz
- Flash
- 4 MB
- RAM
- ≈80 KB
- GPIO pins
- 11
- Logic level
- 3.3 V
- Price
- ≈ $3
Specs
Compare the electrical specs with other Robotics Lab boards. See the hardware references.
- Microcontroller
- ESP8266EX (ESP-12E module)
- Core
- Tensilica L106, 32-bit, single core
- Clock speed
- 80 MHz (up to 160 MHz)
- Flash memory
- 4 MB (separate chip inside the module)
- RAM
- ≈80 KB, about 50 KB free for your program
- Wireless
- Wi-Fi 802.11 b/g/n, 2.4 GHz; no Bluetooth
- Logic level
- 3.3 V (inputs are not 5 V tolerant)
- Digital pins
- 11 (D0–D8, RX, TX), PWM on D1–D8
- Analog inputs
- 1 (A0, 0–3.3 V, 10-bit)
- Interfaces
- UART, I²C, SPI
- USB
- Micro-USB, CP2102 bridge
- Power
- USB 5 V or Vin 5–10 V; AMS1117-3.3 regulator
- Size
- 48 × 26 mm
What’s on the board
14 parts match the numbered labels in Robotics Lab. Click one and the camera flies to it.
Strengths and pitfalls
Use these trade-offs when choosing a board in Robotics Lab.
Strengths
- Wi-Fi right on the board: web server, MQTT, control from a phone — no extra modules needed
- Programmed from the Arduino IDE (or in MicroPython) — familiar sketches and libraries just work
- One-click upload over USB: the auto-reset circuit puts the chip into bootloader mode for you
- Fast 32-bit processor and 4 MB of flash — many times more than an Arduino Uno
Watch out
- 3.3 V logic: a 5 V signal from an Arduino or a sensor (e.g. the Echo pin of an HC-SR04) can destroy an input — use a voltage divider or a level shifter
- There is only one analog input, and A0 must never see more than 3.3 V
- D3, D4 and D8 are strapping pins: if a sensor or button holds them at the wrong level at power-up, the board will not start
- A pin can supply only about 12 mA: power motors, servos and relays from a separate supply and connect the grounds together
- Pins SD0–SD3, CMD and CLK belong to the flash memory — leave them alone
Pins
Learn which pins to use on the Robotics Lab workbench.
Power
Power the board from USB or feed 5 V into Vin. 3V3 is the regulator output for sensors (a couple of hundred mA in total, shared with the chip itself, which draws bursts of up to 300 mA while transmitting). All GND pins are connected together.
D numbers vs GPIO
Robotics Lab labels the board pins D0–D8. In code, the corresponding GPIO numbers are: D0=16, D1=5, D2=4, D3=0, D4=2, D5=14, D6=12, D7=13, D8=15. In the Arduino IDE you can simply write D1, D2 — the constants are already defined.
Safe pins
Feel free to use D1, D2, D5, D6 and D7 — they have no special roles. D3, D4 and D8 affect how the chip boots, D0 has no PWM or interrupts, and RX/TX are busy talking to the computer.
Analog input
A0 is the only one on the board: 0–3.3 V, values from 0 to 1023. If you need several analog sensors, add an external I²C ADC (such as the ADS1115) or a multiplexer.
Buses
I²C: D1 (SCL) and D2 (SDA) — displays, gyroscopes, sensors. SPI: D5 (SCK), D6 (MISO), D7 (MOSI), D8 (CS). PWM for motors and LEDs works on D1–D8, 10-bit by default (0…1023).
Hover over a pin in the Robotics Lab viewer to see its name and function.
- Power
- Ground
- Digital
- Analog
- Buses: UART, I²C, SPI
- Control: RESET, EN, BOOT
- Not connected
First code
Try the Robotics Lab starter example on your physical board.
#include <ESP8266WiFi.h>const char* ssid = "MyWiFi"; // your network nameconst char* pass = "12345678"; // its passwordvoid setup() { pinMode(LED_BUILTIN, OUTPUT); // blue LED on D4 (GPIO2) Serial.begin(115200); WiFi.begin(ssid, pass); // start connecting while (WiFi.status() != WL_CONNECTED) { // no network yet — blink fast digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); delay(200); } Serial.print("My IP address: "); Serial.println(WiFi.localIP());}void loop() { digitalWrite(LED_BUILTIN, LOW); // LOW turns the LED ON (it is inverted) delay(100); digitalWrite(LED_BUILTIN, HIGH); // HIGH turns it off delay(1900); // one short flash every 2 seconds}
Where it shines
Use the Robotics Lab workbench to plan the wiring for a project.
- Wi-Fi rover: drive the motors from your phone through a web page
- Weather station: temperature and humidity sensor posting to a website or a chat bot
- Smart plug or light: a relay switched over Wi-Fi and on a schedule
- Robot remote and telemetry: sensor readings shown live on a phone screen
- Teamed with an Arduino: NodeMCU handles the network, the second board drives the motors
Board background
See how this hardware fits into the Robotics Lab board collection.
The ESP8266 appeared in 2014 as a cheap "Wi-Fi adapter" for other microcontrollers — only later did hobbyists discover that it makes a great main processor on its own.
The name NodeMCU comes from a firmware based on the Lua language; today these boards are mostly programmed from the Arduino IDE or in MicroPython.
In deep sleep the ESP8266 chip itself draws only about 20 µA, so a bare module can run a battery-powered sensor for months. On this dev board the USB bridge and the regulator add a few milliamps on top.
Practice with this board
Try the same board in these Robotics Lab activities.
- Inspect the Robotics Lab 3D model to locate a component or connector.
- Try the Robotics Lab component quiz to check what you remember.
- Open the Robotics Lab workbench to simulate your wiring.
Sources
Manufacturer and hardware project documentation.
- NodeMCU DevKit v1.0 hardware repository
The NodeMCU project’s board design files, pin map and schematics.