Amplitude Selector

Thread Starter

bruzzac

Joined Jul 10, 2008
5
Hi Guys,

I have a potentially simple problem here. I need a simple amplifier or attenuator circuit that can have its gain or attenuation changed by the output of a microprocessor. So I have a sinusoidal wave coming through at any amplitude.. probably about 1V and I would like this to be amplified to around 5V or attenuated to 0.2V (and i can amplify later on) by setting an output pin on the microprocessor on or off.

I have had a couple of ideas and tried them.. all including a transistor but none have really panned out, so I thought I would ask for some inspiration:D

Thanks,

Bryan.
 

Thread Starter

bruzzac

Joined Jul 10, 2008
5
Yeah, that would definitely be one way, however they are more expensive. I was hoping for more of a simple transistor or op amp circuit that i can just get the parts from my local dick smiths (radio shack) to do the job.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Have a look at the attached.

S1 represents your uC pin. If it's in a high-impedance (input) state, the output of the opamp will be 1/2 the input signal. If the pin is at 0v, the output will be double what's input.

The resistors on the noninverting input attenuate the signal by 10:1. The op amp feedback is wired for a gain of roughly 5:1 or 20:1, depending on whether S1 is open or closed.

You could replace R3 and R5 with potentiometers to allow "fine tweaking".

You could add more pots connected to more pins for some real control freak action.

You could use a TL082 opamp instead of the LF353 (RS doesn't carry the LF353)

See our tutorials from the main page for more info on how to calculate the gain through an opamp.
See our helpful hints topic anchored at the top of the General Discussion forum for a link to a handy serial/parallel resistance calculator.
 

Attachments

Last edited:

Thread Starter

bruzzac

Joined Jul 10, 2008
5
Hi SGTWookie, that's a great circuit - thanks for that, but unfortunately I only have a +5V supply.. the same which drives the uP. Will that still have the same effect if i biased the input by half the amplitude of the input signal and then replayed the +10V with the +5V and the -10V with the GND?
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, if you only have a 5v input, then you are going to need a single-supply rail-to-rail opamp. You won't find that at Radio Shack.

Standard op amps can't get within a volt of either rail; more like 1 1/2 volts. So with a 5v supply, you have a range of about 1.5v to 3.5v that's useable - not much of a range.

An OP179 or OP279 will run on a single +5 supply and has rail-to-rail inputs and outputs. Newark carries OP279 for around $3
http://www.newark.com/jsp/search/br...gensearch_001&Ntt=OP279&Ntx=&_requestid=25368
but they are surface-mount parts. These can be difficult for a hobbyist to work with. You'll need to make a printed circuit board to use it.

You could use two 9v transistor batteries to power it. More economical would be to use six or eight rechargeable AA batteries for each side of the supply.

Or, you could get an 18v wall wart, and make a "split supply" out of it using a power opamp and a few parts. Old laptop computer supplies can be a good source; some of the older ones are up around 18-24v.
 
Last edited:
Top