Emulating A Bluetooth Keyboard With The ESP32

Most people associate the ESP family of microcontrollers with WiFi, which makes sense as they’ve become the solution of choice for getting your project online quickly and easily. But while the WiFi capability might be the star of the show, the ESP32 also comes equipped with Bluetooth; we just don’t see people using it nearly as often. If you’re looking to get started using Bluetooth on the ESP32, then this simple wireless macro keypad from [Brian Lough] would be a great way to get started.

From a hardware standpoint, this project is incredibly straightforward. All you need to do is connect a membrane keypad up to the GPIO pins on the ESP32. Adding in a battery is a nice touch, and you probably would want to put it into a enclosure of some sort, but as a proof of concept it doesn’t get much easier than this. In this case [Brian] is using the TinyPICO board, but your personal ESP32 variant of choice will work just as well.

The rest of the project is all software, which [Brian] walks us through in the video after the break. There’s a preexisting library for Bluetooth Human Interface Device (HID) emulation on the ESP32, but it needs to be manually installed in the Arduino IDE. From there, he demonstrates how you can build up a functioning keyboard, including tricks such as sending multiple virtual keys at once.

In the past we’ve seen the ESP32 used to create a Bluetooth game controller, but the ability to emulate a keyboard obviously offers quite a bit more flexibility. With a practical demonstration of how easy as it is to turn this low-cost microcontroller into a wireless input device, hopefully we’ll start seeing more projects that utilize the capability.

Continue reading “Emulating A Bluetooth Keyboard With The ESP32”

Making Membrane Keypads From Scratch

A few years ago, [Paul]’s son got a simple electronic toy that plays funny noises and sings to him. The son loves the toy, but after months and months of use, the toy was inevitably broken beyond repair. Figuring an ‘electronic box that plays sounds’ wouldn’t be a hard project to replicate, [Paul] set out on making his own. The electronics weren’t hard, but custom membrane keypads are hard to come by. No matter, because it’s actually pretty easy to build your own.

Membrane switches are usually made with silkscreen conductive inks on fancy plastic, but that’s not a requirement to build your own. All you really need are four layers – a ‘front decal’, a ‘top foil’ layer for the rows, a ‘bottom foil’ layer for the columns, and a ‘cutout’ layer that provides enough separation between the rows and columns.

[Peter] laid out the four layers in Illustrator, printed the layers, and covered the rows and columns with copper tape. The cutout layer is the crucial part that keeps the layers separated until the button is pressed, and that was just a piece of card stock with strategically placed holes.

Once the rows, columns, and other layers were glued up, [Peter] could connect this keypad up to a microcontroller. The code is very easy with the Arduino keypad library, and should stand up to the rigors of being handled by a child.