Tuesday, January 1, 2008

Opamps: Operational Amplifiers

Operational amplifiers, often known as opamps, are nifty little integrated circuits that contain several transistors. These transistors are used to amplify or attenuate a signal, depending on the circuit that the opamp is placed in.



Why use an opamp when you can use a transistor? Because opamp packages are easier to control, generally more powerful, and also more versatile. An equivalent amplifier circuit might take numerous components, but the opamp places them all into a compact package, reducing the amplifier’s circuit board footprint and the number of components that could fail.

The classic opamp, and perhaps the most widely used, is the UA741. This device comes in several packages, including a compact 8 pin DIP as well as a 10, 14, and 20 pin version for other purposes. All of these are quite cheap, with the 8 pin version costing only $0.30 or so at most online retailers. You would pay considerably more to construct an amplifier circuit using pure transistors.

Opamps are used very frequently for signal conditioning circuits. Let’s say you have a sensor, perhaps a heartbeat sensor, and it is picking up a signal of several millivolts. You want the signal to be windowed to 0-5V so you can hook it up to an analog-to-digital converter. Sounds hard right? Not so!

The first step in designing your circuit is to determine the gain you will need. Let’s assume that the signal from your sensor has a peak of 5 millivolts. In that case, you can calculate the gain as:

To find the gain you need, you divide the desired output by the input, in this case 5 and 5E-3 (.005) volts, respectively. Here, we need a gain of one thousand. Can the opamp handle that magnitude? Yes!

Now we need to construct our circuit. The opamp is represented as a triangle:

The leads on the left are inputs. One of these has to be grounded and which one depends on whether your signal is inverted or not. To avoid inverting (flipping) your signal, you need to ground IN- and connect your signal to IN+.

The other goofy thing about the opamp is that it needs two VCC signals, unlike most other integrated circuits. They should be identical in magnitude, but opposite in polarity. For example, you might connect positive 12V to VCC+ and negative 12V to VCC-. Finally, we have Vout, which is the output signal.

Now, to perform the amplification, we need to tell the opamp what gain we want. To do this, we but two resistors in a circuit with it, forming the classic non-inverting amplifier circuit:

Here, we see the two resistors, R1 and R2. The approximate gain of the amplifier in this case would be the ratio of R2 to R1. The two resistors can be any values as long as they maintain that ratio. In our case, we could use a 1000 ohm resistor for R1 and a 1 megaohm resistor for R2.

Now if this circuit was actually constructed, Vin could be connected to the sensor and Vout could be connected to the ADC. By looking at the input and output signals on an oscilloscope, you would be able to see that the signal was clearly amplified. If no amplification is occurring or you only see noise, ensure that your circuit is connected properly, you have +12 and -12 (not ground) volts connected to the opamp’s VCC, and also make sure that everything has a common ground. These are the most common mistakes that I have committed when working with opamps.

Now you should be able to go out and use the opamp effectively. We have looked at the most common circuit configuration, but it is also possible to configure the opamp to do frequency-based filtering and other nifty things.

Source from www.freeinfosociety.com by Jonathan Dunder

No comments: