Overview: Microphone-to-LOGO! Interface Challenge
Driving a Siemens LOGO! from an audio source is a recurring requirement for light organs, sound-triggered alarms, classroom signalling, and machine-guard "clap-to-start" circuits. The challenge is purely electrical: most microphones deliver millivolts, while the LOGO! analog input expects 0-10 V DC. No commercially available microphone produces a 0-5 V or 0-10 V output directly; the signal must be amplified, rectified, smoothed, and level-shifted before it reaches AI1-AI8 of a LOGO! 8 (6ED1052) BM or the AI of an AM2 / AM2 RTD expansion module.
This reference covers the complete signal chain from transducer to threshold trigger: microphone selection, bias networks, op-amp stages, full-wave rectification, RC smoothing, scaling into the LOGO! 0-10 V window, and the LOGO! Soft Comfort program that interprets the analog value. The intent is a reproducible design an integrator can deploy in volume (e.g., 200 classroom installations) with stable, repeatable triggering and no false positives from line hum or RF pickup.
Prerequisites
Before starting the design, confirm the following:
- LOGO! 8 base module (6ED1052-1CC08-0BA1 with display, or 6ED1052-1MD08-0BA1 pure) or LOGO! 7 (6ED1052-1xxxx) with at least one free AI1-AI4 input. See the LOGO! 8 System Manual (Siemens Online Support, entry ID 109741041) for the exact AI count of each BM variant.
- LOGO! Soft Comfort V8.x or newer installed on the engineering PC. The Analog Threshold (AT) and Analog Amplifier (AA) function blocks required for audio detection are documented in chapter 4 of the LOGO! System Manual.
- Single 24 V DC supply already present in the cabinet (LOGO! 8 accepts 12/24 V DC, 24 V AC, or 115/230 V AC depending on order code). The preamp board needs the same 24 V rail.
- Basic understanding of op-amp gain, single-supply operation, and RC time constants.
LOGO! 0-10 V Analog Input Characteristics
The voltage-mode analog inputs of a LOGO! 8 BM (AI1-AI4 on 6ED1052-1xxx08-0BAx variants) and the AM2 expansion module (AI5-AI8 on 6ED1055-1MA00-0BA2) share a common specification set defined in the LOGO! manual:
| Parameter | Value (LOGO! 8 BM AI1-AI4) | Value (AM2 AI5-AI8) |
|---|---|---|
| Input range | 0 - 10 V DC | 0 - 10 V DC (also 0/4-20 mA via DIP) |
| Resolution | 12 bit (0 - 1000 scaled internally to 0-1000) | 12 bit |
| Input impedance (voltage mode) | 72 kΩ typ. | 72 kΩ typ. |
| Max sustained input | ±28 V (absolute max) | ±28 V |
| Sampling / update rate | approx. 100 ms (process-image update) | approx. 100 ms |
| Accuracy at 25 °C | ±1.5 % of full scale | ±1.0 % of full scale |
| Connector | Removable 4-pin spring or screw terminal | Removable 4-pin spring or screw terminal |
Two practical consequences follow directly from the table:
- The 72 kΩ input impedance forms a resistive divider with the source. A 10 kΩ preamp output impedance introduces ~12 % attenuation at full scale. Design the preamp to drive the divider as a hard voltage source: keep output impedance below 1 kΩ.
- The 100 ms update rate means any audio detection scheme must produce a DC envelope that persists at least 200 ms for reliable triggering under the AT hysteresis. An RC time constant of τ = 100-220 ms on the rectifier output is the sweet spot for clap/voice/beat detection without aliasing every kick drum.
Microphone Types and Output Levels
Choosing the transducer is the single largest design decision; everything downstream scales from its output level and source impedance.
| Microphone type | Typical output | Source impedance | Supply needed | Notes for LOGO! project |
|---|---|---|---|---|
| Dynamic (moving coil) | 1 - 10 mV RMS (speech), up to ~50 mV (loud music) | 150 - 600 Ω | None (passive) | Most robust; needs highest gain stage. Suitable for permanent classroom installation. |
| Electret (with internal FET) | 5 - 50 mV RMS speech, ~200 mV loud voice | 1 - 2.2 kΩ | 1.5 - 10 V DC bias through 2.2 - 10 kΩ | Cheapest mass-market capsule. Excellent for 200-unit deployment. Recommended default. |
| Carbon (historic) | 100 - 500 mV | 30 - 80 Ω | 3 - 6 V DC bias | Obsolete; avoid for new builds even though it can directly drive a 0-10 V divider. |
| Electret with integrated preamp board | Line-level 200 - 1000 mV | < 100 Ω | 3 - 12 V DC | Maximum 12-bit → 1-bit jitter tolerance; useful for music (light organ) where level swings exceed the dynamic mic range. |
| Speaker-level tap (after amplifier) | 1 - 30 V RMS | 4 - 8 Ω | None (use amp output directly) | Common retrofit on stage equipment. Add 10:1 resistive divider + clamp diodes to keep LOGO! within ±28 V absolute max. |
For a multi-school deployment with 200 units, the electret capsule with integrated FET (e.g., the common 9.7 mm or 6 mm two-terminal type marked ±) is the lowest-cost, most-available option. Plan for a 2.2 kΩ bias resistor to 5 V and a coupling capacitor of 1 µF / 10 V from capsule to the preamp input.
Pre-Amplifier Circuit Design
The signal chain has three stages: low-noise microphone preamp, precision rectifier (since audio is bipolar and LOGO! AI is unipolar 0-10 V), and RC smoothing/scaling.
Stage 1 - Microphone preamp (single-supply op-amp)
Use a rail-to-rail input/output op-amp such as TLV2372, MCP6002, or LM358 on a single 5 V rail. With an electret capsule biased through 2.2 kΩ to 5 V and AC-coupled through 1 µF:
VCC = +5 V (from 24 V → 5 V LDO, e.g., LM7805 or RECOM R-78E5.0)
GND = LOGO! supply GND
MIC_CAPSULE
+|
___ electret (-)
| |
| 2.2kΩ
| |
+5V--/
___ C_in 1 µF (polarised, + to op-amp)
| |
+--|---+--- non-inverting input of U1A
|
R3 100 kΩ to GND (bias to VCC/2 midrail)
|
+--- VCC/2 mid-rail reference (R1=R2=10 kΩ divider, buffered by U1B)
Gain: R5/R4 = 100 kΩ/1 kΩ = 100x
U1A: inverting input receives capsule via R4 1 kΩ
Output of U1A drives Stage 2 (precision rectifier) through 10 µF coupling capacitor.
For a 10 mV RMS speech signal at the capsule, the preamp output is approximately 1 V RMS (≈ 1.4 V peak). With LM358 the output swings to within ~50 mV of the rails, so 1.4 V peak is comfortably within the 5 V supply window.
Stage 2 - Precision full-wave rectifier (absolute-value circuit)
Because the LOGO! AI only sees positive voltages, the bipolar audio must be rectified before scaling. A precision rectifier using a second op-amp (U1B) eliminates the 0.6 V diode drop and is accurate down to a few millivolts:
U1A output → C2 10 µF → R6 10 kΩ → node X
Node X drives:
- D1 (1N4148) anode, cathode → R7 10 kΩ → inverting input of U1B
- D2 (1N4148) cathode, anode → same inverting input of U1B
- R8 10 kΩ from inverting input of U1B to its output
- R9 10 kΩ from non-inverting input of U1B to VCC/2
Output of U1B is |Vin - VCC/2| + VCC/2, a positive envelope riding on VCC/2.
This is the classic absolute-value circuit. The output is a positive voltage that rises proportionally to the instantaneous magnitude of the input audio. Without an additional low-pass filter it is still a high-frequency waveform; Stage 3 smooths it.
Stage 3 - RC smoothing and scaling to 0-10 V
A first-order RC network converts the rectified envelope to a slowly varying DC. Time constant is critical: too short and the LOGO! AT block retriggers on every peak; too long and beats are missed.
U1B output
|
R10 4.7 kΩ
|
+-----+---- output to LOGO! AI1
| |
C3 C4
10 µF 100 nF
| |
GND GND
τ = 47 ms (R10 × C3) - fast envelope, suitable for tap/clap.
For music beat detection, increase C3 to 47 µF for τ = 220 ms.
Scale the smoothed envelope to fill the 0-10 V LOGO! window. Add a non-inverting gain stage with a potentiometer:
U1C (third op-amp of TLV2372 package, or stand-alone LM358 third half):
Non-inverting input ← smoothed envelope via R11 10 kΩ
R12 10 kΩ from non-inverting to GND (sets input impedance)
R13 100 kΩ from inverting to GND
R14 100 kΩ potentiometer (50 % of wiper to inverting input, ends to GND and output)
Output drives LOGO! AI1 through R15 100 Ω (input protection) and C5 100 nF (RF bypass).
Turn the potentiometer until a normal classroom voice produces ~5 V at AI1 and a hand-clap produces ~9 V. This places the AT trip threshold comfortably in the 6-7 V region with built-in hysteresis.
Step-by-Step Implementation
- Confirm the AI assignment. On a LOGO! 8 BM (6ED1052-1xxx08-0BAx) use AI1 or AI3 (the 0-10 V inputs). Do not use I7 (AI5 on some BM variants is shared with I7 digital input and is only 0-10 V on specific modules). Confirm in the BM data sheet.
- Build the preamp board. Assemble the three op-amp stages on a small PCB. Use a dedicated 24 V to 5 V DC-DC converter (RECOM R-78E5.0-1.0 or equivalent) powered from the LOGO! 24 V supply rail to keep the analog section galvanically isolated from the LOGO! internal SMPS noise.
- Wire the microphone. Run a shielded two-conductor cable from the electret capsule to the preamp. Connect the shield to GND at the preamp end only. Keep cable length under 10 m; for longer runs use a balanced dynamic mic with a transformer (e.g., Neutrik NTE-1) at the cabinet end.
- Set the sensitivity. Apply a continuous test tone (1 kHz sine from a smartphone app or signal generator) to the capsule at -20 dBFS reference. Adjust R14 until the LOGO! AI1 reads ~5 V (500 in scaled units). Verify the maximum undistorted envelope is < 9.5 V.
- Connect AI1 to a LOGO! program. Drag the Analog Input block onto the schematic and select Sensor type: 0-10 V. Drag the Analog Threshold (AT) function block, set On threshold = 600, Off threshold = 400. Reference the LOGO! manual chapter on Analog Threshold Trigger for the full parameter list.
- Wire AT output to the load. In a light organ, AT output drives Q1 (digital output) which toggles a Q-tag or directly a 24 V relay. For classroom alarm, AT output drives an OR gate with a self-holding SR latch so a single clap triggers a sustained Q1 until reset.
- Add hysteresis and a debounce. With τ = 47 ms the AT block may bounce on a sharp transients. Insert an On-Delay of 50 ms after AT to suppress sub-50 ms spikes, and an Off-Delay of 200 ms so a single beat holds long enough to drive a relay reliably.
LOGO! Programming for Audio Threshold Detection
The minimal program requires three blocks: AI (Analog Input), AT (Analog Threshold), and a digital output. In LOGO! Soft Comfort:
- Add Analog Input block, connect to AI1, sensor type 0-10 V, smoothing none.
- Add Analog Threshold block: gain 1.0, On threshold = 600 (6.0 V), Off threshold = 400 (4.0 V). This is the AT hysteresis window.
- Wire AT output → On-Delay 50 ms → Off-Delay 200 ms → Q1.
- For multiple output patterns (bass vs. treble), build a second channel: duplicate Stages 1-3 tuned to a different frequency band using a band-pass filter (two RC sections: high-pass at 300 Hz followed by low-pass at 2 kHz) feeding AI2, and a second AT block with independent On/Off thresholds driving Q2.
A typical light-organ program uses four AT blocks: one for bass (filtered below 200 Hz), one for low-mid (200-800 Hz), one for treble (above 2 kHz), and one for overall envelope. Each AT drives a separate Q output. Pattern sequences are built with shift registers or simple sequencer blocks; an SR latch can hold the most-recent beat for visual effect.
For alarm use, replace the Q output with a self-holding relay latch:
AT (AI1 > 600) → RS latch SET
RS latch output → Q1 (buzzer)
Operator acknowledge button → RS latch RESET
Signal Conditioning and Noise Considerations
Once a prototype works on the bench, field installations expose the design to 50/60 Hz mains hum, RF from classroom Wi-Fi, switching noise from the LOGO! 24 V SMPS, and ground loops between cabinets. Apply the following countermeasures systematically:
- Add a 100 nF X7R decoupling capacitor across each op-amp supply pin and within 5 mm of the IC.
- Insert a 10 mH common-mode choke (Wurth 744242110 or equivalent) in series with the microphone cable.
- Use a balanced mic input for cable runs > 10 m: a small instrumentation amp (INA217, INA128) converts the balanced feed to a single-ended preamp output. The shield is grounded at the cabinet end only.
- Add a TVS diode (5 V SMAJ5CA) and a 100 Ω series resistor at the LOGO! AI pin. This protects the LOGO! analog front end against ESD events from a student touching the microphone grille.
- Power the preamp from a separate 24 V to 5 V isolated DC-DC converter. Sharing the LOGO! internal 5 V rail couples every output relay transition into the microphone signal.
- Star-ground the analog section. The preamp 0 V, the LOGO! supply GND, and the cabinet chassis ground must meet at a single point, typically the LOGO! GND terminal.
For light-organ applications driving triac-based Christmas lights or LED strings, place the AT block's output debounce ahead of any solid-state relay (SSR). A 3-30 VAC/DC input, 100-230 VAC output SSR (e.g., Crouzet 84-851, Finder 55.34) is sufficient for the LOGO! 24 V Q output. Drive the SSR from a Q-tag, not directly from AT, so the OFF delay holds the SSR closed during zero-crossings.
Multi-Channel Separation (Bass/Treble)
Two-channel separation (e.g., bass channel driving one relay, treble channel driving another) is implemented by feeding two parallel filter paths into two LOGO! analog inputs:
Stage 1 preamp output (mono mix)
|
+------ C6 100 nF --- R16 10 kΩ --- AI1 (bass channel, < 200 Hz)
|
+------ C7 100 nF --- R17 10 kΩ --- AI2 (mid channel)
|
+------ C8 10 nF --- R18 10 kΩ --- AI3 (treble channel, > 2 kHz)
|
Each output is then rectified, smoothed, and scaled independently to fill 0-10 V.
Use Sallen-Key or Multiple-Feedback topologies for steeper filter slopes when music content requires cleaner band isolation. For a 200-school deployment, leave a small 6 dB headroom above the expected maximum beat level so the LOGO! AT block does not saturate at the 10 V ceiling.
Verification and Calibration
After the program is loaded and the hardware installed, verify with the LOGO! onboard display or LOGO! Soft Comfort online mode:
- Confirm AI1 reads between 0 and 50 (0.0-0.5 V) in a quiet classroom. If not, check for 50/60 Hz hum pickup or a missing shield connection.
- Speak at normal classroom volume (~65 dB SPL at 1 m) and verify AI1 rises to 400-700 (4.0-7.0 V). If the reading is too low, increase R14 (preamp gain). If clipping at 1000, reduce R14.
- Clap hands once 1 m from the mic and verify AI1 peaks at > 850 (8.5 V) for at least 100 ms. The AT block should fire and the relay / Q output should latch.
- Disconnect the mic and short the AI1 input to GND. AI1 should read 0. If it reads more than 20 (0.2 V), there is a ground loop or preamp offset that must be trimmed.
- Run the program for 24 hours with continuous background classroom noise. The relay must not self-trigger. If it does, raise the AT On threshold from 600 to 700.
Bill of Materials (per classroom)
| Item | Part | Qty | Approx. cost (USD) |
|---|---|---|---|
| LOGO! 8 BM with display | 6ED1052-1CC08-0BA1 | 1 | 130 |
| 24 V DC supply (shared) | Siemens LOGO! Power 6EP1331-1SH03 or 3rd-party 24 V 2.5 A DIN rail PSU | 1 | 35 |
| Electret capsule | 9.7 mm 2-terminal, e.g., CMA-4544PF-W | 1 | 2 |
| Op-amp IC | TLV2372IDR (dual, RRIO) or LM358N | 1 | 1 |
| DC-DC 24 V → 5 V isolated | RECOM R-78E5.0-1.0 or Mornsun B0505S-1W | 1 | 4 |
| Resistors / capacitors | 1 % metal film, X7R ceramic, 10 V electrolytic | set | 3 |
| 100 Ω + TVS protection | SMAJ5CA + 100 Ω 1/4 W | 1 | 1 |
| Solid-state relay (load) | Finder 55.34 24 V DC coil / 230 V 6 A | 1 | 10 |
Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
| AI1 always reads 0 | Mic capsule not biased; no DC supply to preamp; shield short to signal | Verify 2.2 kΩ bias resistor to 5 V; check 24 V rail; inspect shield continuity |
| AI1 reads 1000 (clipped) at rest | Preamp output saturated; VCC/2 mid-rail sagged; op-amp supply reversed | Check polarity of op-amp supply; verify mid-rail buffer; reduce R14 gain |
| AI1 jitters with classroom lighting | RF pickup from LED-driver PWM or fluorescent ballast | Add common-mode choke on mic cable; add 100 nF across AI1 to GND |
| Relay chatters at 50 Hz | 50/60 Hz mains hum reaching AI1 | Improve shielding; check shield grounded at one end only; increase RC smoothing to τ = 220 ms |
| No response to claps but voice works | Clap has fast transient; AT hysteresis window too wide | Reduce AT On threshold from 600 to 500; add 50 ms On-Delay instead of widening hysteresis |
| Output latches on first trigger and never resets | SR latch wired without acknowledge path | Add operator pushbutton to RS latch RESET input; check LOGO! program for unintended self-hold |
| All 200 units behave differently | Potentiometer R14 set by ear, not by calibration | Drive 1 kHz sine at -20 dBFS into each mic; set R14 for 5.00 V ± 0.05 V at AI1 |
Safety and Installation Notes
Although the analog interface itself operates at safe extra-low voltage (SELV, < 50 V AC / 120 V DC), the typical load (Christmas lights, classroom siren, signalling relay) often switches 230 V AC. Follow local wiring regulations (e.g., NEC in the US, IEC 60364 in the EU, AS/NZS 3000 in Australia):
- Install a 6 A MCB upstream of any 230 V load wired through the SSR.
- Maintain > 6 mm creepage and clearance between the 5 V analog section and any 230 V wiring on the PCB.
- Use a certified SSR with built-in zero-cross switching for AC loads to limit inrush current.
- Mark the cabinet with a warning label that microphone-driven outputs are not safety-rated; they must not be used as the sole protective interlock on machinery.
FAQ
Can I connect an electret microphone directly to a LOGO! 0-10 V input without an amplifier?
No. A direct electret output is typically 5-50 mV, well below the LOGO! 100 mV minimum resolution. The AT (Analog Threshold) block will never trip, and the AI value will sit at 0. A preamp stage with at least 100x gain is mandatory.
Which LOGO! analog input should I use for microphone audio?
Use AI1, AI3, AI5, or AI7 on a LOGO! 8 BM (6ED1052-1xxx08-0BAx), or AI5-AI8 on an AM2 expansion (6ED1055-1MA00-0BA2). These are the dedicated 0-10 V inputs with 72 kΩ impedance. Avoid using I7 as analog input unless the BM variant explicitly lists AI5 - it is digital-first on most variants.
How do I trigger a LOGO! from a speaker-tap instead of a microphone?
Tap the speaker terminals through a 10:1 resistive divider (e.g., 100 kΩ + 10 kΩ) and clamp with two back-to-back 5.1 V Zener diodes. The audio envelope will be 1-10 V at the divider output - well-matched to the LOGO! 0-10 V range. This is the same topology used in commercial light organs and avoids microphone hum in stage environments.
What AT (Analog Threshold) values should I use for a classroom clap detector?
Start with On threshold = 600 (6.0 V) and Off threshold = 400 (4.0 V) on the AT block. Add a 50 ms On-Delay and a 200 ms Off-Delay after AT to suppress sub-100 ms transients. Calibrate by clapping 1 m from the microphone and adjusting the preamp gain so the peak reads 8-9 V at AI1.
Can I separate bass and treble channels on a single LOGO! for a light organ?
Yes. Filter the preamp output with two RC band-pass networks (e.g., R-C high-pass at 200 Hz and R-C low-pass at 2 kHz), feed each into a different LOGO! analog input, and assign one AT block per channel. The bass AT drives one Q output, the treble AT drives another. Pattern sequences are built from these two Q outputs in a small sequencer section of the LOGO! program.