LCC Fusion Project 1.0
LCC Automation
Loading...
Searching...
No Matches
Sound Card Firmware

Introduction

The Sound Card is part of the LCC Fusion Project, bringing sound capabilities to model railroad automation and other ESP32-based control systems. This firmware communicates with DFPlayer Mini MP3 modules via UART, triggered by I2C commands from a Node Card based on incoming LCC Events. This firmmware is only for use with an ESP32 DevKitC Module mounted on an LCC Fusion Sound Card (PCB). The firmware can be compiled using one of the following: 1) Arduino IDE (or CLI) using the 'ESP32 Dev Module' board packaged with the Espressif ESP32-core 2) Arduino IDE (or CLI) using the 'I/O Cards' board packaged with the LCC Fusion Boards - https://github.com/patfleming/LccFusionProject/blob/main/assets/downloads/package_lcc_fusion_esp32_index.json

  • NOTE: the LCC Fusion 'I/O Cards' board provides firmware support for: 1) an ESP32 with 4MB or 8MB flash 2) Bluetooth serial terminal apps running on either a phone or tablet. Connection information is provided at startup via a cabled serial monitor. 3) Web Serial console running within a browser connected via WiFi to the ESP32 access point. Connection information is provided at startup via a cabled serial monitor.
  • Up to 4 DFPlayer modules supported.
  • MP3 files are stored on a micro-SD card inserted in each DFPlayer.
  • MP3 file naming is; 001.mp3, 002.mp3, etc.
  • Each player can independently play, pause, loop, or reset audio playback.
  • MP3 files are triggered by either serial text commands and/or LCC Events and routed through the Node Bus I²C connection.
  • Text commands are using one of the following serial monitors (terminals):
  • Arduino IDE serial monitor attached via USB to the ESP32 module
  • Serial monitor applications compatible with Arduino serial communications (attached via USB cable)
  • Bluetooth Serial Terminal app running on a phone or tablet connected via bluetooth to the ESP32. Firmware must be compiled using the ENABLE_BT_SERIAL define
  • Web Serial console running within a web browser connected via WiFi to the ESP32 access point. Firmware must be compiled using the ENABLE_WEB_SERIAL define

Key Firmware Features

  • Receives I²C commands from the Node Card
  • Receives text control commands from serial applications (serial monitor, bluetooth, or web serial)
  • Sends control sequences to DFPlayer modules via software serial
  • Handles up to 4 concurrent players
  • Tracks and maps player state (play, pause, reset, etc.)
  • Plays 1-100 mp3 files from micro-SD card inserted in each DFPlayer
  • Includes built-in I2C address setting logic

Dependencies

Build & Flash Instructions

  1. Install Arduino IDE 2.3.6
  2. Download LCC Fusion board package using Arduino IDE preferences 'Additional boards URLs' referencing https://github.com/patfleming/LccFusionProject/blob/main/assets/downloads/package_lcc_fusion_esp32_index.json
  3. Install 'LccFusion Board' via Arduino IDE Boards Manager.
  4. Select the board; LCC Fusion -> I/O Cards
  5. Configure the board by selecting from the flash size and serial options

Testing & Diagnostics

  • Use the supported serial commands to test the sound card after installing the firmware, ESP32, and speakers.

System Diagram

[LCC Event] → Node Card → I2C → Sound Card → DFPlayer → Speakers

Related Hardware and Docs

Project Info

License

  • Licensed under MIT © 2024–2025 Pat Fleming