See how do those circuits work! If you liked my blog click some ads :)
Sunday, February 14, 2010
OP Amp_from A to Z
WHAT IS AN OP-AMP?
Before we describe anything technical, let's see one in action. An op-amp can be connected to a single voltage rail (called UNIPOLAR SUPPLY - 0v to Vcc) or a dual voltage rail (called BIPOLAR SUPPLY +/-Vcc). When connected to a single voltage rail, the output can go from 0v to approx full rail voltage. The OP-AMP has two inputs. A "+" input for non-inverting and "–" for inverting. When the "+" input is a few millivolts higher than the "–" input, the output goes HIGH. It's that SIMPLE. Study the animation below:
If the "–" input sits at half rail voltage via two equal-value resistors, the "+" input must go above ½V for the output to go HIGH, as shown in the animation below:
The "–" input can control the output as shown in the animation below:
From the animations above we have shown two things: 1. The "+" input must be higher that the "–" input for the output to be HIGH. 2. A small increase in voltage on the "+" input (above the "–" input) will change the output from 0v to approx full rail voltage. This represents HIGH GAIN or AMPLIFICATION.
The OP-AMP can be used as a VOLTAGE FOLLOWER. The output voltage follows the input. In this arrangement the OPerational AMPlifier is called a BUFFER and has unity gain. The OP-AMP works like this: As the "+" input rises, the output rises. Normally the output would rise to rail voltage, but since it is connected to the "–" input, it will always be a few millivolts below the "+" input.
Note: the output follows the input
The OP-AMP in the arrangement above has UNITY GAIN (gain = 1).
We will now show how to obtain GAIN or AMPLIFICATION from an OP-AMP. In the following animation, the OP-AMP has a gain of 2. For a gain of 2, the two resistors on the inverting input are EQUAL VALUE. The actual value of resistance is not important. It can be 10k to 100k, for example. The point to note is this: The voltage at the mid point of two equal-value resistors is half the delivered voltage. We have already seen from the animation above that an OP-AMP needs a voltage on the inverting input that is almost equal to the non-inverting input to produce the "following effect." Thus, to get this voltage on the "–" input, the output of the OP-AMP must beTWICE the voltage on the "+" input. This is shown in the animation below:
From the animation above, you can see how to turn an OP-AMP into an AMPLIFIER. The gain of an OP-AMP is determined by the ratio of resistors R1 and R2. Here is an OP-AMP with a gain of 5:
If the "+" and "–" inputs are reversed, the OP-AMP will not work (or produce a valuable output) as shown in the following two animations:
The above animations show how to amplify a signal with an OP-AMP. We will now cover some technical details.
OP-AMPs contain a number of transistors (25 or so) but the internal workings do not concern us. The only thing we need to know is how to get it to operate.
An OP-AMP is represented as a "block" in a circuit diagram with two inputs and an output:
An increasing signal (voltage) on the Non-Inverting Input "+" will create an increasing signal on the output. An increasing signal (voltage) on the Inverting Input "–" will create an decreasing signal on the output. An OP-AMP can be connected to a single voltage rail (called UNIPOLAR SUPPLY) or a dual voltage rail (called BIPOLAR SUPPLY) as shown in the diagrams below:
An OP-AMP connected to a single voltage rail will produce an output from 0v to approx rail voltage. An OP-AMP connected to dual rails will produce an output from –V to +V as show below:
You need to know if an OP-AMP is connected to a single rail or dual rails as this will determine the type of signal it is capable of producing.
SPLIT RAILS or DUAL RAILS - also called BIPOLAR SUPPLY can be produced as follows:
This will allow the output of the OP-AMP to change from negative to positive as shown in the animation below:
The positive and negative rail is normally equal in magnitude however if they are not equal, the OP-AMP will produce waveforms equal to size of each rail.
One of the cheapest and most-popular OP-AMP is the 741. The pinout for an LM741 is shown below:
The basic parameters for a 741 are:
Rail voltages : +/- 15v DC (+/- 5v min, +/- 18v max) Input impedance: approx 2M Low Frequency voltage gain: approx 200,000 Input bias current: 80nA Slew rate: 0.5v per microsecond Maximum output current: 20mA Recommended output load: not less than 2k
The following diagram shows the 741 in a typical audio circuit:
From the discussion above we can see how the circuit above sets its operating conditions. 1.The "+" input sits at half-rail voltage via the two 47k voltage-divider resistors. 2. This makes the output go HIGH and the voltage on the "–" input increases until it is just below the "+" input. (The "–" input cannot rise above the "+" input as this will make the output of the OP-AMP go LOW). 3. The end result is the OP-AMP is "half-turned-on" and any increase or decrease in voltage on the "–" input will make the output go LOW or HIGH. Don't forget: the output will move in the opposite direction to the voltage applied to the "–" input.
HOW DOES THE OP-AMP AMPLIFY?
The circuit above is set to have a gain of 100 via the 100k/1k resistors. These two resistors form a voltage divider. We have seen the ratio of the two resistors produces the gain of the stage. Suppose the voltage on the input rises 1mV. This rise will pass through the 100n capacitor and appear on the "–" input as a 1mV increase. The OP-AMP will amplify this signal 100,000 times and the output will try to FALL as much as 100v - but the voltage-divider resistors come into operation as follows: The output will fall and this will be passed to the "–" input via the 100k resistor. As soon as the output falls 100mV, the voltage seen by the "–" input will be 1/100th of 100mV or 1mV. Thus the 1mV produced by the signal will be negated by the effect of the output dropping. The effect is slightly less than 1mV being fed back to the "–" input and the output drops 100mV. The "–" input sees about 100th of 1mV and the output drops 100mV. The following animation shows (in slow-motion) how the voltages flow though the OP-AMP:
Many OP-AMPs have two pins labeled OFFSET NULL. When both inputs are connected to the same voltage, the output should be zero. If the project requires a zero output under these conditions, the OFFSET NULL should be adjusted by adding a 10k pot between the Offset Null pins with the centre of the pot connected to 0v. By adjusting the pot, the output will produce 0v.
The circuit shows an OP-AMP connected as a NON-INVERTING AMPLIFIER:
The circuit shows an OP-AMP connected as an INVERTING AMPLIFIER:
THE OP-AMP AS A VOLTAGE FOLLOWER
The circuit shows an OP-AMP connected as a VOLTAGE FOLLOWER:
THE OP-AMP AS A COMPARATOR
The OP-AMP can compare two signals (voltages). This is called a COMPARATOR orDIFFERENTIAL AMPLIFIER (amplifies the difference between two signals). There are two arrangements - connection to a single rail or dual rails. The animations below show the output for each configuration:
THE OP-AMP AS A SCHMITT TRIGGER
The OP-AMP can be wired as a Schmitt trigger. The diagram below shows this arrangement:
When the input of the Schmitt Trigger is LOW, the output is HIGH. As the input rises, nothing happens to the output until the input is 3v3. This is the voltage on the"+" input due to the effect of the three 10k resistors. These 3 resistors form a voltage divider with two 10k resistors connected to the 5v supply and one 10k resistor connected to 0v. When the "–" input is 3v3, the output of the OP-AMP goes LOW and it remains LOW until the input falls to less than 1v6. The 1v6 voltage on the "+" input is produced by the three 10k resistors. When the output is LOW, one 10k resistor is connected to the 5v supply and two resistors are connected to the 0v rail. This produces 1v6 on the "+" input. The purpose of a Schmitt Trigger is to detect and respond to a signal that rises and falls a large amount - in other words it has "large excursions." There are also signals that rise and fall very slowly - such as a photo transistor detecting daylight. During the detection process, the output will rise and fall slightly during the morning light and the change from one level to the other will cause the project to turn on and off. This is unwanted. The Schmitt trigger will produce an output when a definite condition is met and will not change until the daylight is reduced considerably.
Here are some practical circuits using OP-AMPS:
TIMER When the push-button is pressed and released, the LED illuminates after a period of time. The heart of the circuit is an OP-AMP configured as a comparator. The operation is as follows. When the voltage at "+" input is less than the voltage at "–" input, the output at the output is LOW. When voltage at "+" input is more than the voltage at "–" input, output is HIGH. It is usual to hold the voltage at "–" input at a particular voltage, known as the reference voltage, and vary the voltage at "+" input to obtain a particular function. The two 10k resistors connected in series form a voltage divider, the voltage at the mid-point being 4.5v The 500k pot sets the time for the 2200u to charge above 4v5. The 1k stop-resistor prevents a short-circuit if the pot is set to minimum resistance and the button is pressed. Pressing the switch resets the circuit.
SIMPLE INTERCOM A simple intercom can be built around an OP-AMP:
CRYSTAL RADIO A simple amplifier can be added to a crystal set with an LM1458 OP-AMP:
TRIANGLE AND SQUAREWAVE GENERATOR The following circuit shows a simple triangle/squarewave generator using a common 1458 dual op-amp to produce very low frequencies to about 10 KHz. The time interval for one half cycle is about R*C and the outputs will supply about 10mA. Triangle amplitude can be altered by adjusting the 47k resistor and waveform offset can be removed by adding a capacitor in series with the output.
PRICES Here is a list of OP AMPS from FUTURELEC with prices and links for each device:
Working on a project with an OP-AMP requires a lot of skill and understanding. The input impedance of an OP-AMP is very high and probing either input with a multimeter or CRO will change the voltage on the input and alter the state of the output. The reason is this: The voltage on either input is extremely critical. It only has to change by 1/10th of a millivolt and the output will change a considerable amount. The actual change will depend on the gain of the OP-AMP and this is determined by the value of the components surrounding it. If the gain is not controlled, it can be as high as 10,000 to 100,000 but most OP-AMP have surrounding components that limit the gain to between 2 and 200. It is also impossible to measure the difference in potential between the inverting input and non-inverting input. Thus the normal method of probing and testing an OP-AMP with a multimeter or CRO DOES NOT WORK! You have to use a new method of testing. It's simple and quite brilliant. It's a 47k on jumper leads with a short length of tinned wire in the second alligator clip to act as a probe. The lead can be connected between the pin under investigation and either the positive, 0v rail or negative rail, while monitoring (measuring ) the output of the OP-AMP. Don't be tricked by a CRO. It puts a load on the OP-AMP and if the line under investigation is HIGH IMPEDANCE, the CRO will affect the amplitude of the signal. The amplitude on the display will be reduced (attenuated) as the frequency increases. For instance, for a 10MHz CRO, the amplitude will be 50% of the real value when the signal is 10MHz. The load from the leads of the probe on the CRO will attenuate (reduce) the signal and if the circuit is operating at say 100MHz, the load of the CRO can quite often "kill" the operation of the circuit. LET'S START:
The first circuit we will discuss is an example of BAD DESIGN. Before you start, you need to know the basics. We have covered these in the previous pages of this topic and the most important point to remember is the voltage on the "+" input must be slightly higher than the "–" input for the output to be HIGH. This is the way an OP-AMP naturally sits when it is connected as shown below. The "–" input rises (normally due to the voltage from the output) until it is just lower than the "+" input and this makes the output nearly equal to the voltage on the input. If the "+" input changes by say 1mV, the biasing of the two other pins will adjust by approx the same value. This makes the circuit inherently fairly stable. However in the following circuit this is not the case. The main fault is the connection of the two inputs to the 5v rail.
The correct way to bias an OP-AMP is to allow the circuit to easily produce the voltage on the inverting input as shown in the diagram below:
In the first circuit, the output must fall by 100mV if the "+" input falls 1mV, to maintain the bias conditions. As the 1u gets older, its leakage current will increase and this will change the bias on the output of the OP-AMP. For this reason, the 1u must be a low leakage device such as a TANTALUM. A project containing this circuit was sent in for repair and the solution was to replace the 1u with a tantalum. To find out if a circuit is critical, an easy approach is to press you finger across each of the electrolytics, on the underside of the board. The slightest press across a faulty electrolytic will turn the circuit ON.
ifficult for the OP-AMP to produce a lower voltage on the inverting input. For each millivolt lower than the "+" input, the output must be 100millivolts lower than 5v. With a supply of 5v, the "+" input can only drop 50mV or less for the OP-AMP to hold its self-bias conditions. An improved design is to place the 10k on the 0V rail.
The circuit above includes the circuitry connected to the "+" input as this is a very important part when servicing the stage. You cannot work on a OP-AMP stage if you don't know how it is being driven as the input line is very sensitive to the slightest change in voltage. When the circuit turns on, the 1u electrolytic will be uncharged and the output will be LOW. It will charge via the two 100k resistors and after about 5 seconds the "+" input will be higher than the "–" input and the output will go HIGH. The actual voltage on the output will be lower than 5v so that the "–" input is a fraction of a millivolt below the "+" input. This how the OP-AMP sits. When the signal on the output of the first OP-AMP is above 0.7v, it will pass through D2, via the 4u7 electrolytic and charge the 2u2 electrolytic. Diode D1 discharges the 4u7 when the signal goes low so the 4u7 remains discharged so it can pass its signal to D2. Any slight voltage on the 2u2 will be passed to the non-inverting input of the OP-AMP and cause the output to rise. If the circuit is not operating correctly, the only point you can monitor (read) is the output of the second OP-AMP. It should be about 5v. The rest of the circuit is classified as HIGH IMPEDANCE and any probing with a multimeter will upset the conditions. The most critical component in the circuit is the 1u electrolytic. It must be a low leakage type to allow the voltage on non-inverting input to rise above the inverting input. To see if the OP-AMP is sitting correctly, place the 47k (on test leads) between the non-inverting input and the 2v rail, while monitoring the output. The output voltage should rise. Placing the resistor between the "+" input and 0v rail, will make the output go LOW. Place the jumper lead between pint "A" and 0v rail - in other words place a "short" between point "A" and ground to see if a signal from the first OP-AMP is being detected by the second OP-AMP. You will have to wait a few seconds for the circuit to settle down before taking a reading as the 1u will have to charge via the two 100k resistors before taking a reading. If the "charge-pump" section is generating a voltage but no input signal is being delivered to the project, the fault may lie in "hum" being generated by a previous stage or some form of self-oscillation. You can also get an effect called "motor-boating." This is a low frequency feedback through the 5v rail. It occurs like this: If a large load is placed on the power rail, a slight voltage drop will occur and this will be passed to the 5v rail. We have already seen that the voltage on the 5v rail is very critical and any slight change can alter that state of a stage. This effect will be passed through the circuit to create a repeat "hiccup." To see if the "charge-pump" section is capable of feeding the OP-AMP amplifier, place the 47k between point "A" and the 12v rail. This will charge the 2u2 and feed the OP-AMP. You can also repeat the test at the join of the two diodes, to make sure they are around the correct way.
The OP-AMP circuit above is very similar to the voltage-follower arrangement described on a previous page of this topic. The output rises slowly to the same level as that on the "+" input due to the effect of the 10u electrolytic charging slowing via the 1M resistor. It will sit (quiescent condition) with the output at approx 5v. When a signal is being processed, the electrolytic will not have time to charge or discharge and thus it can be considered to have zero resistance between its terminals. The gain of the stage will be the ratio of the two voltage-viding resistors on the output: 1,000,000/10,000 = 100. If the output is not 5v, place the 47k on jumper leads between the "+" input and 12v and see if the output rises. If it does not rise, the fault may lie in a fault OP-AMP or something on the output preventing it from rising. Make sure the 1M is the correct value. Make sure the 5v rail is the correct voltage. You will not be able to accurately measure the voltage on the non-inverting input and that's why the 47k on jumper leads is needed to check the operation of the stage.
AUDIO MIXER This circuit may work but the output is NEGATIVE! The circuit is designed for audio, but how many audio circuits require a negative voltage from the output of a stage? Before building a circuit you have to be aware of its operation as one would expect the output of a stage to be POSITIVE.
Fig 4: AUDIO MIXER
SHORT-CIRCUITS When probing any type of circuit there is always a desire to "short between two points" to "see what will happen." This is always dangerous as many chips and transistors etc will not accept an overload, even for a fraction of a second. That's why we suggest using a 47k on jumper leads. It's a fairly good value to use for high impedance circuits - especially OP-AMPs, to get a reading on the output pin of the chip. There are, however, some places where you need to "short" as the voltage being tested is very small and a 47k resistor will not produce a result. Before you use the test lead as a "short," make sure the section is High Impedance. In other words, make sure the components you are probing are not directly connected to the power rail or via a low-value resistor. If you are not sure about the applying a "short," you should start with a 10k resistor, then a 1k and finally a 100R resistor on jumper leads. A 100R will normally provide the same results as a "short" while protecting the components from damage. Another very good "component" for testing the action of a circuit is the resistance of your body. By holding the metal part of the alligator clips with your fingers, you can adjust the effective resistance by squeezing the clips. This is a very simple way to get a variable resistance and many circuits can be activated in this way.