A precision LED/LDR-based Attenuator - Page 19 - diyAudio
Go Back   Home > Forums > Source & Line > Analog Line Level

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 29th May 2012, 08:22 PM   #181
diyAudio Member
 
Join Date: Nov 2008
Quote:
Originally Posted by gootee View Post
wapo54001,



That same flood-fill could also basically eliminate the effects of sharing the single "current out" trace by currents from multiple LEDs, which would probably be a good idea, so that the distributed voltages induced along the traces (which would basically appear back at every LED cathode) by current from one LED, flowing through the trace impedance, wouldn't affect another LED, and using more of a plane would also minimize the effect of each LED's own current on its own downstream voltage, which overall would present a more-constant "ground" voltage to the more-negative end of each LED.


Cheers,

Tom
Tom, please look at the schematic with the planes removed.

You can see that there is a star ground with individual parts of the circuit grounded directly to a single point, which is the main capacitor on the output of the regulator. I've tried to avoid having various currents interfere with other parts of the circuit. The PIC has it's own ground, the analog op-amps have their own ground, the LDRs have their own ground, the status LED has it's own ground (and the LED will change state (flash) only when the PIC is actually moving the input to the op-amps. When the op-amp input is steady, the LED will always be steady and no abrupt current changes will occur..

On each channel, all LEDs will spend most of their time consuming maybe a single milliamp or two per R1 and R2 leg, given typical listening levels. At the worst, only one leg will be at 'full power' which will be somewhere between 5ma and 10ma. So, total maximum current consumption per channel is 10ma.

So, having seen the details, are you still concerned about ground circuits?

Second, will you please be much more explicit in what you are talking about with regard to Zin and Zout? I'm not sure how I can control that except by changing the resistance value of the simulated potentiometer. Is there something that I'm not seeing?

Thanks for your comments.
Attached Images
File Type: jpg ScreenShot013.jpg (324.9 KB, 422 views)
  Reply With Quote
Old 30th May 2012, 07:11 AM   #182
gootee is offline gootee  United States
diyAudio Member
 
Join Date: Nov 2006
Location: Indiana
Blog Entries: 1
Quote:
Originally Posted by wapo54001 View Post

<snipped>

Second, will you please be much more explicit in what you are talking about with regard to Zin and Zout? I'm not sure how I can control that except by changing the resistance value of the simulated potentiometer. Is there something that I'm not seeing?

Thanks for your comments.
Background:

Zin and Zout are the input and output impedances of the two-port attenuator network.

Ideally, Zin would be very high and Zout would be very low, so that they would cause minimal adverse effects when combined with the source and the load.

With a DC-type device, such as this, you could measure the input impedance, Zin, by connecting a fixed-value constant current source across the input terminals, and connect a representative load resistance across the output terminals (repeating the entire test for various different load resistances, e.g. maybe 10k, 20k, 50k, 100k, 1Meg.), and then measure and record the voltage across the input terminals as the attenuation was varied from minimum to maximum. Make sure that you go slowly, to allow the LDR response to stabilize at each level to be measured. Then you would plot the measured voltage across the input terminals, divided by the amplitude of the current from the current source that was applied between/across them, versus the attenuation control setting.

With that setup, it would probably also be a good idea to plot the output voltage divided by the input voltage (the gain), or, the attenuation, versus the attenuation control's setting.

I use a constant current source, for the above, when doing simulations. But on a test bench I don't see (at least not at this hour) why you couldn't just use a DC voltage source with a series resistance, instead, even if it sagged. It seems like the ratio of the voltage to the current should still always be the correct input impedance, at each attenuation control setting, as long as the internal voltages and currents always stayed within the LDRs' normal limits. Maybe you could just try some different series resistances, to see if it made a difference.

NOTE that you would need to measure both the current and the voltage, if the source was not guaranteed to be absolutely constant at a fixed value (and you might as well assume it's not, in any case).

To measure the output impedance, Zout, you would connect a resistance across the input terminals (probably repeating the testing with various resistances, to simulate different source resistances, e.g. 0 Ohms to several kOhms). You would disconnect any load resistance and connect a fixed-value constant current source between the output terminals. Then measure and record the voltage across the output terminals as the attenuation control is varied from minimum to maximum. Then plot the voltage divided by the current versus the control setting. (Previous comments about the actual source used for bench testing might apply.)

Concerns:

Without buffers, the input and output impedance of a series/shunt attenuator vary, when the attenuation is varied.

The maximum of the series and shunt resistances is usually the largest determining factor in the ranges that the input and output impedances can have.

If you imagine a simple case where the two resistances change linearly as the volume control is varied from min to max, such as from 10k to 0 Ohms for the series element as the shunt element goes from 0 Ohms to 10k Ohms, you can probably see that the output impedance is basically their parallel combination (assuming an ideal source impedance of zero Ohms). So the output impedance would vary from zero to a maximum of 5K || 5K (i.e. 2.5k) and then back to zero.

A lower output impedance is better, so the lower the maximum resistances of the series and shunt elements are, the better, since that would mean a lower maximum Zout (the parallel combination of 1/2 of each element's maximum value) at the midpoint of the volume control's travel.

Unfortunately, the input impedance would be better-behaved if the maximum resistances of the series and shunt elements were as high as possible. Zin is basically the series combination of a) the load impedance in parallel with the shunt element's resistance, and, b) the series element's resistance. At minimum volume setting, Zin will start at about the series element's resistance. Then as the shunt element's resistance comes up, as the volume is increased, and the series element's resistance decreases, the input impedance will tend to slope downward, until, at max volume, it's equal to the shunt element's maximum resistance in parallel with the load resistance. That value is pretty-much guaranteed to be less than the maximum shunt element resistance, since it would be in parallel with the load resistance.

It seems like 10k Ohms is a good minimum input impedance, if you want to be able to handle tube amplifier outputs as the source (although 20k or more would be better). But if you have a 10k input impedance as your load, then your input impedance, with a 10k max shunt resistance, will go down to 5k Ohms, at max volume.

That should be OK for most solid state sources' output impedances, and probably more-or-less OK for anything with up to 500 Ohms or so, although I might want to stick with 50 Ohms or less for the source impedance if I was trying to drive 5k Ohms.

Also, at the same time, the output impedance will peak at 2.5k Ohms, at mid-volume. That's pretty high and the amp being driven should probably have 10x to 100x that much as its input impedance; so 25k Ohms, or maybe much more.

Anyway, those figures were for linear resistance profiles, which are probably not the optimal profiles. For example, if the resistance curves were a little-bit "concave-upward", sagging a bit where they intersect at the mid-volume setting, then you should get a lower maximum output impedance, which would be better. If you let the shunt element have a higher maximum resistance, you might get a better (higher) minimum input impedance at maximum volume. Note that each of those would also affect the overall gain profile (as plotted versus the volume control setting). But you will probably want to play around with the resistance profiles, in order to try to get the best combination of minimum input impedance (the higher the better) and maximum output impedance (the lower the better). I guess that, generally, raising the maximum element resistances while letting their response curves sag more where they cross could improve things, especially for Zout, up to a point. And I like the idea of a higher max resistance for the shunt element but I haven't actually tried it, or even thought it through. But if it works then it might solve part of the Zin problem, so that maybe you could keep it from going below 10k Ohms. Unfortunately, that will probably prevent you from being able to get to max volume. There are definitely trade-offs to analyze.

Idea: Maybe you could have three switchable modes, so that users could select either better input impedance, better output impedance, or the standard compromise.

Cheers,

Tom

Last edited by gootee; 30th May 2012 at 07:36 AM.
  Reply With Quote
Old 30th May 2012, 11:54 AM   #183
diyAudio Member
 
Join Date: Nov 2008
ScreenShot015.jpg

Tom,

I think what you are saying is that a full ground backplane is (probably and marginally) better than the star configuration in this circuit. I personally truly have no idea, and your arguments sound convincing. So, the attached is my interpretation of what I think you said.

1. Have I correctly understood where you were headed?

2. If this is the preferred ground plane, what should I do with the top layer? Leave the traces as-is, with power connections still going to the individual parts of the board in a star configuration?

Comments appreciated.

Last edited by wapo54001; 30th May 2012 at 12:21 PM. Reason: updated image
  Reply With Quote
Old 30th May 2012, 01:14 PM   #184
just another
diyAudio Moderator
 
wintermute's Avatar
 
Join Date: Aug 2003
Location: Sydney
Blog Entries: 22
I've had to remove a number of posts due to a personal attack, and colateral damage.
__________________
Any intelligence I may appear to have is purely artificial!
Some of my photos
  Reply With Quote
Old 30th May 2012, 02:25 PM   #185
diyAudio Member
 
Join Date: Nov 2008
Quote:
Originally Posted by gootee View Post
Background:

Zin and Zout are the input and output impedances of the two-port attenuator network.

............................

Anyway, those figures were for linear resistance profiles, which are probably not the optimal profiles. For example, if the resistance curves were a little-bit "concave-upward", sagging a bit where they intersect at the mid-volume setting, then you should get a lower maximum output impedance, which would be better. If you let the shunt element have a higher maximum resistance, you might get a better (higher) minimum input impedance at maximum volume. Note that each of those would also affect the overall gain profile (as plotted versus the volume control setting). But you will probably want to play around with the resistance profiles, in order to try to get the best combination of minimum input impedance (the higher the better) and maximum output impedance (the lower the better). I guess that, generally, raising the maximum element resistances while letting their response curves sag more where they cross could improve things, especially for Zout, up to a point. And I like the idea of a higher max resistance for the shunt element but I haven't actually tried it, or even thought it through. But if it works then it might solve part of the Zin problem, so that maybe you could keep it from going below 10k Ohms. Unfortunately, that will probably prevent you from being able to get to max volume. There are definitely trade-offs to analyze.

Idea: Maybe you could have three switchable modes, so that users could select either better input impedance, better output impedance, or the standard compromise.

Cheers,

Tom
Tom, great explanation, thank you! For the most part, I think I already knew the first parts of this explanation, and I understand that for an unbuffered pot there are compromises between ideal Zin and Zout values.

I'm trying to do an LDR volume control even with all the compromises involved, and I want to do it without buffers.

Presently, my goal is to build a 10K, logarithmic response potentiometer made entirely of LDRs. It's my goal because with my limited understanding, it is the optimal compromise of all the competing demands that you so eloquently listed above. It appears that there is no solution that is optimal for all the competing aspects of the circuit.

There seem to be two pieces you are suggesting that I have not looked at, do I have them right?

1) Different curves for the series and the shunt resistances -- so the series resistance and the shunt resistance do not always add up to 10K at each point in a 10K pot's rotation.

2) A pot with three different (selectable) pot values of, say, 10K, 15K, and 25K.

The first seems doable, the second would be difficult due to memory space constraints within the PIC. However, each individual version of the circuit could be built to be any value pot desired, as long as the LDR is still controllable at that resistance value. I think a 50K pot would be beyond the ability of the circuit as I have it presently designed.
  Reply With Quote
Old 30th May 2012, 04:29 PM   #186
diyAudio Member
 
Join Date: Nov 2008
Quote:
Originally Posted by wapo54001 View Post
Tom, great explanation, thank you! For the most part, I think I already knew the first parts of this explanation, and I understand that for an unbuffered pot there are compromises between ideal Zin and Zout values.
Tom, I didn't say it in so many words, but here is my quandry: It appears to me that there are, as you say, tradeoffs to be made and, the thing is, it seems to me that the tradeoff is unavoidable and each limitation can be ameliorated only by making another tradeoff condition worse. Aside from making the pot of a different value, say 20K instead of 10K, is there any action to be taken that doesn't turn the resulting device into a specialized pot that is optimized for a specific source and load? I want to design a pot that is suited for the preponderance of applications.
  Reply With Quote
Old 30th May 2012, 08:01 PM   #187
gootee is offline gootee  United States
diyAudio Member
 
Join Date: Nov 2006
Location: Indiana
Blog Entries: 1
Quote:
Originally Posted by wapo54001 View Post
Attachment 284915

Tom,

I think what you are saying is that a full ground backplane is (probably and marginally) better than the star configuration in this circuit. I personally truly have no idea, and your arguments sound convincing. So, the attached is my interpretation of what I think you said.

1. Have I correctly understood where you were headed?

2. If this is the preferred ground plane, what should I do with the top layer? Leave the traces as-is, with power connections still going to the individual parts of the board in a star configuration?

Comments appreciated.
Actually, I was only talking about filling the area around the LDRs; basically just a partial ground plane for the LED ground returns.

But I will compare your last posted layout to the previous one, when I get back to my computer.
  Reply With Quote
Old 30th May 2012, 08:47 PM   #188
diyAudio Member
 
georgehifi's Avatar
 
Join Date: Sep 2003
Location: Manly Australia (Jewel of the Pacific)
Send a message via MSN to georgehifi
Quote:
Originally Posted by wintermute View Post
I've had to remove a number of posts due to a personal attack, and colateral damage.

Bit quick on the trigger there Wintermute, a blind man could see what was going on. I believe AndrewT was in his rights to express it, maybe not in his Scottish sledgehammer way, but still had the right.
Lucky I didn't say anything, being Aussie I would have said it even less tactfully.


Cheers George
__________________
Avatar : Production Lightspeed Attenuator
www.lightspeedattenuator.com
  Reply With Quote
Old 30th May 2012, 08:47 PM   #189
gootee is offline gootee  United States
diyAudio Member
 
Join Date: Nov 2006
Location: Indiana
Blog Entries: 1
This post was removed. Wintermute was kind-enough to send it to me ao I could repost it after removing the offending quoted message.

There are people who understand all of the nuances of the theory and practice of ground and power planes and pcb design and analysis. I've got a lot of their scientific and technical papers and journal articles and books. It's a little difficult to generalize about, sometimes. But for particular cases, simulations and analysis can pretty-much tell you everything. And if nothing else the likely alternatives can simply be tested.

There are a few people who frequent diyaudo.com whostudy and design PCB planes etc for a living. But I am not one of them.

At any rate, I'm not a huge expert and I'm not saying that it would make a big difference, because I really don't know. But I can say with certainty that it would be better than what you currently have, just not by how much. I was and still am just wondering if you had a good reason for not planing that area (becuase if you didn't, I assumed that you would have done so).

The fact that the currents are very small also means that they are much more easily affected, and is actually a good argument FOR using either a plane/fill or a separate ground trace for each LED. You have neither.

Separate star ground traces for each LED probably wouldn't fit very well, so using a plane or ground-fill is probably the best option of the two. And for a second reason, discussed farther below, it is the preferred option.

As I said, I haven't done even any rough calculations to see how big the effects might be, of using a single shared ground return for the LED currents. I'm guessing "extremely small". But the LED currents are where the metal hits the meat, so to speak, for this device. They are critical. They ARE "the product". And they go down into the low double-digit microamps. What is the necessary precision, at that level?

OK. I guess we have to do this. Let's "explore", a little:

At 10k Ohms LDR resistance, you're using 20 uA through the LED, and 125 nA (0.125 uA) would change the LDR resistance by about 100 Ohms. You'll have about right at 2 Volts across your LED when it has 20 uA through it and the LDR is at about 10k Ohms.

Then, let's say that another LED is getting 10 mA. And say that goes back to the main ground through four inches of the single LED ground-return PCB trace, and say that has a resistance of roughly 1 milliOhm per inch, for .004 Ohms. That makes 40 uV. But you'd have two doing that, one per channel. So that's 80 uV.

That might change another LED's current by 7 nA or so, which might change a 10k LDR resistance by 10 Ohms, or 0.1%.

Is that enough to worry about? Maybe not. It might have been, if that was a difference between the two channels attenuations, since it might be noticeable as a change in balance. But although your LED ground return is much longer for one channel than it is for the other, the difference in attenuation between the channels would probably be less than 0.05%. Is that enough to worry about?

On the other hand, I didn't have any opamps in mind, above; just voltage sources and resistors and LEDs. So I don't know how your circuit might react or differ, regarding the effect of an 80 uV rise of an LED's ground voltage.


Problem 2:

There WILL, at times, be rather-strong RF (Radio Frequency) fields in the air, which will tend to invade every bit of everything, including inside of your attenuator's case. Those LED traces have some substantial loop area that has been formed by them. The LEDs are diodes, and have a pn junction, and some capacitance. In the RF world, they might also be able to be called detectors or demodulators. Every PN junction can rectify AC currents. In this case, it might be the AC currents that are induced by stray RF, on the LED traces, which look like very nice antennas.

Various "bad things" might happen, in that case. You might simply get a DC offset, if a continuous-wave RF signal is rectified, much like in a linear power supply. Or maybe there'll be an AM radio (or CB) station signal and you'll get the actual audio signal rummaging around in your LED-current traces, causing weird volume fluctuations at the speakers. Or maybe someone will flip a switch or some equipment will suddenly turn on and a very broadband RF burst will be rectified into a substantial DC pulse. Or, maybe, the RF will simply go the other way and enter your op amp circuits' outputs and then zoom backwards through the feedback resistors and enter the negative input pins. Round it goes. Where it stops, nobody knows. But there are lots of pn junctions in an opamp and extra DC from rectified RF could change internal operating points, and also cause all of the other effects just mentioned, but inside of the op amps.

Do you really want to worry about any of that?

Cheers,

Tom

Last edited by gootee; 30th May 2012 at 09:15 PM.
  Reply With Quote
Old 31st May 2012, 02:13 PM   #190
diyAudio Member
 
Join Date: Nov 2008
Ground plane segmented into functional sections -- power, digital, analog -- and joined together only at the main power supply capacitor ground.
Attached Images
File Type: jpg ScreenShot007.jpg (493.1 KB, 314 views)
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LDR photoresistor attenuator preamp, in general romana Analog Line Level 54 14th December 2013 02:32 AM
TUBEpre and Lightspeed LDR attenuator tinitus Analog Line Level 5 31st January 2010 05:08 PM
LDR attenuator questions Carlp Analog Line Level 15 21st January 2010 01:01 AM
LED to LDR amplifier electro samurai Analogue Source 8 21st March 2004 05:07 PM
Spectrol, high precision, 10k attenuator. Peter Daniel Swap Meet 3 4th February 2004 05:15 PM


New To Site? Need Help?

All times are GMT. The time now is 11:39 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2