RemotePC-PowerSwitch is a remote computer power control system based on ESP8266 and a relay module. Using a simple web interface, you can easily power on or force shutdown your computer remotely, without the need for additional software or hardware.
- Remote Power On: Power on your computer via a web button.
- Force Shutdown: Simulates holding the power button for 8 seconds to force shutdown.
- Wi-Fi Control: No additional software required, just ensure the devices are on the same network.
- Web Interface: Simple and intuitive, compatible with phones, computers, and other devices.
- Power-On Auto: Start: Prevent issues with dynamic public IP changes after a power outage, ensuring remote access remains possible.
-
ESP8266 Development Board
-
Relay Module
-
Connection Wires
- Used to connect ESP8266 and the relay module.
-
Arduino IDE
- Used to write and upload code to the ESP8266.
-
Required Libraries
ESP8266WiFi.h
: Manages Wi-Fi connections.ESP8266WebServer.h
: Hosts a simple web server.
ESP8622 --------------- Relay Module
GPIO5 ------------------> IN
GND ------------------> GND
3.3V/5V -----------------> VCC
Relay Module ---------- Computer Power Button COM
COM ------------------> Power Button Pin 1
NO ------------------> Power Button Pin 2
Fill in the following details in the code:
- Wi-Fi Name (
SSID
) - Wi-Fi Password (
password
) - Username
- Password
- Relay control pin (default is
GPIO5
orD1
)
Upload the code to the ESP8266 using Arduino IDE.
After uploading, open the serial monitor in Arduino IDE and check the IP address of the ESP8266 (e.g., 192.168.0.2
).
Enter the IP address in your browser (e.g., http://192.168.0.2
). The web page contains two buttons:
- Power On: Click to power on the computer.
- Force Shutdown: Click to simulate holding the power button for 8 seconds and force shutdown.
- Relay Selection
- Ensure the relay module's voltage and current meet the requirements of both ESP8266 and your computer's power button.
- Power Supply
- Use a stable power source for the ESP8266 and relay module.
- Network Environment
- Ensure the controlling device and ESP8266 are on the same Wi-Fi network.
- Security
- Since the web interface is accessed via the local network, avoid using insecure public Wi-Fi networks.
This project is licensed under the MIT License. You are free to modify and distribute the code but must retain the original author's information.
Feel free to submit Issues or Pull Requests to improve this project. If you have questions, contact us through GitHub.
This project is for personal learning and entertainment purposes only. Ensure compliance with relevant laws and regulations when using it.