Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Digitally adjusting gain

Status
Not open for further replies.

2camjohn

Member
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?


Thanks alot in advance.
John
 
Simple, just use analogue switches to short across resistors in an op-amp's feeback loop.
 
hi John,
You can buy digital resistors 64 and 128 step.

Look here:

**broken link removed**
 
Last edited:
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.
 
Last edited:
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.

Blueteeth
 
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.
 

Attachments

  • Digital gain select.png
    Digital gain select.png
    14.8 KB · Views: 214
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.

If I am wrong, sorry.
 
Here's another idea:
Code:
Compressor -> Summing amplifier > Expander
                     ^
               Output from DC
 
ericgibbs said:
hi John,
You can buy digital resistors 64 and 128 step.

Look here:

**broken link removed**

I've always heard them called "digital potentiometers".

Microchip makes some dandy 256 step ones.

You can use it in a voltage divider, or as the feedback resistors of an op amp.

Be aware that unlike a normal potentiometer, there are voltage limits on the pins of the device. IIRC it will likely by limited to Vdd-Vss, or +5v/0v.
 
Hero999 said:
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.

hi hero999

Did you build this before, is it work ?, I got interest to build this one .I have this 4066,lm74193 to control 4066,lm741.
 
speakerguy79 said:
I weep as no one reads my links :(
hi,
Ref your link:

Thats the device I would choose, its designed for that function, it logarithmic and its stereo.

I also wonder sometimes, if there is any point in posting links.:(

Happy New Year...:)
 
Last edited:
ericgibbs said:
hi,
Ref your link:

Thats the device I would choose, its designed for that function, it logarithmic and its stereo.

I also wonder sometimes, if there is any point in posting links.:(

Yes, this entire thread is a 'blast from the ancient past', these problems were sorted out decades ago by the introduction of custom made chips.
 
jumides said:
hi hero999

Did you build this before, is it work ?, I got interest to build this one .I have this 4066,lm74193 to control 4066,lm741.

No, I haven't built it before but it should work and don't use the LM741, it's rubbish.
 
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.


Thanks again
John
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top