How many steps in custom ladder attenuator

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Greetings prophets. I am building a ladder attenuator for my preamp, using a rotary encoder, some logic, and relays. I wonder how many steps I should include. I have always used 24-position switched, which has never been enough, but I don't know how many might be "enough". The attenuator is two channels, and adding a step costs a few marginal dollars. Groups of eight are convenient, because of the 8-bit shift registers I am using, so I am considering 32, 40, or 48 steps.

Schematics, artwork, and source code will of course be added here when I am done.

P.S. Hifi, someday I will finish those drawings and send them to you. Have patience!
 
The one and only
Joined 2001
Paid Member
In my experience, 32 is plenty, but you want it to go down to about -60 dB at the next to bottom versus the max. This results in 2 dB per step. We do this, but we have to use a nonlinear set of values and a look up table to keep the resolution per step.
 
The attenuator is two channels, and adding a step costs a few marginal dollars. Groups of eight are convenient, because of the 8-bit shift registers I am using, so I am considering 32, 40, or 48 steps.

---------------------------------
Go for the 48 steps; even with 31 steps, I am always fiddling with the volume control. I often wonder how people can use 24.
 
My preamp has, I think, 24 steps which, for me, is fine. What helps is that the preamp also as an attenuation switch. By flicking that switch, the volume drops down - one can use this to answer the telephone and when done talking, flip the switch again and not have to redial in the volume setting you once had.

What also works is that you can flip the attenuation switch on, and increase the volume setting, and get a finer resolution in volume settings. This only works for the lower volume levels, but I doubt this would be a problem, as this is where you would want greater resolution anyway. In effect, this technique gives a 24 step volume control extra steps.
 
What also works is that you can flip the attenuation switch on, and increase the volume setting, and get a finer resolution in volume settings. This only works for the lower volume levels, but I doubt this would be a problem, as this is where you would want greater resolution anyway. In effect, this technique gives a 24 step volume control extra steps. [/B][/QUOTE]

-------------------------------
A shunt attnauator should be fine, but anything else in the signal path is not desirable ie. switch contacts.
 
I once used a 24 step with per step 1dB + a 3 position switch with 3 x 24dB attenuation.
For me the 1 dB steps were really too small and after a while I always used three or more "clicks".

Now I´ve got a 24 step ladder with 3 dB steps wich get a bit coarser below -60dB and am very satisfied. For me smaller steps are not neccessary.


william
 
One could build the attenuator that looks more like
a "relay DAC" that has far more steps than the number
of relays because certain attenuations are the result
of closing more than one relay simultaneously. I think
that this is what Nelson was trying to say.

In fact, I designed a shunt attenuator using
16 relays that would do 0.125dB steps over a
range of 0->60 db. This could be done with
readily available Vishay resistors. Even 0.1%
relays could be used if you had a way to calibrate
the attenuator and build the ROM lookup table.
Maximum error at any setting can be less than 0.05 dB

Siegfried Linkwitz maintains that the better the
accuracy of your audio system, the more you
need to set volume to the "correct" level. And he's
one smart cookie! This would argue for better
resolution than the standard 24-position attenuator.
 
In fact, I designed a shunt attenuator using
16 relays that would do 0.125dB steps over a
range of 0->60 db. This could be done with
readily available Vishay resistors. Even 0.1%
relays could be used if you had a way to calibrate
the attenuator and build the ROM lookup table.
Maximum error at any setting can be less than 0.05 dB

Siegfried Linkwitz maintains that the better the
accuracy of your audio system, the more you
need to set volume to the "correct" level. And he's
one smart cookie! This would argue for better
resolution than the standard 24-position attenuator. [/B][/QUOTE]
-----------------------------------------------
I agree; is your design published anywhere?

With my system, I like to set to at least 1dB and would prefer 0.5. This gets the soundstage just right .
 
Some software

I've started this project with a Grayhill 61C11-01-08-02 rotary encoder switch and an Atmel AT90S8515-8 microcontroller. In the spirit of releasing early and ofter, here's the first stage of the software. It listens to the rotary encoder and increases and decreases the volume. Presently this only has the effect of turning on and off some LEDs, but the next stage of the program will control the shift registers using the SPI.

[Dear webmasters: determining file type by the last three letters of the filename is sheer stupidity. -jwb]

[Dear webmasters: please serve text files as type text/plain, not "unknown/unknown" -jwb]
 

Attachments

  • volume.txt
    4.2 KB · Views: 149
Yet more source code

Here is my finished software. Again in reference to the Atmel AT90S8515-8, the program listens to a quadrature encoder on PORTD pins 2 and 3, controls '595 shift registers using the SPI port and PORTD pins 0 and 1, and controls debugging LEDs on PORTC. That leaves PORTA for some kind of display, and PORTC can be repurposed. On mine, I've also got the push action of the encoder wired to the reset on the microcontroller, and the volume is initialized to the first setting on startup, so that is effectively a mute button.

You can change the number of volume levels by editing the constants at the top of the file. 255 is the highest possible number of increments.

Please enjoy this source code without laughing :wave2:
 

Attachments

  • volume.txt
    6.5 KB · Views: 111
R2R Ladders

I intend building a preamp also using relays and resistors instead of a pot. However, I always see, essentially, the same design.
That is, relays simulating some kind of potentiometer. Sometimes its a constant series R with variable shunt R. Other times its a picking somewhere on a chain of dividers.

So, why does no one ever suggest an R/2R ladder?

With 8 relays and 16 resistors you get 256 different levels, so it would then be easy to pick a subset of these 256 to get a suitable shape to the volume curve.

Is there something not very good about this approach?


Cheers - Steve
 
You underestimate us :) There are several designs like that posted around here. There's also one by ftorres that two octal words to get 64 levels from 16 relays. I used a variant of his design, except I made the microcontroller do more work without all the extra logic and diodes and what not. Try searching for ftorres relay attenuator.

Beware though, it is easy to create an attenuator with the opposite curve from the one you want. For example, if you take 1k, 2k, 4k, 8k, 16k, 32k, 64k, 128k resistors and try to switch those into different combinations of resistance, you will get an attenuator that has too small steps at high attenuation, and too big steps at low attenuation. So some cleverness is required in the design.
 
Thats not what I mean.
An R-2R uses just two values of resistor to make up the entire attenuator.
Here is a picture of something close to what I mean:
An externally hosted image should be here but it was not working when we last tested it.


Instead of VREF would be the input voltage. RA, RB and RC shoudl be ignored and RF would be connected to VOUT.
This would give a linear attenuator.

Then again, maybe this has already been discussed and discarded as not very good.
The big plus to my mind is that the you can use the same values of resistor ( two in series for 2R) which I think means the tolerences don't need to be so tight. Get all the Rs from the same batch.

This also provides a constant input impedence which must be a good thing.

Steve
 
I see. What you've got is really an amplifier with fractional gain. When I think "attenuator" I think passive. If you are willing to use an amp for the attenuator, why not go with one of the IC attenuators available from Analog, TI, Dallas, etc?
 
Hmm, you are right.
On the other hand, you could easily give it some gain.

I was originally going to use this with some kind of discrete amp to give a complete pre-amp. When I look around, though, I seem to find lots of people using opamps like the AD797 instead. So, if I use an opamp then I think this approach starts to look more interesting.

I suppose the real question I have is why don't I see R-2R stuff anywhere? Is it going to sound worse than, say, ftorres approach? Has anone tried this for high end audio?

It certainly uses a lot less components - to get 64 levels you only need 6 relays instead of 16.

As the saying goes, less is more.


Steve
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.