ESP8266 Wake-on-LAN

Wireless PC power button - NodeMCU + touch sensor + LCD.

ESP8266ArduinoC++WakeOnLan libI2C LCD

Overview

A wireless remote PC power-on button using a NodeMCU ESP8266, Wake-on-LAN, and a 16x2 I2C LCD display. Press a capacitive touch sensor to wake a desktop computer over the network - about $8–12 in parts.

  • ✓Capacitive touch (TTP223 on D6/GPIO12) - tap to send the magic packet
  • ✓16x2 I2C LCD (0x27) status flow: WiFi Connected → Ready to Touch → WAKING PC... → Packet Sent!
  • ✓Auto WiFi reconnect, millis()-based non-blocking loop, 200 ms debounce
  • ✓Local-network only - no cloud dependency; MIT licensed
ESP8266ArduinoC++WakeOnLan libI2C LCDTTP223 Touch

Device LCD - 16×2 I2C · 0x27

WiFi Connected

Ready to Touch

Replays the firmware flow: Ready to Touch → WAKING PC... → Packet Sent!

LCD D1/D2 · 5V VIN

TOUCH D6/GPIO12 · 3V3

BOM ~$8–12 · NodeMCU + LCD + TTP223

Target MAC → Config.h bytes

 -  type a MAC  - 

Evidence · from the repo

How it works

  1. TouchTTP223 sensor on D6 fires; debounce filters false triggers.
  2. DisplayLCD line 2 flips from "Ready to Touch" to "WAKING PC...".
  3. TransmitWakeOnLan lib broadcasts the 102-byte magic packet for the Config.h MAC.
  4. BootTarget NIC (WoL enabled in BIOS + OS) powers the PC on; LCD shows "Packet Sent!".

BILL OF MATERIALS (~$8–12)

PartNotes
NodeMCU ESP8266 (ESP-12E)Main board
16x2 I2C LCD (PCF8574)Address 0x27 - needs 5V from VIN
TTP223 touch sensorDigital out to D6 - 3.3V supply
Jumper wires + Micro-USBProgramming and power

WIRING

ConnectionPin
LCD SCL / SDAD1 (GPIO5) / D2 (GPIO4)
LCD VCC / GNDVIN 5V / GND - never 3.3V
Touch OUT / VCC / GNDD6 (GPIO12) / 3V3 / GND

CONFIG.H ESSENTIALS

SettingValue
TARGET_MAC{0x94, 0xDE, 0x80, 0x7B, 0x2F, 0x99}
TOUCH_PIN12 (D6)
LCD_I2C_ADDRESS0x27 (try 0x3F if blank)

CONFIG.H

cpp
const char* WIFI_SSID = "YourWiFiSSID";
const char* WIFI_PASSWORD = "YourWiFiPassword";
const byte TARGET_MAC[6] = {0x94, 0xDE, 0x80, 0x7B, 0x2F, 0x99};
const int TOUCH_PIN = 12;

FIND THE PC MAC (WINDOWS)

cmd
ipconfig /all | findstr "Physical"

Build log · reproduce it

REPRODUCE
—Arduino IDE + ESP8266 board support; libs: LiquidCrystal I2C, WakeOnLan
—Board: NodeMCU 1.0 (ESP-12E); edit Config.h (WiFi, MAC, pins)
—PC side: enable WoL in BIOS + adapter (magic packet, allow wake)
—Upload sketch → Serial Monitor @115200 → touch to wake