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

Introduction

The Audio Card is part of the LCC Fusion Project and provides configurable audio playback for model railroads and other layouts. It can play sound effects, spoken messages, or other audio clips in response to LCC Events, allowing you to add audible feedback, status announcements, or ambient sounds to your layout.

This firmware is intended for use only with an ESP32-based module mounted on an LCC Fusion Audio Card (PCB) and, in production, is normally controlled by an LCC Fusion Node Card over the Node Bus I²C connection.

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.

Key Firmware Features

  • Plays pre-recorded audio clips in response to LCC Events (e.g., block events, turnout changes, route selection, or user-defined logic).
  • Supports mapping Event IDs → audio tracks via CDI configuration.
  • Supports one or more output backends (depending on hardware build), such as:
    • On-board DAC / PWM audio driving a small power amplifier.
    • External I²S amplifier or codec (e.g., via an Audio Breakout Board).
  • Provides volume and track-selection control via configuration.
  • Optional test/demo mode allowing tracks to be triggered from the serial, Bluetooth, or Web Serial console.
  • Provides banner and status information at startup, including:
    • Card type and firmware version.
    • I²C address and Node Bus wiring.
  • Integrates with LCC Fusion diagnostics:
    • Built-in self-tests for I²C connectivity to the Node Card.
    • Optional GPIO / audio-path checks.

Dependencies

  • Software
  • ESP32 Module
    • ESP32 DevKitC or compatible ESP32 module supported by the LCC Fusion I/O Cards board.
    • 4MB or 8MB Flash (see board options).
  • LCC Fusion Audio Card
    • ESP32 module footprint.
    • Audio output stage (e.g., small Class-D amplifier and filtering).
    • I²C interface to the LCC Fusion Node Card.
    • Connectors to the Audio Breakout Board or directly to speakers.
    • Refer to config.h for I²C communications, I²C address, and GPIO pin assignments.
  • Audio Breakout Board / Speakers
    • Provides field-wiring friendly access to one or more speakers.
    • May include additional filtering or amplification depending on revision.

Build & Flash Instructions

  1. Install Arduino IDE 2.x.
  2. Download the LCC Fusion board package using Arduino IDE preferences 'Additional boards URLs' pointing to: https://github.com/patfleming/LccFusionProject/blob/main/assets/downloads/package_lcc_fusion_esp32_index.json
  3. Install the LccFusion Board via Arduino IDE Boards Manager.
  4. Select the board: LCC Fusion → I/O Cards.
  5. Configure board options (flash size, serial options, etc.) as required.
  6. Open the Audio Card firmware sketch and use Upload to flash the ESP32.

If your Audio Card firmware uses an SD card or SPIFFS for storing audio clips, be sure to:

  • Format and populate the storage with the expected directory/filename layout.
  • Update any file-path configuration in config.h or the CDI configuration.

Testing & Diagnostics

  • With the Audio Card powered and connected (either to a Node Card or as a bench unit), connect a serial monitor, Bluetooth terminal, or Web Serial console at the configured baud rate (typically 115200).
  • Verify that the card reports its firmware banner and I²C address at startup.
  • Use the help (?) or info command (if provided by the sketch) to list supported commands, such as:
    • Playing a specific track by number or name.
    • Listing configured Event-to-track mappings.
    • Running self-tests on I²C and GPIOs.
  • When connected to a Node Card and CAN-enabled LCC network:
    • Trigger a sample LCC Event (e.g., from another node or test tool).
    • Confirm that the corresponding audio clip plays and that the Node Card continues to report normal status.

System Diagram

[LCC Events on CAN Bus]
Node Card → I²C → Audio Card → Audio Breakout → Speakers

Typical Applications

  • Station announcements (arrival/departure, track assignments, etc.).
  • Crossing bells or ambient yard/industrial sounds.
  • Spoken diagnostics or instructions for nearby hardware (e.g., “Check wiring on BOD Card”, “Node 3: short detected in District 2”).
  • Fun, themed sound effects synchronized with layout operations.

Related Hardware and Docs

Project Info

License

  • Licensed under MIT © 2024–2025 Pat Fleming