DIY volume control open-source project

Status
Not open for further replies.
if you want, you can grab my code for the pga chip.

search on 'amb delta 1' or 'lcduino'.

the code is primarily for a relay r2r atten but I have selection code in there for the pga, as well. I used to toy around with the pga.

these days, I won't bother anymore with that. I love the cs3318. I suggest you go with that chip instead. WAY better in so many ways.

That chip looks very interesting, but anything that could help this project is welcome. I will make a repository on Github for the purpose.
 
geraldfryjr, the QVGA screen may worry me a little since its on a evaluation board god knows how long its going to last, when it comes to convenient replacement. I am maybe still considering a normal LCD screen, but this is really up to people themselves. One thing is for sure, nothing can beath that price.
 
if you want, you can grab my code for the pga chip.

search on 'amb delta 1' or 'lcduino'.

the code is primarily for a relay r2r atten but I have selection code in there for the pga, as well. I used to toy around with the pga.

these days, I won't bother anymore with that. I love the cs3318. I suggest you go with that chip instead. WAY better in so many ways.

I am a bit confused from that CIRRUS chip. Looking at the datasheet there is same amount inputs as outputs. So it could act as a gain adjustment at the same time being a volume control?
 
like the pga, it does not act ONLY as an atten. it has gain too if you go over 0db.

both the pga and cirrus get noisy as you go over 0db. but its there if you need it and its not all that bad. sometimes tv (dolby to linear spdif) is 10db down and you need extra gain. mostly I never go over -10db (usually not even -20db) on my cirrus.
 
btw, in your first post when you referred to some other project, I had a look at their stuff and it seems to have taken a 'lot of inspiration' from the lcduino features and style. not sure when they did their project, but mine (along with AMB) started at least 4 yrs ago. I noticed the bargraph display looks suspiciously like the one I designed... 😉 I posted my source: not sure if that other guy did or not.
 
btw, in your first post when you referred to some other project, I had a look at their stuff and it seems to have taken a 'lot of inspiration' from the lcduino features and style. not sure when they did their project, but mine (along with AMB) started at least 4 yrs ago. I noticed the bargraph display looks suspiciously like the one I designed... 😉 I posted my source: not sure if that other guy did or not.

Interesting, although i think people rarely bother to invent the wheel again, but theres room for thanking other people for their efforts. 😉
 
like the pga, it does not act ONLY as an atten. it has gain too if you go over 0db.

both the pga and cirrus get noisy as you go over 0db. but its there if you need it and its not all that bad. sometimes tv (dolby to linear spdif) is 10db down and you need extra gain. mostly I never go over -10db (usually not even -20db) on my cirrus.

Interesting. It may seem like a good solution.
 
what I had hoped to do - someday - was to abstract the vol control engine part from the control part. put the vol control on a daughter board and make that a module on its own. define some pins (.1 spacing so its easy to use in many projects) and then design a motherboard to hold that VC engine and have that contain the controller, display, buttons, etc. or interface to a front panel pcb that has those things.

the key part is that you could have a pga chip on one engine module, write code and develop for it and then repeat again for the cs3318 (or other) chip. as long as you broke out enough pins on that module daughter board, it should support a wide range of engine types. have some pins on the module as ID pins so the controller can know what kind of module it is and what protocol to speak to it.

that way, people who want 8 channels can use the cirrus chip and those that only need 2 can get by with a pga (or even some other).
 
what I had hoped to do - someday - was to abstract the vol control engine part from the control part. put the vol control on a daughter board and make that a module on its own. define some pins (.1 spacing so its easy to use in many projects) and then design a motherboard to hold that VC engine and have that contain the controller, display, buttons, etc. or interface to a front panel pcb that has those things.

the key part is that you could have a pga chip on one engine module, write code and develop for it and then repeat again for the cs3318 (or other) chip. as long as you broke out enough pins on that module daughter board, it should support a wide range of engine types. have some pins on the module as ID pins so the controller can know what kind of module it is and what protocol to speak to it.

that way, people who want 8 channels can use the cirrus chip and those that only need 2 can get by with a pga (or even some other).

Sounds like a great idea, i wont be using that many channels myself, but i know that there will be some use-cases where people need this many outputs, and it will certainly not have a significant influence on the cost.
 
multichannel does a few things: the active XO guys (like me) need multiple parallel vol controls for the woofers and tweeters. the home theater guys need 5.1 (6) channels or more for their movie stuff.

other things like having spare channels for spkrs and headphones. with my 8ch vol control, I can dedicate 3 pairs for woof/tweet/subwoof and still have a pair left over for phones use. I can mute the spkrs as a group and unmute the phones, or vice versa.

finally, the cirrus chip is much better sounding than the pga. even if you ignore the 6 'extra' channels, its still my preferred chip for vol control use.

if the daughter board is big enough, you could have relays on there as one choice, solid state chips for another choice and even ldrs as a final choice.

I've never seen anyone abstract things so this extent, but I think its high time... 😉 would be a nice demo of control vs engine separation.
 
multichannel does a few things: the active XO guys (like me) need multiple parallel vol controls for the woofers and tweeters. the home theater guys need 5.1 (6) channels or more for their movie stuff.

other things like having spare channels for spkrs and headphones. with my 8ch vol control, I can dedicate 3 pairs for woof/tweet/subwoof and still have a pair left over for phones use. I can mute the spkrs as a group and unmute the phones, or vice versa.

finally, the cirrus chip is much better sounding than the pga. even if you ignore the 6 'extra' channels, its still my preferred chip for vol control use.

if the daughter board is big enough, you could have relays on there as one choice, solid state chips for another choice and even ldrs as a final choice.

I've never seen anyone abstract things so this extent, but I think its high time... 😉 would be a nice demo of control vs engine separation.

As we say in danish "two flies with one smack". I love building flexible systems which are modular as possible without costing a fortune. I am convined that the Cirrus is the right choice for this project.
 
I would use an Arduino if I was you due to the fact they are cheap, pre-made, can be programmed via USB and have many libraries and examples on the internet for interfacing with all sorts of other devices like screens, switches etc. Linuxworks's LCDuino is based on Arduino. Some are as low as £6 now.

Hifiduino has some interesting articles that might interest you. He (glt on DIYA) has also written and shared a fair bit of Arduino code for his projects:
CODE | H i F i D U I N O

I've also attached some Arduino code to control a PGA23x0 you can use if you want.

The CS3318 is a great IC but has a couple aspects that make it slightly harder to use in DIY:
- The pin pitch could be hard to solder.
- You can easily destroy the IC by not powering it off correctly.

The PGA23x0 ICs are great and easy to use but don't measure as well or have as many channels as the CS3318.

Some other threads that might interest you:
http://www.diyaudio.com/forums/analog-line-level/239513-ampduino-project.html
http://www.diyaudio.com/forums/anal...i2c-relay-selector-attenuator-tube-stage.html

I designed and made a few items that you are welcome to have schematics and layout for if you wish:
Small PGA2320 PCB: http://i.imgur.com/VxhdBqJ.jpg
I2C controlled input selector and relay attenuator: http://i.imgur.com/vvNDFXv.jpg
Both designed to be used with Arduino but could work any micro controller that uses SPI/I2C.
 

Attachments

I would use an Arduino if I was you due to the fact they are cheap, pre-made, can be programmed via USB and have many libraries and examples on the internet for interfacing with all sorts of other devices like screens, switches etc. Linuxworks's LCDuino is based on Arduino. Some are as low as £6 now.

Hifiduino has some interesting articles that might interest you. He (glt on DIYA) has also written and shared a fair bit of Arduino code for his projects:
CODE | H i F i D U I N O

I've also attached some Arduino code to control a PGA23x0 you can use if you want.

The CS3318 is a great IC but has a couple aspects that make it slightly harder to use in DIY:
- The pin pitch could be hard to solder.
- You can easily destroy the IC by not powering it off correctly.

The PGA23x0 ICs are great and easy to use but don't measure as well or have as many channels as the CS3318.

Some other threads that might interest you:
http://www.diyaudio.com/forums/analog-line-level/239513-ampduino-project.html
http://www.diyaudio.com/forums/anal...i2c-relay-selector-attenuator-tube-stage.html

I designed and made a few items that you are welcome to have schematics and layout for if you wish:
Small PGA2320 PCB: http://i.imgur.com/VxhdBqJ.jpg
I2C controlled input selector and relay attenuator: http://i.imgur.com/vvNDFXv.jpg
Both designed to be used with Arduino but could work any micro controller that uses SPI/I2C.

Great comment! I am specially interested in the CONS you had concerning the CS3318. Can you please give a deeper explanation on the destruction risks involved? Perhaps it would be something we could avoid in our design.

I honestly don't really care which microcontroller we use, these days i primarily work with the Teensy 3.0 and Launchpad. The Teensy 3.0 is absolutely my favorite, also do to its footprint. But we cant take away the fact that the Arduino community is bigger than anything out there.
 
I blew one cirrus ;( it was 1am and I hooked the inputs and outputs backwards (swapped). I was tired and my back panel was not labeled and I forgot. poof! snap! one $30 chip, gone to meet its maker. if I hadn't soldered it to the board, it would be pushing up the daisies.

then, like a fool on a mission, I soldered a fresh one up and was careful about the inputs and outputs and that one worked. I could then go to bed a mostly happy person 😉

this convinced me, beyond all other tech issues, to have both input and output buffering. output buffering helps against putting your line-out to the chip's line-out. input buffering helps drive the chip with a low local-z source. and also provides protection against input levels that could cause the chip to go nuclear and burn out.

there is the power supply sequencing that max refers to. the reset line has to be held in a state while the psu's come up. and if there is a fault, all rails really should be opened (if possible). I would try to build in a very 'defensive' psu system on a nice modular system like this. I would also have an over-current detector so that you can remove power if the chip starts to self-fry (for any reason at all).

finally, I chose to have output relays that click up when a fault line goes true and that will remove the downstream amp systems from the preamp/volcontrol and short their inputs to gnd while breaking the connection from the preamp to the amps. and in case of power loss, those output relays also flip up, causing an immediate mute. and those are also left muted on power up until a warm-up period expires.

the cirrus can be run from 8v. an 'odd' voltage.

I would design a local high quality psu near the cirrus and have it on that daughter card. the DC could take dual 15 (or similar) and regulate it down to dual 8. I have had great luck with a TI tps set of regulators (the numbers escape me at the moment). but I'd have that on the board very close to the cirrus.

and finally, the 'dialect' spoken by the cirrus vs the pga vs some other chip are somewhat similar but certainly not the same. what I would do (what I was planning on doing) was having a small local cpu on the daughter card that speaks a 'universal' language (on input) and then translates to the local chip language (cirrus or pga or relays or ldr). that way, you can have a simple ascii serial protocol for vol control and even be able to talk to that daughter card module directly via ttl serial (like using an arduino serial cable, for debugging). it makes interfacing much easier and if you need to expand the ascii 'command set' you could. a small ATTINY could do the job for most vol control engines, I would think.
 
If the IC has analog power but not digital power (3.3V) it goes up in smoke, literally. I fried two before I worked this out. Other DIYers have done the same. Super annoying!

I think we could fix that problem with a simple relay or similar driven by the digital power, so the voltage inputs are set in the correct order. Although i dont see the package size as any issue, worst case they could be pre-soldered if we have the luxury here.
 
Hi Tibi,

Thanks alot for the input, looks very cool. I will add this to the main post. Please hang aorund. 🙂

Rob,

You may want to check our page as well. There is schematic and firmware to build your own R-2R VC with your specifications.

vicol audio : r-2r volume controller

There is also documentation and here a thread where you can get code support for this project.

http://www.diyaudio.com/forums/anal...ther-volume-controlers-source-selections.html

Regards,
Tibi
 
Cool Stuff!!!

I had bought an R-2R resistor block once from Newark and I still have it some where back in the mid 80's when I was working on such ideas but I never used it.
I still have it some where.

There are a few available but I haven't found any prices yet such as this one,

http://www.irctt.com/pdf/laddernetworks.pdf

I have a Korg dual delay unit (SDD-1200) that uses a 12bit one for both A/D and D/A functions and that thing still sounds good to day!!

Then I discovered the same thing can be done with multiplying D/A.

I have been looking for some 8 bit types, But I can only seem to find 12bit ones I think, and, this can be quite costly.

For purist reason I would use relays too, but personally I would ditch them for some of the more modern solid state switches of the DG4xx types.

I just ran across a new part number of a switch that had really great spec's if I can remember what it was, If I find it I will list it here.

Here it is, It is only good for 12Vp-p but it has a THD of only .004%,

http://www.ti.com/lit/ds/symlink/ts12a12511.pdf

Here is a really cool page that has some calculators on it,

Resistor-Switch Attenuator Networks for Audio Volume Control


jer 🙂
 
Last edited:
Damn you Cirrus. They rejected my sample request for some very twisted-totally-unknown reason even though my qty was as low as 1piece and i study that a university. And the best part is that you cant contact them in any way, at all, they basically just send you a mail explaining you that you can contact a distributor.
 
Status
Not open for further replies.