Output Stage Hardware
Architecture
Section titled “Architecture”The output stage sits between the ESP32-S3 microcontroller and the organ’s analog circuits. It converts digital commands into the voltages and switch closures the organ expects.
graph LR
MIDI["MIDI-In<br/>(USB · BLE · DIN-5)"] --> MCU{ESP32-S3}
MCU -->|SPI| DAC["DAC ICs<br/>(MCP4728 ×2)"]
MCU -->|GPIO| DRV["Relay Drivers<br/>(ULN2803)"]
MCU -->|PWM| MOT["Motor Driver<br/>(TBD)"]
DAC --> AMP["Op-Amp<br/>Gain Stages"]
AMP --> CV["Organ CV Nodes<br/>VCO · Filter · LFO"]
DRV --> RLY["Relay Modules"]
RLY --> SW["Organ Switches<br/>Leslie · Tabs · Effects"]
MOT --> LSL["Leslie Motor<br/>(if DC — Scenario B)"]
style MIDI fill:#065f46,color:#d1fae5,stroke:#10b981
style MCU fill:#78350f,color:#fef3c7,stroke:#d97706
style CV fill:#92400e,color:#fef3c7,stroke:#d97706
style SW fill:#92400e,color:#fef3c7,stroke:#d97706
style LSL fill:#92400e,color:#fef3c7,stroke:#d97706
DAC Subsystem
Section titled “DAC Subsystem”The DAC subsystem generates analog voltages for the organ’s continuous-control circuits (VCO pitch, filter cutoff, LFO parameters, expression). Channel count is derived from the Output Inventory continuous targets table.
DAC IC Selection
Section titled “DAC IC Selection”Primary choice: MCP4728 (4-channel, 12-bit, I2C)
| Feature | Specification |
|---|---|
| Channels | 4 per chip (2 chips = 8 channels) |
| Resolution | 12-bit (4096 steps) |
| Interface | I2C (2-wire, addressable) |
| Output range | 0–2.048V (internal VREF) or 0–VDD |
| Update rate | 400 kHz I2C → ~50 kHz per channel |
| EEPROM | Stores power-on default values |
Two MCP4728s on the I2C bus provide 8 DAC channels — enough for all identified continuous targets with room for expansion. Each chip has a unique I2C address (factory-set, changeable via special command).
Alternative: MCP4922 (2-channel, 12-bit, SPI)
Faster update rate than I2C (SPI clock up to 20 MHz), but requires more chips (3–4 for 6–8 channels) and more GPIO for chip-select lines. Better suited if update rate proves critical for pitch tracking.
Op-Amp Gain Stage
Section titled “Op-Amp Gain Stage”Each DAC output feeds a non-inverting op-amp gain stage that scales 0–3.3V to the organ’s operating voltage:
| Target Voltage | Gain | R1 (kΩ) | R2 (kΩ) | Op-Amp Supply |
|---|---|---|---|---|
| 0–5V | 1.52 | 10 | 5.1 | +12V |
| 0–10V | 3.03 | 10 | 20 | +12V or +15V |
| 0–12V | 3.64 | 10 | 27 | +15V |
Op-amp selection: TL074 (quad JFET op-amp) — one chip handles four channels. Low offset voltage, rail-to-rail not required since the supply rails exceed the output range. Two TL074s cover all 8 DAC channels.
The exact gain for each channel will be set after bench measurement of the target CV node voltage ranges (see Output Inventory investigation queue).
Relay Driver Subsystem
Section titled “Relay Driver Subsystem”Binary targets (Leslie speed, tab stops, tremolo/vibrato, rhythm) require switch closures. The ESP32’s 3.3V GPIO drives relay coils through Darlington transistor arrays.
ULN2803 Darlington Array
Section titled “ULN2803 Darlington Array”| Feature | Specification |
|---|---|
| Channels | 8 per chip |
| Input | 3.3V–5V logic compatible |
| Output | Open-collector, 500 mA per channel |
| Protection | Internal flyback diodes for relay coils |
The ULN2803 is the standard interface between microcontrollers and relay coils. Each input pin connects directly to an ESP32 GPIO; each output pin drives a relay coil. The internal flyback diodes suppress the inductive voltage spike when a relay de-energizes — no external protection diodes needed.
Relay Count
Section titled “Relay Count”From the Output Inventory binary targets:
| Group | Relays | Notes |
|---|---|---|
| Leslie (Off/Slow/Fast) | 2 | Two relays encode three states |
| Orbit III voice tabs | 10 | One relay per tab stop |
| Tremolo | 1 | On/off |
| Vibrato | 1 | On/off |
| Rhythm select | 2–4 | Depends on switch matrix investigation |
| Total | 16–18 |
Two ULN2803 chips (16 channels) cover the minimum count. A third chip provides headroom for rhythm selection and future expansion.
Relay Selection
Section titled “Relay Selection”Preferred: SRD-05VDC-SL-C (Songle 5V SPDT relay) — ubiquitous, cheap, available on pre-built relay modules with screw terminals for prototyping. Switching capacity: 10A @ 250VAC, far exceeding the organ’s tab stop and signal switching requirements.
For the Leslie motor control (if relay-switched per Scenario A), use a relay rated for the motor’s inrush current — typically 3–5× running current for an AC induction motor.
Level Shifting
Section titled “Level Shifting”The ESP32-S3 operates at 3.3V logic. The organ’s circuits use 5V and 12V signals.
| Direction | Voltage | Method |
|---|---|---|
| ESP32 → ULN2803 | 3.3V → relay coil | ULN2803 handles directly (3.3V input threshold met) |
| ESP32 → DAC (I2C) | 3.3V | No shifting needed (MCP4728 operates at 3.3V) |
| DAC → organ CV | 0–3.3V → 0–12V | Op-amp gain stage (see above) |
| ESP32 GPIO → motor driver | 3.3V → driver input | Most motor drivers accept 3.3V logic |
The ULN2803’s internal Darlington pairs have a low enough input threshold (~2.5V) to trigger reliably from 3.3V GPIO. No separate level shifter is needed for the relay subsystem.
Motor Driver
Section titled “Motor Driver”The Leslie motor interface depends on the investigation results. Three hardware options correspond to the three Leslie scenarios:
| Scenario | Motor Type | Driver Hardware | ESP32 Interface |
|---|---|---|---|
| A (relay) | AC induction | Relay module (mains-rated) | 2× GPIO via ULN2803 |
| B (variable) | DC | L298N H-bridge or BTS7960 | PWM output |
| C (VFD) | AC induction | Variable Frequency Drive | Serial or analog |
Scenario A requires no dedicated motor driver — the same ULN2803 + relay chain used for tab stops handles the Leslie speed relays. The relays must be rated for motor inrush current.
Scenario B adds an H-bridge motor driver (L298N for small motors, BTS7960 for larger ones). The ESP32 generates a PWM signal; the driver converts it to motor voltage. Direction control is not needed (Leslie spins one way).
Scenario C is documented for completeness — a VFD is a separate industrial component that would be specified and installed independently of the ESP32 output stage.
Power Supply
Section titled “Power Supply”The output stage needs to power DACs, op-amps, relays, and potentially a motor driver. Rather than adding an external supply, the design taps the organ’s existing power rails:
| Rail | Source | Used By |
|---|---|---|
| +5V | Organ’s 5V regulator or ESP32 USB | Relay coils, ULN2803 VCC |
| +12V (or +15V) | Organ’s Orbit III power supply | Op-amp supply rails |
| +3.3V | ESP32 onboard regulator | DAC ICs, ESP32 GPIO |
| GND | Common ground | All subsystems |
Prototyping Approach
Section titled “Prototyping Approach”Phase 1 uses off-the-shelf breakout boards and modules wired to an ESP32-S3 dev board. No custom PCB is needed until the circuit is proven.
| Component | Module | Interface | Approximate Cost |
|---|---|---|---|
| ESP32-S3 | ESP32-S3-DevKitC-1 | — | $10 |
| DAC (8 ch) | MCP4728 breakout × 2 | I2C | $8 × 2 |
| Relay (16 ch) | 16-channel relay module | GPIO via ULN2803 | $12 |
| Op-amps | TL074 on breadboard | DAC outputs | $2 |
| Resistors | Assorted 1% metal film | Gain setting | $5 |
| Total | ~$45 |
The prototyping phase validates each output channel independently:
- DAC → op-amp → voltmeter — confirm voltage scaling for each target range
- GPIO → relay → continuity test — confirm relay switching for each tab stop
- Connect one channel to the organ — start with the Leslie (most dramatic, easiest to verify by ear)
- Add channels incrementally — expression volume, then Orbit III CV, then remaining targets
This incremental approach minimizes risk to the organ’s circuits — each new connection is validated in isolation before moving to the next.