You can easily build a custom Wi-Fi-controlled USB keyboard using an ESP32-S2. Perfect for remote key presses, gaming macros, or custom HID devices. Hardware is cheap, software is simple, and the code is ready to use on GitHub.You can easily build a custom Wi-Fi-controlled USB keyboard using an ESP32-S2. Perfect for remote key presses, gaming macros, or custom HID devices. Hardware is cheap, software is simple, and the code is ready to use on GitHub.

How to Build a Wi-Fi-Controlled USB Keyboard With an ESP32

2025/12/08 17:56
7 min read
For feedback or concerns regarding this content, please contact us at crypto.news@mexc.com

Have you ever wanted to build your own custom keyboard — not necessarily a full 101+ keyboard, but a small, purpose-built device, or even an interface with no physical keys at all? Imagine a virtual input that accepts commands over Wi-Fi, like simple HTTP REST requests, and turns them into keyboard events on your computer.

It’s easier than you think.

Use case

Here’s what got me into this project. I often play RPGs in co-op with a friend, and my computer acts as the server. That gives me a few extra abilities he doesn’t have — like Quick Save (F5) and Quick Load (F8). The problem? Whenever I step away, he’s stuck. He can’t save or reload the game on his own.

So I wanted a simple way for him to trigger just those two keys — F5 and F8 — on my machine, without giving him full remote control. That’s all. Two keys, nothing else.

But once you start thinking about it, the possible use cases expand quickly. You could build a tiny physical keypad where each button types a whole sentence instead of a single character.

\n Or a remote keyboard that works a bit like a simplified KVM-over-IP — just without the video component.

\n Or even a DIY solution for waking a computer over USB keyboard input when the network card doesn’t support Wake-on-LAN.

And of course, HID isn’t just keyboards. It covers mice, gamepads, joysticks — basically anything that counts as a “Human Interface Device”. With the same approach described in this article, you could build any of those.

Choosing your approach

At first, I tried the software route — wrote a program that listened on a TCP port and injected keystrokes into an active application. It worked… with Notepad, but it didn’t work where it mattered: the game. I tried running as Administrator, fiddled with security profiles, and tested different things, but the simulated keystrokes never reached the game window.

That experience taught me two things. First, sending keystrokes from userland is fragile. Second, it's OS-dependent: different operating systems use different input APIs, and there can be multiple APIs in the same OS, so what works for a simple text editor will not necessarily work for full-screen applications. Finally, a pure software solution can’t handle machines that aren’t booted or are asleep.

So I switched strategies: if software injection is unreliable, let’s speak the computer’s native language. Time to move to a hardware approach.

Hardware

To make this work, I needed a device that could speak two languages at once: network on one side (Wi-Fi or Ethernet) and USB HID on the other. In other words, something that could receive commands over the network and then act as a USB keyboard when plugged into a computer — essentially a tiny Ethernet/Wi-Fi-to-USB bridge.

Raspberry Pi

My first thought was to use an old Raspberry Pi 1B I had lying around. It had USB, it had Ethernet — seemed perfect. After digging through the docs, I found how to switch its USB controller into device (peripheral) mode. Rebooted… and lost the network entirely.

Which makes total sense in hindsight: on the older Pis, the Ethernet chip is actually connected through USB. Once the USB controller switches from host mode to device mode, it stops handling the Ethernet interface. Newer Raspberry Pi models have multiple USB controllers and can make this work, but it's still a bit fiddly and not guaranteed to behave nicely.

ESP32 Microcontroller

A bit more research pointed me to a much better option: certain ESP32 microcontrollers — specifically the ESP32-S2 and ESP32-S3 — can act as a USB device and use Wi-Fi at the same time. Perfect. The S3 is more powerful and has extra features, but for this project, I didn’t need that horsepower, so I went with the ESP32-S2. The Raspberry Pi RP2040 might also work, but I didn’t test it.

And the cost? Very reasonable. An Adafruit QT Py ESP32-S2 cost me £15.90, including shipping. If you prefer the budget route, you can get a pair of no-name ESP32-S2 boards on Amazon for about £9.99.

Note on board producer.

The ESP32-S2 chip itself is made by Espressif, but different companies build their own boards around it — adding voltage regulators, USB connectors, buttons, LEDs, etc. And this is where choosing a reputable manufacturer seriously matters.

For your own sanity, consider buying from Adafruit, Seeed Studio, or any other well-known maker.

Two reasons:

  1. Their boards just work. I tried a no-name Amazon board first. Arduino IDE could detect it, but flashing failed every single time — different computers, different operating systems, different cables… nothing helped. I sent it back. The Adafruit board, on the other hand, flashed successfully on the first try.

    \

  2. They contribute massively to the community. Great documentation, clear tutorials, tons of libraries, and examples for all kinds of sensors and modules. All open, all high quality. Those extra few quid directly support the ecosystem you’re relying on.

And as a bonus, the Adafruit board comes with a tiny programmable RGB LED — super handy for showing status while the firmware runs.

Software

Programming these boards is pleasantly straightforward. There’s no operating system, no filesystem, no threads, no asyncio — just your code running directly on the microcontroller.

The program is essentially split into two parts:

  1. Initialization – This runs once at startup. Here we configure the LED, connect to Wi-Fi, switch the USB controller into device (HID) mode, and prepare anything else the board needs.
  2. Main loop – After initialization, the microcontroller runs this loop forever (or at least until power is cut). In it, we wait for incoming connections, read the HTTP request, parse the command, send the appropriate keystroke over USB, and return a small HTTP response.

Thanks to the community — especially contributors like Adafruit — you don’t have to implement low-level networking, Wi-Fi drivers, USB HID descriptors, or USB protocol handling yourself. Libraries take care of all of that. You only need to focus on the logic: how the HTTP command is encoded (I used part of the URL) and which keystrokes the board should send over USB.

The full source code is available on GitHub. Just install the Arduino IDE, clone the repository, drop your Wi-Fi credentials into the `wifi_defs.h`` file, plug in your board, and click “Upload.” A minute later, you’ll have your custom keyboard ready to go.

At the top of the code file, you’ll find a few configuration options — you can disable the Adafruit NeoPixel LED if your board doesn’t have one, change the HTTP port, or temporarily turn off the USB HID functionality (useful when debugging the HTTP handling).

Conclusion

As you can see, building your own remotely controlled USB keyboard is not only possible — it’s surprisingly easy and inexpensive. With just a small microcontroller and a bit of code, you can create a custom HID device tailored exactly to your needs, whether that’s a two-button remote for gaming, a macro pad that types full sentences, or something completely different.

The project in this article is just a starting point. You’re welcome to use the code as a foundation, modify it, break it, rebuild it, and push it in whatever direction your imagination takes you. If you end up making your own version — or come up with a fun or unusual use case — I’d love to hear about it. Feel free to share your ideas and projects in the comments.

:::info Disclaimer: I’m not affiliated with any of the companies or organizations mentioned. All hardware was purchased with my own money, and this project was not sponsored in any way.

:::

\

Market Opportunity
READY Logo
READY Price(READY)
$0.010426
$0.010426$0.010426
-1.26%
USD
READY (READY) Live Price Chart
Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact crypto.news@mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

U.S. Moves Grip on Crypto Regulation Intensifies

U.S. Moves Grip on Crypto Regulation Intensifies

The post U.S. Moves Grip on Crypto Regulation Intensifies appeared on BitcoinEthereumNews.com. The United States is contending with the intricacies of cryptocurrency regulation as newly enacted legislation stirs debate over centralized versus decentralized finance. The recent passage of the GENIUS Act under Bo Hines’ leadership is perceived to skew favor towards centralized entities, potentially disadvantaging decentralized innovations. Continue Reading:U.S. Moves Grip on Crypto Regulation Intensifies Source: https://en.bitcoinhaber.net/u-s-moves-grip-on-crypto-regulation-intensifies
Share
BitcoinEthereumNews2025/09/18 01:09
TradFi Giant Deutsche Börse Taps Circle for Major European Stablecoin Push

TradFi Giant Deutsche Börse Taps Circle for Major European Stablecoin Push

Deutsche Börse Group has signed a Memorandum of Understanding (MoU) with Circle Internet Financial to integrate regulated stablecoins into European capital markets. According to the announcement, the collaboration will focus on Circle’s USDC and EURC, connecting token-based payment networks with traditional financial infrastructure. The partnership marks the first time a major European market infrastructure provider has formally teamed up with a global stablecoin issuer. Both parties said the initiative represents a milestone for regulated digital finance in Europe, made possible by the EU’s Markets in Crypto-Assets Regulation (MiCA), the bloc’s new comprehensive framework for digital assets. Partnership Bridges Traditional Finance and Crypto Settlement in Europe Under the agreement, the initial rollout will take place through Deutsche Börse’s subsidiaries. Trading will be facilitated on 360T’s digital exchange, 3DX, and through the institutional crypto provider Crypto Finance. Custody services will be provided via Clearstream, Deutsche Börse’s post-trade business, with Crypto Finance’s German entity serving as sub-custodian. Jeremy Allaire, Circle’s co-founder and CEO, said the collaboration would reduce settlement risk, lower costs, and improve efficiency across banks, asset managers, and other market participants. “As clear rules take hold across Europe, aligning our regulated stablecoins, EURC and USDC, with trusted venues will unlock new products and streamline workflows across trading, settlement, and custody,” Allaire said. Executives at Deutsche Börse noted the potential of stablecoins to reshape European finance. Stephanie Eckermann, who oversees post-trading at the group, said the deal advances the company’s ambition to digitize securities issuance and post-trade processes. Thomas Book, who is responsible for trading and clearing, added that the partnership positions Deutsche Börse to bridge traditional and digital markets by providing an integrated value chain across execution, settlement, and custody. The agreement follows Circle’s regulatory breakthrough earlier this year. On July 1, Circle became the first global stablecoin issuer to secure an Electronic Money Institution (EMI) license under MiCA, issued by French regulators. The license allows the company to issue both USDC and EURC across the European Union. Circle described the approval as a major milestone for mainstream adoption, noting that MiCA sets the conditions for long-term growth in digital finance by ensuring stablecoin issuers meet strict consumer protection and reserve requirements. The MiCA framework, passed by the European Parliament in April 2023, has been gradually implemented since June. Circle’s head of policy, Dante Disparte, said the regulation closes the door on unregulated operations, while Allaire noted that it legitimizes the sector after years of skepticism from mainstream finance. European Banking Giants Form Consortium for Euro Stablecoin Amid Deutsche Börse Group’s efforts, nine of Europe’s largest lenders are joining forces to launch a euro-backed stablecoin in the second half of 2026, seeking to challenge the dominance of U.S. dollar-pegged tokens. The consortium, which includes ING, UniCredit, CaixaBank, Danske Bank, KBC, DekaBank, SEB, Raiffeisen Bank International, and Italy’s Banca Sella, has set up a new company in the Netherlands to oversee the project. It plans to seek a license from the Dutch Central Bank as an e-money institution under the European Union’s MiCA framework. According to a joint statement, the stablecoin will provide near-instant cross-border payments, lower transaction costs, and round-the-clock access to settlements. “This development requires an industry-wide approach, and it’s imperative that banks adopt the same standards,” said Floris Lugt, digital assets lead at ING. The move shows growing European efforts to reduce reliance on dollar-based stablecoins, which currently account for 99% of global supply.Source: ECB Euro-pegged tokens remain a small fraction of the market, with less than €350 million in circulation, European Central Bank (ECB) data shows. The initiative comes as the ECB advances its digital euro project, with Executive Board member Piero Cipollone suggesting a rollout could happen by mid-2029. EU lawmakers are expected to weigh in on the legal framework later this year. Together, the bank-led stablecoin and the ECB’s digital euro mark Europe’s bid to secure greater autonomy in digital payments and limit the influence of non-EU issuers in the region’s financial system
Share
CryptoNews2025/10/01 01:51
Smart investors earn $6,875 daily on ProfitableMining, the leading cloud mining platform.

Smart investors earn $6,875 daily on ProfitableMining, the leading cloud mining platform.

In the volatile cryptocurrency market, price fluctuations are becoming increasingly severe. Simply holding onto your coins and waiting for them to rise is no longer a safe strategy. More and more experienced investors are turning to a more stable approach—ProfitableMining cloud mining, with becoming their preferred platform. They aren’t waiting for market fluctuations; they’re generating […]
Share
Cryptopolitan2025/09/18 01:00