A precision LED/LDR-based Attenuator

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Sorry. I hope I didn't open too many new cans of worms, for you. Just trying to help. As with many things, sometimes they're significant-enough to worry about and sometimes they're not. If I'm doing a new design and the effort or expense would be about the same either way, I try to preclude those types of potential problems as a matter of habit ("best practices", and all that). But now that it would involve making changes, it's a matter of your own tests and measurements, and judgement, or maybe whether or not problems (or even anything noticeable at all) occur in the actual hardware.
 
An improved board, still 2.5" x 3.8":

Separate regulators completely separate the analog (LDR) power supply from the digital power supply. Separate analog and digital grounds meet only at the power input electrolytic capacitor C1, and the ground plane also is connected to power ground only at C1. Signal ground is completely isolated from power ground, and is a simple pass-through of source ground to output ground.

This circuit employs no digital signals outside the control chip -- no PWM and no rapidly switching levels whatsoever, all control is accomplished by analog voltage level. Control voltages to the mosfets will go high or low to reach proper level to drive the LDR accurately, but then change minimally, with only an occasional instantaneous 'bump' of the control voltage to the mosfets to keep voltage to the LDRs stable and accurate.

C16 is a .1uF chip ceramic connected directly across the power pins of IC3,and nests within the IC socket.
 

Attachments

  • ScreenShot002.jpg
    ScreenShot002.jpg
    242.2 KB · Views: 709
Finally, the chip I've been waiting for -- it should be perfect for this application.

1. Small (14-pin), cheap and quite fast (32MHz).
2. Performs virtual multi-tasking in software.
3. Externally adjustable ADC Vref+.

This means that I can use a separate chip for each audio channel, and each chip controls only two LDR devices with each device's control occurring simultaneously (multi-tasked) in separate virtual tasks.

An externally settable Vref for the ADC pins will allow the chip's ADC steps to be compressed into just the voltage range required for the application, and there will be many fewer "wasted" steps outside of the required control range (200~250 more control steps into the useful range). This will permit finer control of current through the LEDs. The addition of external Vref low would have been nice, but not as important.

New approach is to design per-channel boards with a separate power supply providing power to multiple boards. First boards are 1" x 3.5"
 

Attachments

  • ScreenShot004.jpg
    ScreenShot004.jpg
    79.4 KB · Views: 590
I'm too lazy to re-read the whole thread.

But what about the input and output impedances? Have you plotted the input and output impedances versus the volume setting?

What make and model of LDR device are you going to use? If I had their R vs I response curve and the current range you plan to use (or could use), I could simulate them and plot the impedances.

There is a way to use a couple more resistors to make the impedances stay a lot more constant as the volume changes. But I'm wondering if you'd want to consider having optional input and output buffers, possibly on a different board.

I was also thinking that you might want to leave some space and possibly have some pads in place in case you find out you want to have some additional low-pass RC filtering for the LDR diode feeders. But that can wait until you see if it's needed, I guess.
 
I'm too lazy to re-read the whole thread.

But what about the input and output impedances? Have you plotted the input and output impedances versus the volume setting?

What make and model of LDR device are you going to use? If I had their R vs I response curve and the current range you plan to use (or could use), I could simulate them and plot the impedances.

There is a way to use a couple more resistors to make the impedances stay a lot more constant as the volume changes. But I'm wondering if you'd want to consider having optional input and output buffers, possibly on a different board.

I was also thinking that you might want to leave some space and possibly have some pads in place in case you find out you want to have some additional low-pass RC filtering for the LDR diode feeders. But that can wait until you see if it's needed, I guess.

Input and output impendance:

I have calculated the series and shunt resistances at 1/2db intervals so that the overall system presents a constant 5K system Z from about .5db minimum attenuation to a maximum of 42db. At .5db attenuation it's 280 ohms series and 84K ohms shunt; at 42db it's 4960 ohms series and 40 ohms shunt. I could bring the range to 48db by paralleling two shunt LDR devices for total 20 ohm shunt impedance but that would require matching LDRs at 40 ohms. We could also get 48db of attenuation by allowing the system Z to rise to 10K over the upper one-third of the attenuation range. I can actually control LDR resistances well beyond 84K ohms, but at 150K the control becomes pretty loose due to the extremely small current involved. I plan to experiment a little to see if a resistor in parallel with the LDR to raise the minimum control current through the mosfet won't give the mosfet a better grip on the resistance at that end of the spectrum. I expect control to improve quite a lot with the "recovery" of about 200 steps of ADC using the external Vref+.

Model of LDR device:

All of my experimenting has been with the Silonex device used in the Lightspeed. I've looked at the Fairchild devices, but minimum impedance seems quite a bit higher so will stick with the Silonex for now.

Input/Output buffer:

If someone wants those, it'll be up to them to implement them. I am after an LDR control that uses sophisticated control techniques to yield a simple and totally clean fixed-Z attenuation device.

Low pass LC filtering on LDR diode feeders:

Not sure where you are talking about putting those. The control of the mosfets is effectively DC, with only an occasional tiny 'blip' visible on the most sensitive setting on my HP scope once the voltage on the gate of the mosfets has been servoed to the proper level.

I need to order some of the chips (brand new on the market) to verify, but the features I've been wanting are suddenly all there. This chip will either make the project move faster or, if it doesn't do the job, I'll give up on it.
 
Last edited:
What is your "system Z"?

The attenuator has an input impedance that is seen by the Source as a Load.
The attenuator has an output impedance that is seen by the Receiver as a source impedance.

At -0.5dB the input impedance is 84k28 (84k + 280r)
and if Rs is 200r then the output impedance is 477r (84k//[280+Rs]).

@-40dB the input impedance is 5k (4k96 + 40r)
and the output impedance is 39r7 (40r//[4k96+Rs]).
Only one of these 4 limiting values gets to 5k. What are you trying to achieve?
 
Last edited:
Andrew, of all the pieces of the puzzle I'm working with, the desired resistance values for the optimal control are the most difficult for me as I'm just getting started in calculating values for audio circuits. I haven't worried about it much because once I gain the kind of control I'm looking for and the practical aspects of controlling multiple LDRs simultaneously are dealt with, then it will be time to design the resistor values and that time hasn't come yet.

If you were king and could have anything you wanted, what would the resistance values of the optimal completely passive (no buffer) control look like given the constraints I list below? What would the input and output impedances look like? For planning the resistor values, I'd like to see resistor values at 1/2 db per step attenuation.

I can drive the LDRs to any value at any slope between values, and I can set the series and shunt LDRs completely independently of each other to any value within the 'doable' control range. The bottom of the range is 40 ohms for each LDR value, and (roughly speaking) anything up to 50K would be great, up to 100K doable, and up to 150K difficult.

Do you have a series of formulas I could plug into a spreadsheet? That would make my life easier, but I still need to find out what input and output impedances would be satisfactory for the greatest number of source/load situations.
 
Generally, you'd want the output impedance to be very low and the input impedance to be high, but maybe not "too high".

The other pieces of equipment that are connected to your attenuator will have their own output impedance (connected to your input) and input impedance (connected to your output). Those input and output interconnections will each act like a voltage divider.

So if your input impedance is too low, relative to their output impedance, the loss of signal level might be significant. Also, for low attenuator input impedances, their output might not be able to drive enough current at the voltages it's trying to produce.

Similarly, if your output impedance is too high, relative to their input impedance, signal level loss might be significant.

Another consideration is that there will also be capacitance and inductance facing both ends of the attenuator, in the interconnects or in components in the source or receiver or both in the interconnects and in actual components. And the attenuator's input and output impedances (mostly resistances) will always interact with those inductances and capacitances, resulting in a particular "transfer function" for that portion of the signal path (i.e. output circuitry, cabling, attenuator, cabling, input circuitry).

A transfer function describes the frequency response (gain vs frequency and phase vs frequency) through a linear time-invariant system and completely defines the system's transient and steady-state characteristics.

i.e. The attenuator's input and output impedances can cause changes in the gain and phase angle of the signal, versus frequency, when ideally you would want either no change at all or a change that is exactly constant versus frequency.

The only example that comes to mind at this hour is when the output impedance is too high. In that case, it could interact with cable capacitance, and/or an existing RC low-pass filter in the other equipment's input circuitry, to either create a low-pass filter or lower the cutoff frequency of an existing low-pass filter, possibly affecting the sound.

Additionally, it seems like it would be a really good idea to keep the attenuator's input and output impedances as constant as possible, so that the frequency response of the system wouldn't change as the volume control is changed.

Yet another separate consideration is resistor noise. All resistances generate noise, all by themselves. The higher the resistance, the more noise is generated. So lower resistances are better (as are lower currents and voltages, as it turns out), except when it makes the input impedance too low. Here is an interesting article about the different types of resistor noise, in guitar amplifiers: Resistor Types--Does It Matter? . In low-noise circuits, I try not to use resistors above 10k Ohms, and usually use much smaller ones if I have that luxury. But for an attenuator you might want the input impedance to always be more than that, for example.

Obviously, there are trade-offs to consider. I'm sure that someone will come along and give you some typical "ideal" values of input and output impedances for audio system components. You might even want to have different operating modes available for solid state and tube interconnects, for example.
 
Last edited:
Making a little progress:

1) Multi-tasking turned out to be a red herring. The chips won't run at full speed during multi-tasking, and other issues arise as well, so I'm sticking with single-task structure.

2) Switching to multi-turn pot for better control over setting regulator voltage and for setting external Vref for the ADC ports on the chip.

3) Increasing the mosfet gate control current limit resistor value from 1 meg ohm to 3 meg ohm to get finer control of steps up and down on the gate. Right now, a single minimum duration corrective pulse moves the level at the mosfet gate too far. Increasing the resistance will reduce the amount of correction applied in one step. The alternative was to increase the capacitance of the capacitors which would either make them physically much bigger and more expensive or force a switch from metal film to tantalum, and I don't like either alternative.
 
In case anyone is curious, this is my latest board with Alps motorized pot (drawn to scale).

Board will include IR receiver and a second board will carry the H-bridge controller for the Alps. H-bridge is a single 16 pin IC, almost no support required except for regulator. The motor will have it's own voltage regulator, but will draw power (100ma when running) from the 12V 1A wall wart.

In process.

Renumbering of components not complete, so don't criticize that!

Circuitry for the IR receiver and H-bridge not drawn. The IR will be only for volume UP/DOWN, nothing else. Later it won't be difficult to add another larger board for input switching tasks.

Control code is working very smoothly. LDR becomes difficult to control above about 50K due to the very low current requirement, but at 10K it is very steady. Control is so fast that adding control of a second LDR device as a simultaneous task won't make any difference at all.

I will use a separate chip for the IR receiver and H-bridge control.
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    172 KB · Views: 579
Wapo54001,

I truly LOVE using audio equipment with remote-controlled motorized pots. Great idea!

Judging by the nearly-instantaneous evolution of your board layout skills, I believe that you are a very good and fast learner, and could go far and do well. (Or maybe you already have. :)

If you don't mind, what is your age, and background? If you are still young, what are your intentions, so far, for the rest of your life?

Sorry about the non-technical quesions. But I'm old-enough, now, at age 54, to just ask what I want to ask. I finally realized that "Life is too damn short" to be hesitant or reticent, any more. (Too bad I didn't know that well-enough when I was younger...!)

By the way, if you are relatively young, or even if you are not, I hope that you will look at the world-famous Jan Didden's blog (or whatever it was) about engineers and communication skills, to which I contributed. The main point was that interpersonal communication skills are AT LEAST as important, for engineers (and others who are similar), as are technical skills. I'm only mentioning this because you seem like you might be one of the ones who is "worth saving". Go, NOW, and read it(!):

http://www.diyaudio.com/forums/blogs/janneman/297-dont-such-scientist.html

Regards,

Tom Gootee
 
Last edited:
If you don't mind, what is your age, and background? If you are still young, what are your intentions, so far, for the rest of your life?

I am retired Air Force. During Viet Nam, I was a pilot. Afterwards, I became an air traffic control officer and part-time pilot and managed ATC facilities. Later, I commanded communications and computer systems organizations (because in the Air Force, comm, computer, and ATC are combined together). Am now 66 and in my dotage. My intentions, so far as they go, is to stay above ground for as long as I can, and play with electronics and my toy airplane. :)
 
Wapo54001,

I truly LOVE using audio equipment with remote-controlled motorized pots. Great idea!

Judging by the nearly-instantaneous evolution of your board layout skills, I believe that you are a very good and fast learner, and could go far and do well. (Or maybe you already have. :)

If you don't mind, what is your age, and background? If you are still young, what are your intentions, so far, for the rest of your life?

Sorry about the non-technical quesions. But I'm old-enough, now, at age 54, to just ask what I want to ask. I finally realized that "Life is too damn short" to be hesitant or reticent, any more. (Too bad I didn't know that well-enough when I was younger...!)

By the way, if you are relatively young, or even if you are not, I hope that you will look at the world-famous Jan Didden's blog (or whatever it was) about engineers and communication skills, to which I contributed. The main point was that interpersonal communication skills are AT LEAST as important, for engineers (and others who are similar), as are technical skills. I'm only mentioning this because you seem like you might be one of the ones who is "worth saving". Go, NOW, and read it(!):

http://www.diyaudio.com/forums/blogs/janneman/297-dont-such-scientist.html

Regards,

Tom Gootee

I second Tom based on my experience. It is actually easy to do well in this world and not be as smart or good at what you do. I say this to convey the point that many smart and great people do not do as well as they could and the world loses.
If I may for the ambitious ones out there, and the ones who would like to make this a better place.
To excellent books to read.
1. Executivel EQ
2. Outliers.

Gives you a sense of what can be achieved.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.