I didn't want my first ESP32 project to be boring, so I built an unlock key for my Windows PC

I didn't want my first ESP32 project to be boring, so I built an unlock key for my Windows PC

Published Nov 30, 2026, 3:31 PM EST After a 7-year corporate stint, Tanveer found his love for writing and tech too much to resist. An MBA in Marketing and the owner of a PC building business, he writes on PC hardware, technology, and Windows. When not scouring the web for ideas, he can be found building PCs, watching anime, or playing Smash Karts on his RTX 3080 (sigh). When I first got into ESP32, I didn't want to start with a weather station, a simple server, or another test project. I wanted to build something quickly, which was also fun and useful. So, once I had confirmed that the ESP32-S3 I bought wasn't DOA, I decided to use it to unlock my gaming PC. I had several ways to achieve it, but I decided on the simplest option. I basically automated the sign-in process by having the ESP32 enter the lock screen password when I pressed the BOOT button. Now, whenever my PC reboots due to Windows Update or an otherwise unavoidable power cycle, I unlock my PC by clicking a button. Typing my Windows password isn't hard, but making my ESP32 do it is fun, and for my first project, it wasn't a bad choice. I needed nothing but the board itself The ESP32-S3 is great for beginners A while back, I stopped relying on Windows' Sleep mode to allow the PC to fix memory leaks and clear stuck background processes. Besides, after moving to Windows 11, I didn't bother disabling Windows Update anymore. So, I started seeing my lock screen way more frequently as the PC rebooted more often. Suddenly, I had to type in a long password more times than I wanted to. When I got my first ESP32 some time ago, I wanted my first project to be something fun. The best part of using the ESP32 as a Windows unlock key was that I didn't have to buy any sensors or jumper cables — the board was enough. I looked online for ways to achieve what I wanted: unlocking my PC by plugging in the ESP32. It could be done cryptographically using open-source FIDO2 firmware or a background Python script on the PC to verify the ESP32's signature. However, there was a simpler way. I could just program the board to type in my password on the lock screen. It was less fancy, but I was also new to the hobby, so it seemed like the ideal choice. Using the ESP32-S3's USB-OTG support, it can be used as an HID keyboard programmed to enter a string the moment it is plugged in or by pressing the BOOT button. Setting things up in Arduino IDE was simple Gemini helped me with the sketch After installing Arduino IDE on Windows, I decided to check whether a pre-existing sketch could do what I wanted the ESP32 to do. While I found the KeyboardMessage example in File > Examples > USB > Keyboard, it didn't fit the project exactly. So, I did what any beginner would do these days: ask my favorite chatbot. I asked Gemini to generate a sketch that required pressing the BOOT button to initiate the unlock. Gemini gave me a ready-made sketch that I pasted into Arduino IDE. The project works only by plugging in the ESP32 via the USB port (not COM) and using the USB-OTG mode, which can be enabled in Tools > USB Mode. Once that was done, I tweaked the password line to add my lock screen password, and uploaded it to the board. Everything went smoothly, and Arduino IDE reported Done uploading at the bottom. I locked my screen to test the sketch, and sure enough, pressing the BOOT button on the lock screen unlocked my PC in less than a second. I keep the ESP32 plugged in and just press a single button to unlock Windows. I'd love to add a large arcade button or a keyboard switch later, so I don't have to carefully press the tiny button on the ESP32. Ideally, I should use one of the cryptographic methods instead of storing my password in plaintext on the ESP32, but I keep procrastinating that project. It was a simple project, but it was fun, practical, and educational Your first project doesn't need to be complicated Programming a microcontroller to enter a password on a lock screen isn't anything special. That said, as a first project, it taught me a few starter concepts about the ESP32. Using the Arduino IDE, understanding a sketch (even if it was AI-generated), and using the function of the onboard BOOT and RST buttons. Unlike a test project, it solved a practical problem and paved the way to later projects. It's also kind of cool to use a microcontroller to unlock my PC when I'm not in the mood to type my password. Compared to my other projects, this one feels even simpler than a tutorial, but it wasn't a bad way to get into ESP32. Your first ESP32 project shouldn't be boring Everyone tells you to build a weather station or test server. However, you don't need to actually stick to those projects. Solving a practical problem or building something exciting feels much better. Unlocking your PC or building a motion or presence detector can be done with just your bare ESP32; no other hardware needed. ESP32-S3 ESP32-S3 comes with a dual-core Xtensa LX7 microcontroller. It has 16MB of flash memory and 8MB of PSRAM with years of maturity to be ready for a variety of projects.

Original Source

Read the full article at Xda-developers →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.