Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Boards & Microcontrollers
  4. ›D1 Mini (ESP8266)

Component guide · Beginner · 3 min read

D1 Mini (ESP8266)

Pinout, Wiring and Code

By Geekobot Learning Team · Updated 29 Oct 2026

On this page
Short answerWhat the D1 Mini (ESP8266) isD1 Mini (ESP8266) pinoutWiring the D1 Mini (ESP8266)Example codeSetup and tuningWhat you needAlternatives and when to choose themTry itCommon mistakesFAQsParts and next steps
Short answer

The D1 Mini is a small ESP8266 Wi-Fi board with USB, a 3.3 V regulator and 11 usable pins in a 34 x 26 mm footprint. Program it from the Arduino IDE with the ESP8266 core and the 'LOLIN(WEMOS) D1 mini' board. Logic is 3.3 V, A0 reads 0 to 3.2 V through an on-board divider, and stacking shields add sensors, relays and displays.

Key specs at a glance

Chip
ESP8266EX, 80/160 MHz, 4 MB flash
Wi-Fi
2.4 GHz 802.11 b/g/n
Pins
11 digital I/O, 1 analog input (A0, 0 to 3.2 V)
Logic
3.3 V
Power
USB 5 V, or 5 V pin, or 3.3 V pin
USB
CH340 serial chip (driver may be needed on Windows)
01

What the D1 Mini (ESP8266) is

The D1 Mini puts the ESP8266 on a small board with everything needed to program it from USB. It is a favourite for compact Wi-Fi sensors, smart switches running Tasmota or ESPHome, and battery nodes with deep sleep.

Pin labels (D0 to D8) differ from GPIO numbers, which is the most common source of confusion. Use the D labels in Arduino code or look up the GPIO number.

02

D1 Mini (ESP8266) pinout

The pins on the D1 Mini (ESP8266) and what each one does.

PinFunction
D0 (GPIO16)Wake from deep sleep (connect to RST); no PWM or interrupts
D1 (GPIO5)I2C SCL
D2 (GPIO4)I2C SDA
D3 (GPIO0)Flash button, must be HIGH at boot
D4 (GPIO2)On-board LED (active LOW), must be HIGH at boot
D5 to D7 (GPIO14, 12, 13)SPI SCK, MISO, MOSI
D8 (GPIO15)SPI CS, must be LOW at boot
A0Analog input, 0 to 3.2 V
5V / 3V3 / GNDPower pins
PinFunction
D0 (GPIO16)
Wake from deep sleep (connect to RST); no PWM or interrupts
D1 (GPIO5)
I2C SCL
D2 (GPIO4)
I2C SDA
D3 (GPIO0)
Flash button, must be HIGH at boot
D4 (GPIO2)
On-board LED (active LOW), must be HIGH at boot
D5 to D7 (GPIO14, 12, 13)
SPI SCK, MISO, MOSI
D8 (GPIO15)
SPI CS, must be LOW at boot
A0
Analog input, 0 to 3.2 V
5V / 3V3 / GND
Power pins
03

Wiring the D1 Mini (ESP8266)

A typical I2C sensor hookup plus the deep sleep link. Avoid D3, D4 and D8 for buttons or relays because they set the boot mode.

D1 Mini (ESP8266) pinConnect toNotes
D2 (SDA)Sensor SDAI2C data
D1 (SCL)Sensor SCLI2C clock
3V3Sensor VCC3.3 V sensors only
GNDSensor GNDCommon ground
D0RSTDeep sleep wake; remove while uploading
D2 (SDA)
Connect to:
Sensor SDA
Notes:
I2C data
D1 (SCL)
Connect to:
Sensor SCL
Notes:
I2C clock
3V3
Connect to:
Sensor VCC
Notes:
3.3 V sensors only
GND
Connect to:
Sensor GND
Notes:
Common ground
D0
Connect to:
RST
Notes:
Deep sleep wake; remove while uploading
04

Example code

In the Arduino IDE add the ESP8266 boards URL, install 'esp8266 by ESP8266 Community' and pick 'LOLIN(WEMOS) D1 mini'.

Blink and connect to Wi-Fi · Arduino C++Verify & upload in Electrolark
#include <ESP8266WiFi.h>

const char* SSID = "your-wifi";
const char* PASS = "your-password";

void setup() {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
  WiFi.begin(SSID, PASS);
  while (WiFi.status() != WL_CONNECTED) {
    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
    delay(250);
  }
  digitalWrite(LED_BUILTIN, LOW);  // LED on = connected (active LOW)
  Serial.println(WiFi.localIP());
}

void loop() {}
05

Setup and tuning

Deep sleep

connect D0 to RST, then ESP.deepSleep(60e6) sleeps for 60 s and wakes by reset. Disconnect the link while uploading.

Battery

the regulator and USB chip draw some current even in sleep; for long battery life use a board variant with a low-quiescent regulator.

A0 range

the on-board divider scales 3.2 V to the chip's 1 V input. Add your own divider for higher voltages.

No-code firmware

ESPHome and Tasmota support the D1 Mini for Home Assistant projects (MQTT and Home Assistant).

06

What you need

Shop this list5 of 5 found in our store · ₹731

  • D1 Mini V2 ESP8266 Wi-Fi development board: the board this guide coversD1 Mini V2 NodeMcu ESP8266 WiFi IoT Development Board₹209Closest match, check the specs
  • D1 Mini dual motor shield (TB6612FNG): a stacking shield for motorsWemos D1 Mini Dual Motor Shield (TB6612FNG)₹349
  • Asair AHT20 temperature and humidity sensor: a first Wi-Fi sensorAsair AHT20 Temperature & Humidity Sensor -40°C to +85°C – I2C Digital Output₹56Closest match, check the specs
  • Solderless breadboard: to build without solderingSolderless Breadboard₹68
  • Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
07

Alternatives and when to choose them

  • ✓ESP8266 NodeMCU: same chip, larger board with more labelled pins.
  • ✓ESP32: more GPIOs, Bluetooth, two cores.
  • ✓Seeed XIAO boards: even smaller, including ESP32-C3 and S3.
08

Try it: Battery life calculator

Change the values and the diagram and results update as you type.

09

Common mistakes to avoid

  • !Using GPIO numbers where the code expects D labels (or the other way round).
  • !Holding D3, D4 or D8 in the wrong state at boot, so it will not start.
  • !Feeding 5 V signals into the pins.
  • !Leaving D0 connected to RST while uploading.
10

Frequently asked questions

Which board do I select in Arduino IDE?

'LOLIN(WEMOS) D1 mini' (or D1 mini Lite/Pro if you have those) from the ESP8266 core.

Is it 5 V tolerant?

Not officially. Use 3.3 V logic; the 5V pin is for power only.

Why is the LED on when I write LOW?

The built-in LED on D4 is active LOW.

How do I use deep sleep?

Connect D0 to RST and call ESP.deepSleep with a time in microseconds.

What voltage can A0 read?

0 to about 3.2 V thanks to the on-board divider.

Can it run Home Assistant firmware?

Yes. ESPHome and Tasmota both support it.

Parts for this guide

  • D1 Mini V2 NodeMcu ESP8266 WiFi IoT Development Board
    ₹209View
  • Wemos D1 Mini Dual Motor Shield (TB6612FNG)
    ₹349View
  • Asair AHT20 Temperature & Humidity Sensor -40°C to +85°C – I2C Digital Output
    ₹56View
  • Solderless Breadboard
    ₹68View
  • Dupont Jumper Wires (40 pcs)
    ₹49View
Shop Wi-Fi Modules & Development Boards

Calculators

Battery life calculator

Projects that use it

Put this into practice: 9 step-by-step builds in our project library use parts from this guide.

Beginner · 1–2 hoursWi-Fi smart switchView projectBeginner · 1–2 hoursWi-Fi door sensorView projectBeginner · 1–2 hoursWi-Fi fridge thermometerView project
Browse all 9 projects

Keep learning

Component guideBeginnerESP8266 NodeMCUThe ESP8266 is a 3.3 V Wi-Fi microcontroller, and NodeMCU is the most common board built around it.3 min read · Boards & MicrocontrollersComparisonBeginnerESP32 vs ESP8266ESP32 vs ESP8266 compared: cores, RAM, GPIO, ADC, Bluetooth, power and price, plus ESP32-C3, S3 and C6 variants, and which board to pick for your project.4 min read · Boards & MicrocontrollersConcept explainerIntermediateMQTT and Home Assistant for ESP32MQTT is a lightweight messaging system: devices publish messages to named topics on a broker, and anything subscribed to that topic receives them.3 min read · IoT & WirelessHow-toIntermediateESP-NOWESP-NOW is Espressif's connectionless protocol that lets ESP32 and ESP8266 boards send short messages directly to each other with no router.3 min read · IoT & Wireless

Sources

  • ESP8266EX datasheet (Espressif)
  • ESP8266 Arduino core documentation
  • LOLIN D1 mini documentation

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the D1 Mini (ESP8266) isD1 Mini (ESP8266) pinoutWiring the D1 Mini (ESP8266)Example codeSetup and tuningWhat you needAlternatives and when to choose themTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide3 items · ₹626

D1 Mini V2 NodeMcu ESP8266 WiFi IoT Development Board · Wemos D1 Mini Dual Motor Shield (TB6612FNG) · Solderless Breadboard

Run itChange the inputs and watch the output
LED: connecting OFF
Serial monitor115200 baud
 

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question