Electronic – Decaying envelope when audio passes through diode

amplifierdiodesled

This is a basic question about passing AC (audio) signals through a diode. I'm trying to use an audio signal to power an LED (which in turn heat-shrinked to an LDR) in order to control the behaviour of a simple audio oscillator. At the moment I'm simply passing the audio input signal through a 1k resistor that's in series with the LED – this is working, but it has the annoying feature that the amplitude of the audio signal (and hence the brightness of the LED) decreases over time, over a period of several seconds.

The same thing happens when the signal passes through an ordinary diode, such as a 1N4002 – the signal starts loud, then decreases over several seconds. Here's a screenshot of the output seen when a sine wave (around 70 Hz) is passed through a 1N4002 – as expected, the output is rectified, but has a decaying envelope.

70 Hz sine wave through 1N4002

Why's this happening, and is there a way to power an LED (such that its brightness follows the amplitude of an audio signal) where this effect won't happen?

EDIT: here's an incredibly crude diagram of what I'm up to – I'm sending a sine wave from an output of my computer's soundcard to a breadboard, putting a diode in series with the signal, and recording the output from the diode back into the computer.audio through diode diagram

EDIT: Here's an image of the output waveform when a 100 ohm resistor is put between the output of the diode and ground, as per Kaz's answer below. When the output is goes directly into a pair of headphones instead of the computer, the effect is much less pronounced but still audible, suggesting that the problem lies partly with the computer's audio interface.
enter image description here

EDIT: There's no obvious frequency dependence – here are the recorded waveforms of:

  1. A 1k sine wave without the diode in place (i.e. just recording the output back into the computer)
    enter image description here

  2. A 1k sine wave with the diode, as in the diagram above. The signal is attenuated and has the same decay envelope. The same general shape is seen for frequencies going from 50 Hz up to 8k.
    enter image description here

Best Answer

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. (a) Reverse conducting diode. (b) Symmetrical LED.

The problems seem to be caused by the asymmetrical current path caused by the in-line diode. Since you are using and LED to LDR opto-isolator you can use the LED as the rectifier. Figure 1a shows the circuit with D2 providing protection for reverse voltage (since the audio signal is AC).

Figure 1b shows a pair of LEDs in back to back arrangement. This has the advantage of symmetrical loading of the AC. If you can find a package with both LEDs mounted back to back (internally) it means your LDR will be illuminated on both positive and negative audio signals. Failing that you could try to mount both LEDs on the one LDR or use circuit of Figure 2a.

schematic

simulate this circuit

Figure 2. (a) Pair of opto-isolators with parallel LDRs. (b) Bridge rectifier feeding LED.

For completeness, Figure 2b shows one LED fed by a bridge rectifier. This has the disadvantage of higher voltage drop due to two series diodes at all times.

Related Topic