Pinned by squid_jpg
Modern electronics are capable of incredible things. Even the simplest gadgets now have clocks, gyroscopes, radios, GPS, touch screens, literally anything you can imagine, built right in. Sometimes though, the devices that are capable of doing several things don't do all of them particularly well. Touch screens are often bolted onto things that really don't benefit from them, or even worse, detract from the experience. Anyone who has accidentally grazed the touch panel on an Apple TV remote while grasping for it in the dark knows exactly what I'm talking about. Sometimes I just want to have a remote with a few simple buttons I can press to make things happen, and that's it!
Most of the lights in my apartment are WiFi-connected, and offer MQTT capability. I took advantage of this and set up a local MQTT broker (https://mosquitto.org/) on a Raspberry Pi 4 wired to an old Apple Airport router/hub I had lying around (my internet provider makes me use their router for my internet). Now, it's easier than ever to control my lights...from a browser. Or some phone interface. Or an app. Wait a second...each of those still requires multiple steps just to get me to the point where I can actually control anything. And I probably still have to use a touch screen. Leading me back to my original point, and thus the motivation for the imaginatively named:
WiFi Matrix Keypad Remote
I've been a DIY remote control enthusiast for almost as long as I've been hacking around with microcontrollers (at least a few years now). One thing that I've found really hard to source as a hobbyist is good, pre-made button panels intended to be mounted into a small space, such as a remote control. So far, one of my favorite sources for a dense panel of decent quality, inexpensive buttons are these old-school 3x4 matrix keypads:
Awhile back I bought one of these cheap low-current ammeters (30 mA in this case) with the intention of using it to get more precise readings on how much current some of my devices were using. I promptly forgot about it for two years, and recently when looking over my hoard inventory of electronic components I came across it and had an idea: what if instead of using it to measure current, I pumped current through it using a microcontroller GPIO? Would I be able to use it as a display for data? Turns out the answer is yes!
There are a few prerequisites for this to work. First, you need an ammeter with a maximum range current that is equal to or lower than the maximum amount of current that a GPIO can output. For most ESP32-based boards, this is ~40 mA for most GPIO. You'll need to check your microcontroller's data sheet for exact spec. Next, you'll need a microcontroller with PWM-capable GPIO. This is important because the PWM duty cycle will determine how much current we push to the ammeter, which will determine where the needle goes. Lastly, you'll need a bit of creativity if deciding how to replace the stock face plate. For example, if you're trying to display C02 levels in your apartment, you probably don't want your display to show mA for the units, and you'll probably want to use a different scale than what's printed on the faceplate.
- You need a microcontroller with PWM-capable GPIO.
- You need a little bit of creativity for deciding how to replace the ammeter's face plate.
I love this make of HAL-9000 from the Ruiz Bros:
Currently I have around 18 WLED controller devices deployed around my apartment, most of them built using a NeoPixel Driver BFF and either the QT Py ESP32 Pico or the QT Py ESP32-C3 (currently the only QT Py boards I've been able to get to work with the standard WLED web firmware installer). The BFF series of boards is designed to be soldered back-to-back with the QT Py, but I often find it challenging to design mounting geometry on 3D printed cases for this configuration. To help fit my specific needs a little better, I decided to manually wire the boards together and build a snap-fit case to hold them. I borrowed the idea (and some of the geometry) for the snap-fit from the QT Py Snap Fit Case learn guide.
Any QT Py board can be used with this design, and you don't even *necessarily* have to use it for a lighting project. I've even used this case/configuration as a small driver for an IOT Relay using an ESP32-S2 QT Py from the signal and ground pins of the JST connector of the NeoPixel driver BFF (be aware though that this signal is shifted to 5V!).
I've been working on building the updated HAL9000 using the Propmaker Feather, and tweaked the code a bit to add a couple of features. Mainly:
- Animate the LED using a slow pulse animation when HAL9000 is "idle" (in other words, not playing a sound)
- Shuffle the list of wave files, and keep track as we play our way through them; then, once we've reached the end, re-shuffle the list and start over. This prevents the same sound repeating over and over, which the current approach is prone to. It also ensures you'll hear every sound if you keep pressing the button (until the list eventually has to repeat).
I ordered a decal to use instead of 3D printing the "HAL9000" label, so I'm waiting on that before I post the photos of my build, but in the meantime, here's my updated code if anyone is interested (you'll need to add the
adafruit_ticks.mpylibrary to your
libfolder in order to use this).