A precision LED/LDR-based Attenuator - 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 16th July 2010, 05:18 PM   #1
diyAudio Member
 
Join Date: Nov 2008
Default A precision LED/LDR-based Attenuator

Here's an early (and incomplete) drawing of the setup of my board, this is about as small as it's gonna get at two-sided 2.5"x4.0". I haven't finalized pin assignment on the PIC yet, so those lines aren't shown. I figure I'll have one pin left on the PIC when this is done, and resolution might be limited by memory size of the PIC to 1 dB steps, though I hope for 1/2 dB steps down to -55 dB. Each channel will use four opto devices in a T configuration mounted on a 24 pin header, and the board can operate as stereo with balance or dual mono with two volume controls. Controls will be linear, but board will output as audio taper.

Power is a standard LM317T with protective diodes, capacitive smoothing on the control pin, and a load resistor to insure good regulation. Pot will control from 4.85~5.15 volts, and must be set precisely to 5.00V to insure accurate operation.

All control is DC voltage -- including potentiometers, and opto control. There is NO digital signal running around this board, except within the PIC itself.

Audio is all at one end of the board, completely separate from power and PIC. In testing the concept I found that control could be very precise, though at this point I'm not sure how precise the LDRs are going to be so can't predict how accurate overall it will turn out. All circuitry, aside from the PIC itself, is entirely linear, no digital. Only mosfets operating in their linear range actually touch the optos so no digital contamination. In steady state (controls not being moved), the control signals from the PIC to the mosfets are infrequent and so small you can hardly see it happening on a 'scope at maximum resolution so it should be very quiet.

I'm getting ahead of myself doing the hardware before the software, but I have more fun with hardware so it always gets done first.

I'm just throwing this image up for the fun of it, it's not final, it's not even tested, so I'm not going to talk details.
Attached Images
File Type: jpg ScreenShot004.jpg (113.6 KB, 4815 views)
  Reply With Quote
Old 17th July 2010, 04:50 PM   #2
diyAudio Member
 
Join Date: Nov 2008
Board finished. Now I need to number the components so I can run a netlist check against the schematic for errors. I hate that part of it, so tedious.

I packed the control lines vertically so there's room available for an Omron relay and controls so I could add a "total mute" position that will not only put the series optos in the megaohm range, but also put a dead short in the vertical part of the T for total mute. Not sure if it's necessary, though, if the optos are all turned off and the two series optos are sitting in the megaohm range, the R2 value shouldn't matter that much. Opinions, anyone?

Also wound up with two unused pins on the PIC. I'm thinking I could use one to make the choice of linear pot or log pot for the volume control a user-selectable option. That might be useful, but that still leaves one still available. Can anyone think of a good further use for a jumper or switch option for any other purpose?
Attached Images
File Type: jpg ScreenShot006.jpg (145.1 KB, 4573 views)
  Reply With Quote
Old 17th July 2010, 07:57 PM   #3
diyAudio Member
 
Join Date: Nov 2008
Default A precision LED/LDR-based Attenuator

I got interested in the Silonex NSL32SR2 optocoupler device through reading about GeorgeHiFi's "Lightspeed" LDR attenuator. It seemed a nifty approach to creating a totally passive preamplifier with absolutely no switches, relays, or potentiometers in the signal path.

On the other hand, I was not excited by the necessity of hand-matching multiple LDR devices in order to build properly balanced and tracking stereo systems, and there seems to be no practical way to build any kind of consistent system involving three or more channels due to the requirement to hand-match so many LDR pairs. I thought I'd look for a better way, and I think I've found it.

My approach is opposite to that of the Lightspeed crowd -- I do not intend to match LDR devices beyond a basic "does it meet the specifications" check. Instead, I propose to use a PIC to first test and memorize the specific characteristics of each LDR device used in a system, then use that information to apply the correct control voltage to each LDR to achieve accurate performance. If the method works, it should be possible to build multiple, matched, LDR-based passive attenuators or potentiometers, as well as LDR-based input switching systems.

I've made considerable progress in making this happen. The attached circuit card is my first cut at a practical two-channel 55dB stepped attenuator. I have previously verified that the control system works, using a simpler PIC and a single LDR. My proposed two-channel full attenuator uses four devices per channel in a "T" attenuator format with two devices creating the two sides of the top, and two devices wired in modified parallel forming the trunk. Each set of four will be installed in a 24 pin DIP header and will constitute one T attenuator.

Tinitus has kindly agreed to move some posts of mine from another thread, and those posts will contain more detail. I'll post more info when this new thread is established and my posts have been moved over and I know what's already here.
Attached Images
File Type: jpg ScreenShot007.jpg (230.2 KB, 4322 views)

Last edited by wapo54001; 17th July 2010 at 08:13 PM.
  Reply With Quote
Old 17th July 2010, 08:54 PM   #4
tinitus is offline tinitus  Europe
diyAudio Moderator R.I.P.
 
Join Date: Nov 2005
just in case some find anything confusing, post 2 and 3 are moved to this new thread from lightspeed thread

good luck
__________________
sometimes we know very little, and sometimes we know too much
  Reply With Quote
Old 17th July 2010, 09:01 PM   #5
Badge is offline Badge  United States
diyAudio Member
 
Join Date: May 2004
Location: Oregon
I am looking forward to your actual tests of this circuit.
__________________
The freaks stick together, they are a tight old crew
  Reply With Quote
Old 17th July 2010, 10:08 PM   #6
diyAudio Member
 
Join Date: Nov 2008
Quote:
Originally Posted by Badge View Post
I am looking forward to your actual tests of this circuit.
The next step (after thoroughly rechecking the board) is to build a few using ZIF sockets for the PIC and one LDR header and, leaving the other header socket empty in order to use those control and read lines from the empty side to make a test & calibration capability.

That will allow me to create sets of 1 PIC and two headers that will form the basis for a fully calibrated stereo/dual mono board. As long as the two headers and the customized program in the PIC stay together as a set, all other components will not have an impact on system accuracy (as long as the power supply voltage is maintained accurately.
  Reply With Quote
Old 18th July 2010, 04:48 AM   #7
gootee is offline gootee  United States
diyAudio Member
 
Join Date: Nov 2006
Location: Indiana
Blog Entries: 1
Cool!! Good work!

I have pspice models of the LDRs, that I have used in LTspice, if you are into spice and would like to have them. You can check out my posts in the lightspeed thread and in the other LDR attenuator thread. I did some work on keeping the input and output impedances from varying so much, as they do with the Lightspeed, and on making them what you want (by adding simple passive resistances in the right places, covered to some extent in my old posts).

Also, I wonder if there might be any payoff to using actual near-real-time feedback of the average input and output levels, instead of, or maybe in addition to, memorizing each LDR's characteristics.

CHeers,

Tom Gootee
  Reply With Quote
Old 18th July 2010, 10:18 AM   #8
diyAudio Member
 
Join Date: Nov 2008
Thank you for the offer, I have never used Spice at all, I've never actually done much with designing circuits. What I'm trying to do here is really simple, hardware-wise.

Interesting that you'd mention using resistors in the right places to better control LDRs in the Lightspeed configuration. I, too, felt that circuit could benefit a lot from some simple optimizing, but I never saw your posts. I went through those 3000+ posts pretty fast, I confess. I could not see that the circuits, as published in the Lightspeed thread, did anything to limit the operating resistance range of the LDRs to a "useful" range.

With regard to 'near real time feedback' how would you even achieve it without touching the audio circuit somehow? I know that PerkinElmer produces units with dual LDRs built in, but the basic specs for those units make them unattractive for audio, I think.

I went back and reread other threads that addressed LDRs and was surprised by how many attempts there have been to make the concept practical both commercially and for the diy-er. It appears that my approach is entirely different -- for a start I'm working toward a T attenuator which has constant input and output impedance. In spreadsheeting the values, it appears that a wide range of impedances is possible from a few kilo ohms up to maybe 10K, so a pair (or set of many) could be made for specific values.

At one point I got excited when I read that you can design a T attenuator with high input Z and lo output Z, but when you run the numbers it turns out that some of the resistors have negative values until you get into pretty high attenuation levels. Not practical.
  Reply With Quote
Old 18th July 2010, 04:53 PM   #9
gootee is offline gootee  United States
diyAudio Member
 
Join Date: Nov 2006
Location: Indiana
Blog Entries: 1
You should be able to find most of my posts by searching for "LDR gootee".

Yes, to get feedback you would have to connect to the audio. But if you had an extremely-high-impedance input, for that circuit, there would be no effect on the audio.

But I don't know that it would be a potential improvement. It might just be another way of getting a similar result. And it would certainly add complexity. And it might be difficult to get it to work well. So carry on!

P.S. I also designed a circuit that can completely linearize the normally more like logarithmic resistance vs control current response curve of any LDR. Unfortunately, it requires a second LDR that is an exact match to the one being linearized, in order to precisely linearize it.

Cheers,

Tom

Last edited by gootee; 18th July 2010 at 05:00 PM.
  Reply With Quote
Old 18th July 2010, 07:07 PM   #10
diyAudio Member
 
Join Date: Nov 2008
Quote:
Originally Posted by gootee View Post

P.S. I also designed a circuit that can completely linearize the normally more like logarithmic resistance vs control current response curve of any LDR. Unfortunately, it requires a second LDR that is an exact match to the one being linearized, in order to precisely linearize it.

Cheers,

Tom
If you've already done this, you could provide some very useful information to me: I want to know how close the LDR curve is to a log curve, and if it makes sense to control it from a log control. Just from one hour of testing, it appears to me that the Lightspeed crowd is doubling the curve by using a log taper control to run the already-log NSL32. Am I right, or is a log control necessary to get a log output from the LDR?
  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 06:57 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