Click-click! A relay-based attenuator…

Yes, when you are not lucky enough to score a good deal on expensive pots (see my last post) then getting suitable attenuators for your project can be a bit of a pain πŸ˜€ If you are looking for a balanced attenuator there isn’t really much “middle ground” out there between an Alps RK27 costing app. €30 and a real stepped attenuator such as a DACT (which retails for more than €300).

The typical answer to this is simple – use relays. I was never really a fan of relay attenuators though, having always found the loud clicking noises whenever you even looked at the volume knob really annoying and not something I’d want to have to live with on a daily basis. However, relay attenuators do have a couple of advantages, among which that they can be built for a reasonable cost. A stepped attenuator also has very good channel matching, but whereas even the expensive DACT only gets you 24 steps, typically with 2dB between them, 128 or even 256 steps of 0.5dB each are quite easily achieved with relays. So, having thus abandoned my principles, I wanted to try one as well πŸ™‚

Even a cursory look at the schematics would reveal this as a clone of TPAs “Joshua Tree” attenuator, however it is by way of another design. I actually started from the eagle files shared by diyaudio user MaxW in this thread. I have kept the circuit more or less intact, but removed the input selector that Max had and converted it to a (nearly) complete through-hole design.

I have decided to keep the I2C-controller and the attenuator itself onto a single PCB. A couple of reasons for this, mainly that it makes for easier wiring when the PCB is “self-contained” apart from the controller and PSU, but also that when the attenuator is used in a balanced or multichannel configuration each channel gets its own I2C-address, meaning you can easily control levels separately. The added parts cost is negligible to me. The attenuator stage itself uses Omron G6K 5V miniature relays and Vishay RN55 resistors. As far as I know there are no substitutes from other manufacturers for the relays (because of the uniform 2.5mm pin spacing), but ReicheltΒ has them for a decent price so even that is manageable.Β The unit is intended to be controlled by an Arduino (or similar microcontroller) with I2C-capability and I have used MaxW’s sample code from the diyaudio thread as my starting point which seems to work very well.

Now, I have put together the first sample PCB and I am honestly a bit impressed. Obviously the clicking is still there, but it isn’t too loud with the tiny Omrons. The volume ramps very smoothly when you turn the encoder and I heard absolutely no audible clicking or noise in the headphones I used for testing. My next step is to build a pair of additional boards for a balanced setup and modify the Arduino code to support a balanced configuration as well πŸ™‚


PS: If you need a different value for the relay attenuator, there are a few good pages out there with information and online calculators:

AMB’s “Delta 1” project.Β (also the AMB discussion forum is a good source of information)

Jos van Eijndhoven’s “Relaixed” preamp.

Twisted Pear Audio’s “Joshua Tree” and the matching controller.


14 Responses to Click-click! A relay-based attenuator…

  1. Pingback: Project files: Relay-based attenuator | theslowdiyer

  2. Sarath says:

    Could you please tell if we can use relay attenuator as a 3 terminal potentiometer and replace them in baxandall tone control circuit ? In that circuit none of the terminals of potentiometer are connected to ground and all 3 terminals are connected to other passive components like resistors and capacitors .

    • theslowdiyer says:

      I’m sorry but I don’t know that. I have seen comments in datasheets for digital pots that they can’t be used like a normal pot, but this is a completely passive circuit so from the perspective it should work. However, if the circuit expects a certain (constant) resistance on the voltage divider then you might have issues because I don’t think a R-2R relay attenuator will match that. I’d suggest you try it and let us all know the results πŸ™‚


      • Sarath says:

        Thanks for reply . Could you please clarify/eloberate below statement in your reply : “However, if the circuit expects a certain (constant) resistance on the voltage divider then you might have issues because I don’t think a R-2R relay attenuator will match that”

        • theslowdiyer says:

          I am not sure and I think that there may be more than one way to build a relay attenuator, however: If you use a standard potentiometer it acts a a collage divider with a constant resistance of say 10k. A relay attenuator may not always have the same constant resistance, because when used as a volume control it just needs to provide a certain attenuation of the signal and not a constant resistance.

          In some circuits this will make no difference whatsoever, but in others it could be a big deal I guess.


  3. Cape Zoloh says:

    Would it be hard to replace the encoder with a ordinary (or your liking) potentiometer instead? How would that process go?

    • theslowdiyer says:

      No, this is actually very easy to do. Normally turning the encoder changes an Arduino variable which is then sent to the attenuator as the desired volume level. Instead of turning the encoder to change the variable, you want to read the value of a pot using the analogread-function.
      Use a 5-10k pot and connect the wiper to an analog input put and the end points to +5V and GND to give a voltage divider. There are plenty of code examples out there to show you how to do this in practice (the same principle works for controlling a PGA23xx-chip, so you can look for code samples for those as well) πŸ™‚

  4. Cape Zoloh says:

    Do you know the exact dimensions of the PCB?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: