an active LED-LDR volume control featuring in-situ LDR monitoring

Status
Not open for further replies.
I thought that the DC current was just to measure the LDR resistance, but volume control would be via an LED? If so, you only need change the DC current very slowly. At worst you might get a few seconds of poor channel balance after a volume adjustment. Also, make sure the audio response has a respectable LF rolloff, rather than the modern fad of going down to earthquake frequencies.

You are correct in that the LDR (resistance) is controlled by LED current in the device. Driving the LED is pretty straightforward and in not part of the audio path, so I didn't draw it in the schematic. The LDR (resistance) is what is in the audio path, as part of an inverting gain stage. The idea was to change the LDR resistance to change the gain, but to ride DC on top of the audio signal and monitor the DC voltage drop across the LDR to probe its resistance. The audio signal is AC coupled.

The nature of the problem is similar to what happens with any "DC blocking capacitor" (which is why I think that people overstimate their ability to protect downstream elements). Any DC blocking capacitor is in a series position, with a resistive load (for simpllification let's just assume resistance here) in the shunt position. The two together are forming a high pass filter, blocking "DC". This is true, and under steady state DC applied to the capacitor terminal (in side OR outside) nothing is happening - you get zero output voltage.

What most people don't realize is that if there is a step change in the DC voltage this generates a large pulse in the output - it's essentially the "step response" of the filter. The amplitude of the pulse can be rather large, which I think many people forget about. The reason for this is that the "step" function of the input in the Fourier sense contains lots of higher frequency components (than DC) which can be passed by the filter, resulting in filter output. Many people know that a square wave has lots of high frequency components, and a step is like 1/4 cycle of a square wave. This page give some very good examples of the output of an HP filter to a step response:
RC High-Pass Circuit - Applications, RC high pass as differentiator
Like this:
An externally hosted image should be here but it was not working when we last tested it.


Moreover, because the LDR resistance is changing, the time constant of the HP filter (or corner frequency is you prefer to think of that domain) is also changing when the LDR resistance changes. This is probably not helping the situation...

In my circuit, with DC current used to probe the LDR resistance, some DC voltage drop is generated across the LDR. When the LDR resistance is changed this voltage also changes - that is the desired behavior afterall. But this is like stepping the DC voltage in my example above, and this causes the same large pulse to be generated at the output. There is absolutely no way around it - this is simply a property of the filter itself.

It would be possible to change the control slowly, but you would be surprised at just how slowly you would have to change the LDR resistance! Even with slow changes there will still be a response generated at the output of the filter. For instance I swept it from min to max resistance over 1 second and the pulse was HUGE, several volts. When you want to turn up or down the volume on your stereo, are you willing to wait 10 seconds? 30 seconds? I don't think so.

So, the DC biasing approach just won't work.

I will do some more simulating of the approach that uses the Wheatstone bridge and post my thoughts and the circuit here later.
 
Last edited:
Actually, the Wheatsone bridge approach only works when the LDR resistance is below about 50k. Above that the accuracy requirement of the voltage measurement is just getting a bit too high to be practical.

Well, there is always the voltage divider approach, and that goes like this:
put a known, low-value, stable resistance in series with the LDR, say 1k. This, and the LDR (one terminal of which is connected to a virtual ground at the op amp inverting input) form a voltage divider. You simple measure the voltage to ground across both the 1k and LDR resistances, and only across the LDR itself. This is all the info you need to determine the LDR resistance. By keeping the LDR resistance to 100k or below you have enough sensitivity in this approach, and if the measurement is off as the LDR resistance approaches 100k that's no big deal because there is a huge amount of attenuation at this point (remember that we can get 80 dB of attenuation using two gain stages in series).

Again, what is nice is that the LDR resistance can be measured in this way just by using the audio signal iself to pass voltage through the system, or you can add some other signal that is outside of the audio band (e.g. 1Hz) or do that only in the absence of the regular audio signal, it being filtered out by a HP filter.

The trick would be to sample at both points in the circuit SIMULTANEOUSLY, which is not possible for the Arduino directly. It has to sample at one input pin, switch the pin, let the ACD settle, and then sample again.

The solution would be to use a multichannel ADC that has simultaneous sampling+hold for its channels. One such device is this:
http://www.analog.com/media/en/technical-documentation/data-sheets/AD7865.pdf
It has 14 bit resolution.

Still, for highly attenuated signals you would need some kind of amplification to increase the signal magnitude...

In any case, I don't plan to investigate this any further. It's just getting too complicated! I thought I'm not sold on LDRs myself, but I thought I had a neat idea when I started this thread about the DC biasing.

Frankly I have a nice mature project with PCB that I designed that has a 4-channel VCA onboard (Coolaudio V2164D) that can easily be controlled by the Arduino and has pretty good performance. I thought I could adapt some of the preamp interface I wrote, but it's not really worth it at this point.
 
Status
Not open for further replies.