Subjects: Hardware , Automation , Assembly Guides
Use Cases: PCB Design & Assembly , Device Control , Automation Deployment
Audio Card Assembly Guide
Table of contents
Here’s the revised and expanded version of your Audio Card introduction, similar to the structure of the Output Card description:
Introduction
See the How to Use Assembly Guides for detailed instructions.
The Audio Card works in conjunction with the LCC Fusion Node Card and a Node Bus Hub to provide advanced audio playback capabilities, including text-to-speech and .wav file playback, through up to four connected speakers. The Audio Card allows administrators to assign specific LCC Event IDs to trigger the playback of either pre-recorded sounds or synthesized speech, which is highly configurable via the LCC Configuration Tool.
Typical applications for the Audio Card include:
- Audio feedback for LCC system users:
- Playback of error notifications, system status updates, and operational messages.
- User-defined voice messages triggered by specific LCC Event IDs configured through the CDI (Configuration Description Information).
- Sound effects playback, such as:
- Realistic sound effects triggered by events, like turnout points changing, crossing bells, or engine noises.
The Audio Card also integrates with other LCC modules, enabling synchronized responses across devices for complex audio-visual effects on model train layouts.
Hardware Configuration and Features
The Audio Card is equipped with a robust hardware setup designed to handle both text-to-speech conversion and high-quality audio playback from external sound files. Its hardware configuration includes:
SuperMini ESP32-S3 Module:
The core of the Audio Card, the ESP32-S3 module, runs the firmware responsible for managing both text-to-speech (TTS) and audio file playback capabilities:
- Text-to-Audio Conversion:
- I2C and Bluetooth Support: Receives text messages from the LCC Node via I2C or Bluetooth.
- Text-to-Speech Engine: Converts text data into audio using the Espeak-NG Text-to-Speech Library.
- I2S Interface: Sends the generated audio signals to the amplifier through the I2S protocol, ensuring high-quality audio output to the connected speakers.
- .wav File Playback:
- Micro-SD Card Interface: Reads audio data from a micro-SD card. This allows the card to store multiple .wav files for different sound effects or voice messages.
- High-Quality Audio Output: Sends .wav file audio data to the amplifier via I2S, ensuring fidelity in sound playback.
Audio Amplifier:
The Audio Card supports up to four MAX98357A IC audio amplifiers, capable of sending audio signals to individual speakers. These amplifiers feature the following:
- Audio Outputs:
- Supports up to four speakers via RJ45 or 2-pin terminal connectors. This provides flexibility for different speaker setups.
- Class-D audio amplifiers with low power consumption, making them ideal for compact and power-efficient installations.
- Independent Audio Channels:
- Each amplifier can drive a separate speaker, allowing simultaneous playback of different audio tracks or messages on different channels.
Power Supply and Configuration:
- Selectable Power Options:
- Configurable power options for either 5 V or 12 V input, ensuring compatibility with a wide range of power setups commonly used in LCC systems.
- Configurable Outputs:
- Each audio output channel can be configured via software to respond to specific LCC Event IDs, providing flexibility in system integration.
Communication and Control:
- Node Addressing Support: Up to 16 Audio Cards can be integrated into a single LCC Node setup, allowing for large-scale, multi-speaker audio installations across the layout.
- Firmware Updates: The ESP32-S3 module can receive over-the-air (OTA) updates, allowing easy firmware upgrades and feature additions without removing the device from the layout.
Use Case Scenarios
The Audio Card is designed for multiple use cases in model train layout automation, where immersive audio effects and feedback are critical:
- Station Announcements: Automatically play voice announcements for station arrivals or departures, synchronized with the train’s schedule.
- Sound Effects for Turnouts and Sensors: Play audio cues such as bells or clanging metal when turnout points change or sensors detect a train’s presence.
- Emergency Alerts and Feedback: Provide real-time system status updates, error messages, or emergency alerts via voice or pre-recorded sound files.
- User-Defined Events: Train operators can configure custom sounds or messages to be triggered by user-defined LCC Event IDs, enhancing the interactivity and automation of the layout.
System Overview:
The following outlines the flow of activity for the Audio Card:
flowchart LR
can["CAN Network"];
subgraph layout ["Train Layout"];
direction LR;
can --> |"LCC Event<br/>(Action, File#)"| n[["Node Card"]] -->|"Text Message / <br/>.wav Filename"| c[["Audio Card (16x)"]];
c -.-> |"Text to audio<br>conversion"| c
sd["SD Card"] -->|".wav File"| c
c --> bb["Audio <br>Breakout Board"];
bb -.-> |"Audio <br>Stream"| device(("Speakers (4x)"));
end
classDef lSalmonStyle fill:#FFA07A,stroke:#333,stroke-width:2px,font-size:24px;
class c lSalmonStyle;
classDef lightGrayStyle fill:#d3d3d3,stroke:#333,stroke-width:2px,font-size:24px;
class layout lightGrayStyle;
Diagram Explanation
Here’s an explanation of the diagram above. Click to listen to an audio explanation.
The Audio Card interfaces with the LCC Fusion Node Card, which processes and triggers LCC Events. When an event is triggered (such as a sensor detecting a train or a command issued from the control panel), the Audio Card plays the corresponding audio message or sound effect. The system can perform either text-to-speech conversion or playback pre-recorded .wav files stored on the micro-SD card.
Audio Playback Process:
- LCC Event Trigger: The LCC Fusion Node Card detects the relevant event, such as a train entering a station or a turnout change, and transmits an LCC Event ID to the Audio Card.
- Text-to-Speech Conversion:
- If the event is configured to trigger a text message, the Audio Card receives the text data via I2C or Bluetooth and converts it into audio using the Espeak-NG Text-to-Speech Library. The audio signal is then sent via I2S to one of the connected MAX98357A audio amplifiers for playback through the corresponding speaker.
- .wav File Playback:
- If the event triggers a .wav file sound effect, the Audio Card reads the corresponding .wav file from the micro-SD card and sends the audio data via I2S to the appropriate amplifier for playback. This could include sound effects like bells, engine sounds, or station announcements.
- Audio Output:
- The output from the Audio Card is routed through the I/O Breakout Board to the connected speakers. The system supports up to four independent speakers, which can be placed strategically across the layout to deliver immersive and synchronized audio feedback. This allows each speaker to play unique sounds based on specific LCC Event triggers.
This flexible design ensures that audio feedback, from synthesized voice messages to rich sound effects, is an integral part of the model train layout, enhancing both the realism and interactivity of the environment.
- esp32_s3 - not defined
- jumper_caps - not defined
- lcc_event_id - not defined
- lcc_fusion_io_cards - not defined
- lcc_fusion_node_bus - not defined
- lcc_fusion_node_card - not defined
For other terms, please refer to the full Terminology Guide.
Assembly and Component Placement
This section combines both the component specifications and the assembly instructions to ensure a smooth assembly process. Below is a comprehensive list of components, their placement on the PCB, and orientation details to assist you during assembly.
High-Level Steps for Assembly:
- PCB for the card can be ordered from any PCB fabricator using these Gerber Files.
- Clean PCB with alcohol to remove residue. See Cleaning_PCB for details.
- See also: Soldering Tips
- PCB Components - listing of components used for PCB assembly
- PCB Parts - listing of parts used for PCB assembly
- Each audio amp configuration consists of MAX39357A IC, 2 capacitors (0.1 uF, 10uF), 2 diodes (SS310), and speaker connections (JST XH and/or RJ45 socket).
Below is a list of the PCB components used for this card (see diagram before reference):
Component Identifier | Count | Type | Value | Package | Purpose | Orientation |
---|---|---|---|---|---|---|
Capacitors | ||||||
C1, C3, C5, C7, C10 | 5 | Capacitor-Ceramic | 0.1uF | 1206 SMD | Decoupling Capacitor for IC Protection | None |
C2, C4, C6, C8, C9 | 5 | Capacitor-Ceramic | 10uF | 1206 SMD | Decoupling Capacitor for IC Protection | None |
Diodes | ||||||
D1 - D8 | 8 | Diode-Schottky | SS310 | SMD | Circuit protection from reverse current from speaker connections. | Cathode end has a white line and positioned towards PCB left edge |
D5 | 1 | ESD Diode | PESD1CAN | SOT-23 SMD | I2C data bus electrostatic discharge (ESD) | Cathode end has a white line and positioned towards PCB left edge |
Fuses & Protection | ||||||
F1 | 1 | Fuse-PTC Polymer | 0.2A, 3V (or higher) | 1206 SMD | Protects overload from SD Module | None |
F2 | 1 | Fuse-PTC Polymer | 1A, 5V (or higher) | 1206 SMD | Protects overload from audio speakers | None |
Filters & Noise Suppression | ||||||
FB1, FB2 | 2 | Ferrite Bead | BLM31PG121 | 1206 SMD | I2C Network Bus Data Line Noise Suppression | None |
Connectors | ||||||
J1 - J4 | 4 | JST XH Socket | 2P, 2.54mm | PTH or Spring Terminal | Connectors to speakers | None |
J5 | 1 | RJ45 Socket | 8P8C | PTH | Network cable (CAT5/6) connections to speakers (4 pairs). | Fits only one way |
J6, J7 | 2 | Female Header | 9-Pin | PTH | Socket for Super-Mini ESP32-S3 development board(s) | None |
J8 | 1 | Female Header | 8-Pin | PTH | Required when using Micro-SD Card Reader for playing .wav files. | None |
Resistors | ||||||
R1, R2, R3 | 3 | Resistor | 1kΩ | 1206 SMD | Used to limit the current to SW1 and MCP23017 for the I2C address | None |
Switches & Indicators | ||||||
JP1, JP2 | 2 | Male Header | 3P, 0.1” | PTH | Used for COMM BUS selection (I2C hardware bus) for either BUS A or BUS B. | None |
SH1, SH2 | 2 | Jumper Cap (Shunt) | 2.54mm | - | Used to set the COMM BUS selection (JP1, JP2) | None |
SW1 | 1 | Slide Switch | 3P, 2.54mm | PTH | Used for COMM ADDR selection (I2C address offset, 0-7). | Position ON towards PCB top edge |
ICs | ||||||
U1, U2, U3, U4 | 4 | Audio Amp | MAX98357A | 16TQFN | Class D audio amplifier supporting I2S connections | Small dot (pin 1) on package is positioned to PCB bottom and right edges |
Storage | ||||||
Micro-SD Card Reader | 1 | Module | SPI | N/A | Micro-SD Card Reader is required for playing .wav files. | |
Micro-SD Card | 1 | SD Card | N/A | N/A | Required for storing .wav files. | N/A |
Tools Required
Safety Precautions
- See Safety Precautions.
Testing and Verification
The following test and verifications of the card should be performed after a through inspection of the card’s soldering. Check all of the PTH component pins and SMD pads. Make sure there are no solder bridges between pins and pads.
Visual Inspection
-
Solder Joint Inspection: Use a magnifying glass or a microscope to inspect solder joints. Look for cold solder joints, insufficient or excessive solder, or any shorts between pads.
-
Component Orientation: the IC’s are correctly oriented according to the PCB silkscreen or schematic.
Connectivity Testing
- Continuity Check: Use a multimeter in continuity mode to check for shorts between power rails and ground, and to ensure there are no open circuits in critical connections.
Power-Up Tests
- Assembly a tested Power Module to the LCC Fusion Node Card.
- Apply Power to the Power Module and verify the following:
- Check for Hot Components: Feel for components that are overheating, which could indicate a problem like a short circuit or incorrect component.
Functional Testing
I2C Verification
- Verify that the I2C connection between the LCC Fusion Node Card and the Audio Card work. See Testing I2C Cards for details on how to test the I2C for a I2C enabled card.
Troubleshooting
- See I2C Trouble Shooting.
Appendices
Specifications
The card’s specifications are as follows:
Characteristic | Value |
---|---|
Max Speakers | 4 |
Max Audio Amps | 4 |
Max Text Message Length | 16K Characters |
Max .wav File Size | 400K1 |
Maximum Number of Cards per LCC Fusion Node Cluster | 162 |
LCC Fusion Node Bus HubConnectors | 13 |
- If the ESP32 has PSRAM, the .wav file size can be up to the size of PSRAM (e.g., 2MB).
- The LCC Fusion Node Cluster can support up to 16 cards, distributed across two I2C hardware buses, with a maximum of 8 cards per bus.
- Note: This total includes all cards using the I2C address range of
0x60
, as defined by the ESP32 firmware for audio.
- Note: This total includes all cards using the I2C address range of
- Connections include GND, 5V, SCL0/SDA0, and SDA1/SCL1.
How It Works
The following outlines the operational flow of the Audio Card:
The firmware of the LCC Fusion Node Card interfaces with the ESP32 on the Audio Card, leveraging the bus and address details specified in the card’s CDI I2C section.
Text-to-audio conversion:
-
Upon receiving an LCC Event-related signal, the LCC Fusion Node Card firmware sends an I2C text message to the Audio Card, instructing it to convert the text into audio for the configured audio device.
Alternatively, the Audio Card can receive text messages via Bluetooth from a Bluetooth Serial App (e.g., on a phone).
-
The ESP32 on the Audio Card uses a text-to-speech library to convert the text to audio signals and passes them to the audio amplifier via an I2S (serial) connection.
-
The audio amplifier outputs the audio signal to a speaker connected via a JST XH socket or an RJ45 socket.
Wav file playback:
-
Upon receiving an LCC Event-related signal, the LCC Fusion Node Card firmware sends an I2C message to the Audio Card, instructing it to play a specific .wav file from the micro-SD card.
Alternatively, the Audio Card can receive text messages via Bluetooth from a Bluetooth Serial App (e.g., on a phone).
-
The ESP32 on the Audio Card reads the specified .wav file (by name) from the micro-SD card reader and passes the audio data to the audio amplifier via an I2S connection.
Connections
Component Designator | Connector Label | Connector Type | Connection Number | Description |
---|---|---|---|---|
J1, J2, J3, J4 | SPEAKER 1 - 4 | JST XH, Spring Terminal | 1/2, 3/4, 5/6, 7/8 | 2-wire connections to speakers |
J5 | SPEAKERS | RJ45 Socket | 1/2, 3/4, 5/6, 7/8 | 4 pairs of connections to speakers |
J6, J7 | SuperMini ESP32-S3 | 9-Pin Male Header | n/a | Pluggable socket for SuperMini ESP32-S3 |
JP1, JP2 | COMM BUS | 3-Pin Male Header | A, B | COMM BUS selection (I2C hardware bus) for BUS A or BUS B. Must match configuration in the LCC Node CDI setup. |
SW1 | COMM ADDR | Slide Switch | 1, 2, 3 | COMM ADDR selection (I2C address offset 0-7). Added to base address of MCP23017 (0x20). Configure for CDI setup. |
Protection
The Audio Card converts text messages into audio signals, which are then amplified and outputted through speakers. The following is an overview of each protection component integrated into the Audio Card and its role:
Protected Component | Protection Component | Function | Specifications | Location |
---|---|---|---|---|
Speaker Connectors | Diodes | Protect against reverse voltage by blocking current flow in the wrong direction. | Reverse Voltage: 100 V Forward Current: 3A |
In series with each input/output power connector |
Audio Amp | Decoupling Capacitors | Filters out high-frequency noise and transient voltage spikes from the power supply, ensuring stable voltage to audio amp IC. | Values: 0.1 µF ceramic, 10 µF electrolytic or ceramic | Across Vcc and GND near IC. |
I2C Lines | Ferrite Bead BLM31PG121SN1L | Provides high-frequency noise suppression on the I2C lines. | Impedance: 120 ohms at 100 MHz | In series with the SDA and SCL lines of the I2C bus |
I2C Lines | ESD Protection Diode PESD1CAN | Protects the I2C lines from electrostatic discharge and voltage spikes. | Reverse Stand-off Voltage (Vr): 24 V Clamping Voltage (Vc): 40 V |
Across the SDA and SCL lines to GND |
Speaker Connectors | SS310 Diodes | Protect against reverse voltage by blocking current flow in the wrong direction. | Reverse Voltage: 100 V Forward Current: 3A |
In series with each speaker connectors |
References
- Choosing the Right Resistor for LEDs
- Super-Mini ESP32-S3 pin assignments.