Legacy firmware. This targets the retired FlexGrid V1 hardware and uses the legacy
uasyncioAPI from the MicroPython pre-1.20 era. It will not run on modern MicroPython (v1.20+) without porting to theasynciomodule. For current hardware, use FlexGridV3-Firmware. Kept for reference and reproducibility of V1 boards.
MicroPython firmware for the ESP32-S3 “FlexGrid V1.0” pressure-sensor matrix controller, part of the OpenMuscle project.
- Overview
- Features
- Hardware Requirements
- Software Requirements
- Getting Started
- Configuration
- Usage
- Contributing
- License
This repository contains the MicroPython firmware for the FlexGrid V1.0:
a 16×4 Velostat pressure-sensor matrix driven by an ESP32-S3. It samples the matrix asynchronously, broadcasts the data via UDP over Wi-Fi, and provides a simple two-button menu interface (with on-screen or REPL-based configuration).
- Async sensor scanning of a 16 (columns) × 4 (rows) matrix via a 4-bit MUX and ADC1 channels
- Wi-Fi + UDP networking for real-time data streaming
- SSD1306 OLED menu/UI (fallback to REPL logging if display is absent)
- Two-button navigation and on-device configuration (Wi-Fi & UDP target)
- Centralized logger with
[DBG],[INF],[WRN],[ERR]levels - Modular code organization:
sensor_matrix,network_manager,display_manager,menu_manager,settings_manager,logger
- ESP32-S3 WROOM-1 (N16-R8) module
- 16-channel analog MUX (e.g. CD74HC4067)
- Velostat pressure-sensor matrix (16×4)
- Two momentary push-buttons
- SSD1306 I²C OLED display (optional)
- MicroPython for ESP32-S3
mpremoteor Thonny IDE- (Optional)
ssd1306.pydriver in/lib
/
├── boot.py
├── flexgrid.py
├── config/
│ └── settings.json
└── lib/
├── display_manager.py
├── logger.py
├── menu_manager.py
├── network_manager.py
├── sensor_matrix.py
├── settings_manager.py
└── ssd1306.py ← copy from your driver source
- Install MicroPython onto your ESP32-S3 using esptool and these instructions.
- Copy the repository contents to the device flash:
mpremote connect /dev/ttyUSB0 fs cp -r . :/ - Reboot:
mpremote connect /dev/ttyUSB0 reset
The first time you boot, a default config/settings.json is created:
{
"wifi_ssid": "",
"wifi_password": "",
"udp_target_ip": "192.168.1.100",
"udp_port": 4210
}Use the on-device menu (or REPL input()) to set your Wi-Fi credentials and UDP target.
- Boot:
boot.pyschedulesflexgrid.main()on the asyncio loop. - Async loops:
sensor_loopreads and sends matrix data every 100 ms.display_looprefreshes the UI every 250 ms.menu_looppolls buttons every 50 ms.
- Logs appear on the REPL prefixed by log level.
- Fork the repo.
- Create a feature branch (
git checkout -b feature/foo). - Commit your changes (
git commit -am "Add foo"). - Push to the branch (
git push origin feature/foo). - Open a Pull Request.
Please adhere to the existing code style, include meaningful log statements, and update the README as needed.
This project is licensed under the MIT License. See LICENSE for details.