Control 433 MHz radio-frequency (RF) devices like outlets with a standard USB keyboard, using a Waveshare RP2350-USB-A microcontroller running CircuitPython.
I built this as a replacement for the remotes of the various brands of RF outlets I have around the house, in order to control all from a single keyboard.
The RP2350-USB-A sits between a USB keyboard and your computer (or headless, via dedicated USB power supply). As with a universal TV remote, button presses from the device’s RF remote are first recorded to individual keys on your keyboard, allowing subsequent keypresses to duplicate the same function.
- Waveshare RP2350-USB-A running CircuitPython 10.x (can likely work with other RP2350 devices with USB host support)
- A 433 MHz receiver module (XY-MK-5V) wired to GP28
- A 433 MHz transmitter module (FS1000A) wired to GP29
- A USB keyboard plugged into the RP2350-USB-A's USB host port
- The
neopixel.mpylibrary present in/libon the board
| File | Purpose |
|---|---|
boot.py |
Runs at power-on. Sets up USB host mode and controls whether the board's storage is writable from a PC. |
code.py |
The main program. Reads the keyboard, records RF signals, and replays them. |
pcb/ |
Gerber file and EasyEDA project used to manufacture a custom PCB, instead of using a breadboard (so-named 'Project Makemake', per planetary-body naming convention of previous hardware-based repos of mine). |
signals/ |
RF signals of products I currently use. |
Download CircuitPython 10.x for the Waveshare RP2350-USB-A board profile: https://circuitpython.org/board/waveshare_rp2350a/
- Hold BOOTSEL, plug into your PC, then release
- A drive called
RPI-RP2appears — drag the.UF2onto it - The board reboots and remounts as
CIRCUITPY
Using circup (recommended):
pip install circup
circup install neopixelOr manually copy into CIRCUITPY/lib/ from the Adafruit CircuitPython Bundle:
neopixel.mpy
Copy boot.py and code.py to the root of your CIRCUITPY drive. CircuitPython automatically runs boot.py first, then code.py on every boot.
boot.pyinitialises the USB host port and configures storage — it must live in the root ofCIRCUITPY, not inside a subfolder.
Copy the signals/ folder to the root of your CIRCUITPY drive. Any .sig files inside will be loaded automatically at boot and immediately available as key bindings to the same key as the filename.
CIRCUITPY/
boot.py ← USB host init + storage config (runs before code.py)
code.py ← Main script
signals/ ← Saved RF signals, one .sig file per key binding
A.sig
B.sig
...
lib/
neopixel.mpy ← NeoPixel LED library
- Connect your keyboard and power the RP2350-USB-A.
- Hold down the key you want to assign (e.g.
A,SHIFT+1,F3) for 4 seconds. - The RP2350-USB-A's LED turns solid yellow, and the board is now listening for an RF signal.
- Press and hold the button on your original remote while close to the RP2350-USB-A and receiver.
- The LED flashes yellow twice on success, or red three times if it timed out (try again).
The signal is saved automatically to the signals/ folder, named after the key you've recorded it to, and re-assigned to the same key automatically across power-cycles. For example, A.sig or SHIFT_F1.sig. It can be opened in a text editor if you want to add a label or note, or backed up.
Just press the key. The LED flashes blue briefly while transmitting, then goes off. If the blue LED is seen but the target device fails to respond, try re-recording.
The signals/ folder contains recordings for a few products I currently own. Feel free to re-use them, naming them after the key to which they should be assigned.
By default, the board's storage is not writable from your PC while the main program is running (this is required so the program itself can save new recordings).
To copy files to or from your PC, quickly tap the RST button followed by the BOOT button, within one second. The LED will pulse green to confirm safe mode. In this mode, neither boot.py nor code.py runs, so the board presents a normal writable CIRCUITPY drive on your computer. You can then drag .sig files in or out of the signals/ folder freely. Unplug and replug to return to normal operation.
| Colour | Meaning |
|---|---|
| White (single flash) | Board just powered on |
| Blue (5 flashes) | Starting up |
| Yellow (2 flashes) | Keyboard connected |
| Solid yellow | Waiting to record — point your remote at the receiver |
| Yellow (2 flashes) | Signal recorded successfully |
| Red (3 flashes) | Recording timed out — no signal detected |
| Blue (brief) | Replaying a signal |
| White (rapid) | An unexpected error occurred — connect via serial for details |
Each .sig file in the signals/ folder is plain text, with one number per line representing pulse timings in microseconds. Lines starting with # are comments and are ignored. You can open any file in a text editor to add notes, or copy signal files from another device.
To delete a signal and thus remove a key's mapping, simply delete its .sig file.
