Skip to the content
PCBKitNew board
2 layersPc power remote switch, the printed circuit board in 3D

Pc power remote switch

Rudra2002/ComputerControl

The system communicates over MQTT (with WebSocket support), enabling a static web dashboard — deployable on Cloudflare Pages or any CDN — to send commands and receive real-time status updates from anywhere.

Copper layers
2
Thickness
1.6 mm
Parts
12
Nets
26
Pads
56
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 8.0 (file 20240108)
Created
12 Mar 2026
Updated
4 Jul 2026

Overview

Pc power remote switch is an open-source printed circuit board by Rudra2002, from the Rudra2002/ComputerControl repository on GitHub. It is a 2-layer board with 12 parts on 26 nets.

It is built around the WEMOS D1 MINI and 1000UF 16V. Its parts include 4 ICs, 3 resistors, 3 connectors and 2 capacitors. It belongs with the ESP8266 boards of this library.

Main components

2

README

README.md

🖥️ ComputerControl

Remotely power on, restart, and monitor your PC from anywhere in the world — using an ESP32 microcontroller, MQTT, and a sleek web dashboard.

ESP32 PlatformIO MQTT Vite License


📋 Table of Contents


Overview

ComputerControl is an IoT project that lets you control your PC's power and restart buttons remotely over the internet. An ESP32 physically connects to your PC's front-panel headers via relay modules and monitors the power LED to detect the PC's on/off state.

The system communicates over MQTT (with WebSocket support), enabling a static web dashboard — deployable on Cloudflare Pages or any CDN — to send commands and receive real-time status updates from anywhere.


Architecture

text
┌──────────────────────────────────────────────────────────────────┐
│                        CLOUD / INTERNET                          │
│                                                                  │
│  ┌─────────────────────┐         ┌────────────────────────────┐  │
│  │   Web Dashboard     │◄──WSS──►│     MQTT Broker            │  │
│  │  (Cloudflare Pages) │         │  (broker.emqx.io or self)  │  │
│  │                     │         │                            │  │
│  │  • Power ON/OFF     │         │  Topics:                   │  │
│  │  • Restart          │         │  computercontrol/{id}/...  │  │
│  │  • Live status      │         │    /status                 │  │
│  │  • Activity log     │         │    /command                │  │
│  └─────────────────────┘         │    /response               │  │
│                                  │    /lwt                    │  │
│                                  └────────────┬───────────────┘  │
│                                               │                  │
└───────────────────────────────────────────────┼──────────────────┘
                                                │ MQTT (TCP 1883)
                                                │
┌───────────────────────────────────────────────┼──────────────────┐
│  LOCAL NETWORK                                │                  │
│                                               │                  │
│                        ┌──────────────────────▼───────────────┐  │
│                        │         ESP32 WROOM-32               │  │
│                        │                                      │  │

Features

Firmware (ESP32)

  • Relay control — Momentary press simulation for power and restart buttons
  • PC status monitoring — Reads the motherboard power LED to detect ON/OFF state
  • WiFiManager — No hardcoded WiFi credentials; configure via captive portal
  • MQTT with LWT — Last Will & Testament for instant offline detection
  • Rate limiting — Prevents accidental rapid-fire relay triggers (3s cooldown)
  • Persistent config — MQTT settings saved to flash via the Preferences library
  • Config reset — Hold the BOOT button on power-up to factory reset

Web Dashboard

  • Modern glassmorphism UI — Dark theme with ambient background effects
  • Real-time status ring — Visual indicator for PC online/offline/unknown states
  • MQTT over WebSocket — Connects via wss:// for TLS-encrypted communication
  • Activity log — Timestamped log of all events and commands
  • Toast notifications — Non-intrusive feedback for actions and errors
  • Settings persistence — Browser localStorage with base64 encoding
  • Auto-disconnect — Automatically disconnects after 30 minutes of inactivity
  • Responsive design — Works on desktop, tablet, and mobile

Schematic

The circuit schematic is designed in KiCad and included in the kicad-circuit/ directory.

Circuit Schematic

Full schematic available as PDF and SVG. The KiCad project files (.kicad_sch, .kicad_pcb, .kicad_pro) are also included for editing.

Hardware Image

Key Circuit Details

ComponentConnectionPurpose
Relay Module 1ESP32 GPIO 25 → Relay INSimulates PC power button press
Relay Module 2ESP32 GPIO 26 → Relay INSimulates PC restart button press
Voltage Divider / OptocouplerPC Power LED → ESP32 GPIO 34Safely reads the PC power LED state
ESP32 Onboard LEDGPIO 2Visual feedback (MQTT connected, boot, etc.)

Wiring to ATX Front Panel Headers

The relay outputs connect in parallel to the motherboard's front-panel power switch (PWR_SW) and reset switch (RST_SW) headers. When the ESP32 activates a relay for 500ms, it mimics a physical button press.

text
Motherboard PWR_SW Header:       Motherboard RST_SW Header:
  ┌───┐                            ┌───┐
  │ + ├──── Relay 1 COM            │ + ├──── Relay 2 COM
  │ - ├──── Relay 1 NO             │ - ├──── Relay 2 NO
  └───┘                            └───┘

⚠️ Note: GPIO 34 is an input-only pin on the ESP32 — perfect for reading the PC power LED but cannot output signals.


Pin Mapping

GPIODirectionFunctionNotes
34InputPC Power LED sensorInput-only GPIO, no internal pull-up
25OutputPower relay triggerActive HIGH for 500ms
26OutputRestart relay triggerActive HIGH for 500ms
2OutputOnboard LEDIndicates MQTT connection & boot
0InputConfig reset buttonHold LOW on boot to reset WiFi/MQTT settings

Hardware Requirements

ComponentQuantityNotes
ESP32 WROOM-32 DevKit1Any ESP32 dev board with GPIO access
5V Relay Module (1-channel)2One for power, one for restart
Jumper Wires (F-F, M-F)~10For connecting ESP32, relays, and ATX headers
USB Cable (Micro-USB / Type-C)1For flashing and powering the ESP32
PC with ATX Motherboard1Target PC to control
Optocoupler / Voltage divider1(Optional) For safe PC LED reading via GPIO 34

Software Prerequisites

ToolPurposeInstall
PlatformIOFirmware build & flashVS Code extension or CLI
Node.js (v18+)Web dashboard developmentDownload from nodejs.org
GitVersion controlDownload from git-scm.com

Getting Started

1. Flash the ESP32 Firmware

bash
# Clone the repository
git clone https://github.com/Rudra2002/ComputerControl.git
cd ComputerControl

# Build and upload the firmware
cd firmware
pio run --target upload

# Monitor serial output (optional)
pio device monitor --baud 115200

The firmware automatically installs its dependencies (PubSubClient, ArduinoJson, WiFiManager) via PlatformIO.

2. Configure WiFi & MQTT

On first boot (or after a config reset), the ESP32 creates a WiFi access point:

SettingValue
SSIDComputerControl-Setup
Passwordsetup1234
Portal timeout180 seconds
  1. Connect to the ComputerControl-Setup WiFi network from your phone or laptop
  2. A captive portal opens automatically — enter your WiFi credentials
  3. Scroll down to MQTT Configuration and fill in:
    • MQTT Broker Host — e.g. broker.emqx.io (free public broker)
    • MQTT Broker Port — 1883 (TCP) or 8084 (WebSocket TLS on EMQX)
    • Device ID — A unique name like my-pc-ctrl (used to build MQTT topics)
    • MQTT Username / Password — optional, depends on your broker
  4. Click Save — the ESP32 connects to WiFi and the MQTT broker

To reset configuration: Hold the BOOT button (GPIO 0) while powering on the ESP32. The LED will blink rapidly, and the captive portal will reappear.

3. Deploy the Web Dashboard

Local Development
bash
cd web
npm install
npm run dev
# Opens at http://localhost:3000
Production Build (for Cloudflare Pages, Netlify, etc.)
bash
cd web
npm run build
# Output in web/dist/ — deploy this folder
Connecting the Dashboard
  1. Open the web dashboard in your browser
  2. Enter your MQTT broker's WebSocket URL — e.g. wss://broker.emqx.io:8084/mqtt
  3. Enter the Device ID you configured on the ESP32
  4. (Optional) Enter MQTT username/password if your broker requires authentication
  5. Click Connect — the dashboard will show real-time PC status

MQTT Topic Reference

All topics follow the pattern: computercontrol/{device_id}/...

TopicDirectionQoSPayloadDescription
…/statusESP32 → Web0{"pc":1,"uptime":3600,"rssi":-55,"ip":"192.168.1.100"}Periodic status (every 2s)
…/commandWeb → ESP321{"action":"power"}Send command (power, restart, status)
…/responseESP32 → Web0{"success":true,"message":"Power button pressed"}Command acknowledgement
…/lwtBroker → Web1{"online":false}Last Will — sent when ESP32 disconnects

Security Features

FeatureLayerDescription
WiFiManager PortalFirmwareNo hardcoded WiFi credentials
MQTT AuthenticationFirmware + WebOptional username/password for broker access
Command Rate LimitingFirmwareMin 3-second interval between relay commands
Topic NamespacingMQTTUnique device ID isolates traffic
LWT (Last Will)MQTTBroker notifies dashboard if ESP32 drops offline
WSS (TLS)WebWeb dashboard connects via encrypted WebSocket
Inactivity Auto-DisconnectWebDashboard disconnects after 30 min of inactivity
Settings ObfuscationWeblocalStorage settings encoded with base64

Project Structure

text
ComputerControl/
├── firmware/                  # ESP32 firmware (PlatformIO)
│   ├── platformio.ini         # Build config & dependencies
│   └── src/
│       ├── config.h           # Pin definitions, timing, MQTT defaults
│       └── main.cpp           # Main firmware — WiFi, MQTT, relay logic
│
├── web/                       # Web dashboard (Vite + vanilla JS)
│   ├── index.html             # Dashboard HTML (connect screen + dashboard)
│   ├── package.json           # npm dependencies (mqtt.js)
│   ├── vite.config.js         # Vite dev server config
│   └── src/
│       ├── main.js            # MQTT client, UI logic, command handling
│       └── style.css          # Glassmorphism dark theme, animations
│
├── kicad-circuit/             # Hardware schematic (KiCad 8)
│   ├── pc-power-remote-switch.kicad_sch   # Schematic source
│   ├── pc-power-remote-switch.kicad_pcb   # PCB layout
│   ├── pc-power-remote-switch.kicad_pro   # KiCad project file
│   ├── scematic.png           # Schematic render (PNG)
│   ├── scematic.pdf           # Schematic render (PDF)
│   └── pc-power-remote-switch.svg         # Schematic render (SVG)
│
├── LeagacySystem/             # Legacy ESP8266 firmware (archived)

Legacy System

The LeagacySystem/ directory contains the original ESP8266-based implementation that served a web dashboard directly from the microcontroller via LittleFS. This has been superseded by the current ESP32 + MQTT architecture, which offers:

  • ✅ Remote access — Control from anywhere, not just on local network
  • ✅ Separation of concerns — Web frontend hosted independently on a CDN
  • ✅ Better security — MQTT authentication, TLS, rate limiting
  • ✅ Reliability — LWT for offline detection, auto-reconnect

The legacy code is kept for reference purposes.


Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

License

This project is open source and available under the MIT License.


Built with ❤️ using ESP32 + MQTT + Vite
Designed & developed by Rudra

Parts

12
QtyValueFootprintReferences
2100 ohmResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR2, R3
11000 uFCapacitor_THT:CP_Radial_Tantal_D10.5mm_P5.00mmC1
1100nFCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC2
14.7kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1
1INPUTConnector_PinSocket_1.27mm:PinSocket_2x04_P1.27mm_VerticalJ2
1OUTPUTConnector_PinSocket_1.27mm:PinSocket_2x04_P1.27mm_VerticalJ3
1Optocoupler PowerPackage_DIP:DIP-4_W7.62mm_Socket_LongPadsU2
1Optocoupler Power ButtonPackage_DIP:DIP-4_W7.62mm_Socket_LongPadsU3
1Optocoupler Restart ButtonPackage_DIP:DIP-4_W7.62mm_Socket_LongPadsU4
1WEMOS_D1_miniRF_Module:WEMOS_D1_mini_lightU1
1~TerminalBlock:TerminalBlock_Altech_AK300-2_P5.00mmJ1

Questions

What parts does the Pc power remote switch use?

12 parts, built around the WEMOS D1 MINI and 1000UF 16V. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Pc power remote switch KiCad files?

From the Rudra2002/ComputerControl repository on GitHub, at the commit this page was made from: the board is kicad-circuit/pc-power-remote-switch.kicad_pcb and its schematic kicad-circuit/pc-power-remote-switch.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Pc power remote switch design in my own project?

Its repository states no licence, so its author keeps all rights: ask Rudra2002 before reusing the design.

Similar boards

  • 2 layers142.4 × 117.1 mmASME UM High current board, the printed circuit board in 3D

    ASME UM High current board

    umasme/2025-2026

    University of Miami ASME Official Repository for NASA Lunabotics Challenge

    93 parts2MIT
  • 2 layersPicoPLC, the printed circuit board in 3D

    PicoPLC

    antek-elektronik/PicoPLC

    Work in progress!

    92 parts
  • 2 layers154.8 × 96.7 mmRobotics Mine, the printed circuit board in 3D

    Robotics Mine

    arminesweeper/Minesweeper2026

    The Assiut Robotics Minesweeper Rover is an autonomous field robotics platform engineered for humanitarian mine action and robotics competitions (Minesweeper International / Minesweeper Egypt).

    117 parts
  • 2 layers20 × 160 mmZibs Saber v2, the printed circuit board in 3D

    Zibs Saber v2

    PedroBMedeiros/PolySaber

    Firmware for Cal Poly Senior Project - PolySaber a Custom PCB Soundboard

    75 parts
  • 2 layers76.7 × 95.9 mmPicoBot, the printed circuit board in 3D

    PicoBot

    qtsohg/pico_ESP32_motor_controller

    35 parts
  • 4 layers50 × 50 mmPDB Board 0.1, the printed circuit board in 3D

    PDB Board 0.1

    thejamesrhodes/Hyades-Flight-Computer

    Full Hardware and Electronics design, Bare-metal GNC flight software for an actively attitude-controlled high-power rocket

    52 parts1Apache-2.0