
But in this age of IoT-connected-everything, I was not content to merely let HAL speak to me at my whims. At first I just wanted to add an easily accessible serial port to it, so that I could actually make the button trigger something I had not yet conceived of when pressed. I've been adding serial ports like this in the form of TRRS/headphone jacks to many "input gadgets" lately, and as the centerpiece of this HAL-9000 build literally is a giant button, I think this qualifies. This feature can make gadgets extendable beyond their original purpose, which has great potential for amusement, and might even actually be useful sometimes!
After having the original HAL-9000 build on the shelf for awhile it became awkward to use, because the LED/momentary switch module from the big red arcade button protruded beyond the back of the case, such that it would not sit flat against the shelf. So, while I was already in there to add a headphone jack for the serial connection, I started thinking I'd try to extend the depth a bit to cover this. While doing so, I had *another* idea (oh no): what if I used the RP2040's second UART peripheral to give HAL-9000 a wireless "coprocessor", to allow it to interact with my local MQTT network? With the extra room afforded by the additional case depth, I had plenty of room to squeeze in a QT Py ESP32-S2. To enable this I also added a couple of access holes between the top and middle compartments, so that I could run wires from the Feather to both power the QT Py as well as communicate via UART. The result:

HAL-9000-W
Perhaps my most-used micontrollers are the ESP32 family of QT Py. Their diminutive size, combined with powerful processors, tons of RAM, and WiFi capability, make them great for a variety of tasks. Tasks such as, for example, adding a WiFi coprocessor to a computer you've built that may or may not have ambitions on controlling the world.
For this task I chose the QT Py ESP32-S2. It's inexpensive, powerful, and runs CircuitPython like a champ. Okay, it's probably not so great at helping a rogue computer take over the world, but I guess we can't always have everything.
I printed a small case with a snap-fit for the QT Py, and a cutout on the opposite end of the USB port for the 4 wires needed (5V, GND, TX, RX). I took the easy way out when it comes to mounting and just used some 3M VHB tape to mount the QT Py in HAL-9000's top compartment. For flexibility I wired the QT Py using 4-pin JST connectors. This isn't strictly necessary but does give you some options if, for example, you want to easily swap out a different microcontroller later on. The QT Py's USB-C port is easily accessible from the back, and it is safe to plug in and edit code while also being powered by HAL-9000's Propmaker Feather, due to the QT Py's dioded power pads on the bottom of the board.

Perpetrating silliness
Now that HAL-9000 is "jacked-in", let's do some fun things with it. The first thing I did was enable HAL-9000-W to send events to HAL-9000 over the UART peripheral when interesting things happened. Initially what I wanted to know about was when HAL was connected/disconnected from the network. HAL-9000-W sends two events for this:
- "online" - sent went HAL-9000-W connects to the MQTT broker
- When this message is received, HAL lets me know by "saying" that its "wireless module" is connected.
- "offline" - sent when HAL-9000-W becomes disconnected from the MQTT broker
- When this message is received, HAL lets me know by "saying" that its "wireless module" is no longer connected.
Additionally, HAL-9000-W subscribes to my office's MQTT power topic, and sends commands to HAL when updated:
- "wake" - sent when HAL-9000-W receives the "ON" message on the room's power topic. When received, HAL:
- powers on the LED on the big red button
- speaks a friendly (or maybe not so friendly) greeting, chosen randomly from a pool of audio files included on the CircuitPython drive
- forwards the message to any device that may be connected over the serial port (in this case, an 8x8 non-wifi NeoPixel display, which toggles power to the LEDs)
- "sleep" - sent when HAL-9000-W receives the "OFF" message on the room's power topic. When received, HAL:
- powers on the LED on the big red button and starts the pulsing animation
- speaks a friendly (or maybe not so friendly) greeting, chosen randomly from a pool of audio files included on the CircuitPython drive
- forwards the message to any device that may be connected over the serial port
For added silliness, when HAL-9000 "speaks", it sends the name of the audio file to HAL-9000-W, which has a mapping of audio files to transcriptions of those files. If the mapping is found, HAL-9000-W posts the text to an MQTT topic, so that any listening devices may respond. In this case, I have a small "blinkenlights" display that shows me the status of various lighting devices in my apartment. When a transcription is posted, the display scrolls the text. Another idea I may implement soon is to trigger certain lighting effects on WLED devices on the network when certain audio files are played. Between the WiFi connection, the external UART peripheral, and CircuitPython, HAL-9000 is capable of some pretty interesting things!
3D files and (lack of) code
You can find the 3D files for the modified HAL parts, as well as the case for the QT Py on Printables. The wiring is pretty basic; in addition to the wiring from the learn guide, I wired one of the RP2040 Feather's UARTs to the headphone (TX, RX, GND) jack, and the other to a 4-pin JST connector (5V, GND, TX, RX) with a few inches of wire. A corresponding JST connector is soldered on to the QT Py, with the 5V and GND wires connected to the battery power pads on the bottom of the board, and the TX/RX wires connected to the corresponding RX/TX pins.
I did not post any code for this as it is highly specific to my situation, however, to be honest, none of the code is particularly special. I used the CircuitPython MQTT learn guide to figure out how to get connected to my local MQTT network, and the CircuitPython essentials guide to work out how to use the UART (for communication) and PWM (for animating the LED).