A Wi-Fi enabled replacement for the broken Power Button of my PC. Watch The Video
Replace/Enhance the Power button of your PC with the ESP8266. No need to lift your arms to reach for the power button button of your PC when you can press it from the comfort of your phone. You can control more than just power with the included macro pad.
The project was made when the power button of my computer broke. I also wanted to add a few physical marco buttons and wanted to monitor some of the usage statistics remotely. This project is all that rolled into one.
⚠ Requires the WinSerial program for full functionality. Read Macro Pad & System Stats for more info.
If you wish to replicate the project then you can either just grab the binary from the releases page and flash to your board with the flash tool. OR if you wish to make some changes to the code then follow the following steps:
I would recommend using PlatformIO. Instructions on how to install it are here. If you are indeed using PlatformIO, then skip this step.
- Arduino IDE
- Make sure that the ESP8266 board configs are already installed. Instructions
- Make sure that the following libraries are installed. How to install libraries in Arduino IDE.
- Clone/Download the repo
git clone https://github.com/LiveSparks/ESP_Power_Button
- Compile & Upload
- PlatformIO
- Open the repository folder in VS Code and upload after PlatformIO has loaded.
- Arduino IDE
- In the source folder, rename
main.cpp
tomain.ino
. - Open
main.ino
file in arduino IDE. - Comment out
#include <Arduino.h>
. - Connect the ESP Board and Upload.
- In the source folder, rename
- PlatformIO
The Above diagram is made with the Wemos D1 mini in mind. Check to make sure that you use the correct GPIOs is you you are using a different board.
The USB headers on motherboards have the following layout:
You can also just connect to a external USB port directly if you want.
Regardless of whether you are connecting to the USB or not, you need to make sure that the ground of your PC and the ESP are connected together.
The program works as is and there is no need to enter any WiFi Credentials in the code itself.
- On first bootup, a WiFi access point would be created by the name of ESP Power Button. Join it.
- Go to
192.168.4.1
. There you can enter your WiFi credentials. - Make sure to have a Serial Monitor open to check the connection status.
- The ESP will reboot and connect to your home WiFi.
- The new IP address will be written in serial monitor. You can also find the IP using the Fing App. It would show up as a smart device.
- (Optional) Assign the ESP a static IP from your router.
- Go to it's IP address from a device that is on the same network.
You should be able to control the PC Power and and LED brightness from this page but the system stats would remain blank.
To see the system stats on the Web UI and make use of the macro pad follow the instructions on this page.
The buttons on the keypad are F13 through F18 so there is never any possibility of conflict with a real keyboard. You can also modify the project to include 6 more keys so you have F13-F24 for 12 total keys. No modifications of the PC sided software are required for this.
AutoHotKey is a very powerful piece of automation software that allows you to define custom desktop wide hotkeys that can do complex tasks based on context.
- Map one key to a another keybind. F13 -> Ctrl+C
F13::^c
- Open a web page
F17::Run chrome.exe "http://192.168.29.3/" " --new-window "
- Context Specific actions
#IfWinActive Untitled - Notepad !q:: MsgBox, You pressed ALT+Q in Notepad. return ; Any window that isn't Untitled - Notepad #IfWinActive !q:: MsgBox, You pressed ALT+Q in any window. return
- Combine two keys together
F13 & F17::Media_Play_Pause
⚠ You can only combine two keys together.
⚠ For some reason using keys of the same coloum together doesn't work. If you can figure out the reason, please let me know.
For more examples and in depth guides regarding AutoHotKey, visit their documentations.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License.
Your Name - @LiveSparksYT - [email protected]
Project Link: https://github.com/LiveSparks/ESP_Power_Button
- Logo icon made by photo3idea-studio