I want to be able to adjust the volume digitally, in a little audio preamp circuit.
Ideally i was hoping to put something inline with the current amplifier circuit, which adjusts the level of the signal going into the preamp.
But Im open to any suggestions.
Im fairly experienced with digital devices and MCUS. But not so good at audio circuits (although Ive done a few basic ones).
I was looking at programmable gain amplifiers like the MCP6S21/2/6/8.
But the adjustments are in really big steps +1 +2 +4 +5 +8 +10 +16 +32 (V/V).
With 2 of these chained together its only 64 steps, not really suitable for fine volume adjustment.
Anyone know any other devices that may be suitable?
Or any sites or tips on digitally adjusting volume?
CS3310 is a nice part. It is a stereo volume controller you control via a serial interface (can't remember if its SPI or I2C). 0.5dB adjustments over a gain/attenuation range of more than 100db.
TI also makes a competing line of parts, such as the PGA2310.
I believe microchip do nice simple (and cheap) serial digital pots. Simple SPI-like interface. Failing that...for a more complicated approach, you could use an FET in the feedback loop of an opamp circuit...I believe these can be used as 'voltage controlled varibale resistors' under certain conditions. of course then you would need a 'dac' (R-2R ladder?) driven by either a microcotnroller, or a serial shift register.
Also...there are many digital pots, which are even cheaper, that only have a 'up/down' pin instead of a serial interface. So no absolute control can be achieved, only relative..but you can set the 'default' gain with resistors anyway.
This is how I would do it, use a CMOS analogue switchs like the 74HC4066 to short across resistors in the feedback loop of an op-amp.
The example shown belowwill give gains between 1 and 16, you could easilly add 160k, 320k, 640k and 1M28 resistors and another analogue switch IC to give a gain between 1 and 256. I wouldn't go over 8 bits per op-amp as the feedback resistors start to get prohibitively high. If I wanted 16 bits of resolution to go from 1 to 65536 then I'd connect two of these amplifiers together.
Sorry for this but are you sure that the increase in those chips isn't one by one in level? What you mention, looks to be related the possible addressing of something.
This is how I would do it, use a CMOS analogue switchs like the 74HC4066 to short across resistors in the feedback loop of an op-amp.
The example shown belowwill give gains between 1 and 16, you could easilly add 160k, 320k, 640k and 1M28 resistors and another analogue switch IC to give a gain between 1 and 256. I wouldn't go over 8 bits per op-amp as the feedback resistors start to get prohibitively high. If I wanted 16 bits of resolution to go from 1 to 65536 then I'd connect two of these amplifiers together.
Hey Speakerguy and all the other helpful heroes of this thread, I do appreciate and look in detail at every response.
So thanks alot and all the best for 2008.
Ive decided digipots are the way to go for me, they are easy for me to get hold of here and look like they could be useful for other projects.
I do have another newbie audio question.
In systems where you can plug in headphones, it will usually shut off the speakers when you plug in the headphones.
How is this acheived?
Using the MCU I can think of many complex ways of detecting the impedance and switching the path of the audio signal.
But I have a feeling there must be a really simple way of doing it that im missing.