This is an LED control program for protogen helmets to be used with MAX7219 LED matrixes and ESP32 dev boards.
Note that this is a pre-release with some bugs, unfinished code and a major lack of documentation.
Use at your own risk.
For now I can provide a brief setup guide as I don't have time to write detailed documentation. Sorry!
The following hardware is supported, with more to come in the future:
- ESP32-WROOM dev board
- MAX7219 LED Dot matrix modules (Two 32x8 (FC16) modules for mouth, one 32x8 cut in half for eyes and two 8x8 modules for nose)
- SSD1306 128x64 OLED I2C display (Heads up display)
- MOCUTE 052 Bluetooth Gamepad
- TCRT5000 Infrared obstacle avoidance sensor (Boop sensor, analog and digital)
- WS2812 LED strip or something similar supported by the FastLED library
- MAX9814 Electret microphone module
- Any 5V PWM controlled fan (Noctua NF-A4x20 5V PWM)
Most if not all hardware can be purchased on sites like aliexpress or ebay.
MAX7219 can be daisy chained. Wire up displays in this order:
- ESP32
- Eye Left (16x8)
- Mouth Left (32x8)
- Nose Left (8x8)
- Nose Right (8x8)
- Mouth Right (32x8)
- Eye Right (16x8)
| MAX7219 | ESP32 |
|---|---|
| DIN | 23 |
| CS | 5 |
| CLK | 18 |
Use an external 5V power supply! Powering the matrixes from the 5V pin on your ESP32 board is not recommended. Also avoid using dupont cables and solder directly instead.
| SSD1306 | ESP32 |
|---|---|
| SCL | 22 |
| SDA | 21 |
Both 3.3V or 5V should work for power
For better tracking and easier calibration use the analog output.
| TCRT5000 | ESP32 |
|---|---|
| A0 | 39 (marked SN or VN) for analog |
| D0 | 19 for digital |
Use 3.3V for power
| WS2812 | ESP32 |
|---|---|
| DIN | 15 |
Use an external 5V power supply
| MAX9814 | ESP32 |
|---|---|
| DIN | 36 (marked VP) |
Connect VDD to 3.3V
Connect AR to GND for a 1:500 attack/release ratio
Connect GAIN to VDD for a 40dB gain
| Fan header | ESP32 |
|---|---|
| PWM (Blue) | 16 |
Use an external 5V power supply
- You'll need Visual Studio code with the PlafromIO IDE extension installed.
- Clone this project and add it in the PlatformIO menu (PlatformIO -> PIO Home -> Projects & Configuration -> Add Existing). This should set up a development environment and download all necessary dependencies.
- Press PlatformIO: Build (Ctrl+Alt+B) to build your project.
- When ready, connect your ESP32 board and press PlatformIO: Upload (Ctrl+Alt+U). Wait until Connecting... message shows up and hold down the BOOT button on your ESP32 until it starts uploading.
- Turn on your gamepad and flip KEY/GAME switch to GAME position.
- Enjoy!
- Included are diagram.json and wokwi.toml files for testing using the Wokwi Simulator plugin for VS Code.
- Install the plugin according to the Wokwi documentation.
- Build the program first with PlatformIO (Ctrl+Alt+B). Then, press F1 and select Wokwi: Start Simulator
- If nothing happens for a while, try disabling the gamepad in config.h and try again.
- Note that the simulation is going to be considerably slower than hardware. I only recommend using this approach for quickly testing new ideas without hardware.
The default button mapping in "GAME" mode is as follows:
| Buttons | Action |
|---|---|
| BACK, MENU, X | Change face set (FaceSwitcherController) |
| Joystick movement | Current controller action (Change face, navigate menu) |
| Trigger | Blink eye |
| Y | Run automatic face switcher (AutomaticFaceSwitcherController) |
| B | Show Stats/Settings (SettingsController) |
| A | Calibrate analog boop sensor |
"KEY" mode is currently unsupported.
- Important configuration constants can be found in config.h
setup()function in main.cpp handles registering and initializing displays, peripherals, used transitions and overlays- Change button mapping in the
createButtonMapping()function - Change settings menu in the
createSettingsMenu()function - Debug messages DDEBUG, DBTDEBUG and DMICDEBUG can be enabled in platformio.ini
- Check Bitmaps.h, Bitmaps.cpp for bitmap definitions
- Sequences.h, Sequences.cpp store animation sequences. Read the included README file.
- Transitions.h, Transitions.cpp, Overlays.h, Overlays.cpp for overlay sequences and transitions.
This program is licensed under GNU Affero General Public License v3.0.



