A sensor needs to be interfaced to a micro-controller. The problem is that its output voltage is too low/high for the micro-controller to get the data. In order to fix this, an operational amplifier can be employed.
Block diagram:
If the sensor delivers a Vs, range [0,1] V and the micro-controller has analog input range [0,10] V, we seek some signal conditioner which can apply a gain of approximately 10 such that Vc = 10Vs.
An operational amplifier, commonly referred to as an op amp, is an ideal candidate for this project.
Before we begin, there is an excellent document titled, "HANDBOOK OF OPERATIONAL AMPLIFIER APPLICATIONS" by Bruce Carter and Thomas R. Brown which will suffice to fill in any gaps I leave in my blog post. Additionally, some diagrams found in this post are screen capped from that document.
An ideal op amp can be summarized by the following block diagram.
There are 5 terminals of interest on an op amp, the positive and negative voltage sources, labeled Vcc and -Vcc, the input voltages V1 (inverting) and V2 (non-inverting), and the output voltage Vo. In the ideal op amp, Vo = (V2-V1)*gain, however the op amp cannot have an output voltage greater than Vcc, or less than -Vcc. As most op amps have gain values in the millions, a difference on the order of microvolts can cause the op amp to saturate and cause a loss of data. The solution to this problem is to introduce a feedback path from the output to one of the input terminals, this has the effect of minimizing the voltage difference between V1 and V2, thus allowing the signal to pass through without loss of information.
Note* in many op amp circuits Vcc and -Vcc will not be labeled, as it is assumed that the user will chose them appropriately. Also, it improves the appearance of final schematics.
A simple application of an op amp is to employ a feedback resistor between Vo and V1 like so.
Here Vo has been replaced with Eo, V2 is tied to ground and V1 is in the middle of a voltage divider between E1 and Eo. A property of op amps in a feedback configuration is that the voltage difference between the inverting and non-inverting terminals is virtually zero, thus we can consider this circuit to have a zero voltage at the inverting input (V1). If that is the case, then the current through R1 is just E1/R1. As there is no voltage difference between the input terminals, no current flows through the inputs, and the rest of the current is diverted through Ro. This means that the output voltage (Eo) is equal to the negative of the current through R1 multiplied Ro. If that is the case, our expression for the output voltage is Eo = -E1(R0/R1) and our gain is equal to -(Ro/R1).
Returning to our original problem, we found that we needed a gain of 10. An inverting amplifier is obviously not suitable for this application, as we do not want to multiply by a negative number. The second configuration of an op amp will solve this problem.
This configuration is called a non-inverting amplifier, and the gain is defined as Eo = (1+R0/R1)E1. A positive gain is consistent with our desired gain of 10, thus all that remains is to choose Ro and R1 such that the ratio Ro/R1 = 9 and our design is complete.
Laboratory Constraints:
Using the results from our theoretical analysis, we are now to design and implement a non-inverting amplifier and demonstrate its operation.
Changes:
The sensor should provide no more than 1mA of current.
Each power supply should provide less than 30 mW of current.
We are to simulate the sensor in question using a voltage divider like so:
I have chosen to simulate the sensor as a 5V supply across a voltage divider with a static 5 kohms and a variable resistor of magnitude [0,1200] ohms. This configuration assures that the sensor will never supply more than 1 mA. The result of incrementing the resistance is the following plot of output voltage versus resistance.
The output voltage is not strictly linear, but is close enough to demonstrate the concept.
After the voltage divider stage a non-inverting amplifier is constructed as follows.
The parameters dialog in the top right of the screen capture is necessary for the DC sweep which generates the output graphs. R3 and R4 were chosen such that their ratio is equal to 9. This satisfies our requirement that the gain of our amplifier is approximately equal to 10. A plot of the output voltage as a function of R1 can be seen below.
It is evident that the output voltage is nearly identical to the input voltage with a gain of 10. Additionally, with the op amp in this configuration, the sensor is not delivering any current to the op amp, and thereby its voltage divider is not loaded. Our design is sound and we are free to move to the experimental phase.
Here is a photo of the circuit constructed on a breadboard. It is not quite as pretty as the schematic, but at least it has colors!
Design Question #1:
Determine the minimum static resistance in the voltage divider in order to prevent the sensor from providing greater than 1mA.
Constraint:
5V/R = 1mA
Solution:
R = 5 kohms
Design Question #2:
What should the maximum variable resistance of the voltage divider be in order to generate an output voltage to the op amp of 1V?
By using the voltage divider rule, the R value is found to be 1250 ohms.
Design question #3:
Determine the Thevenin Equivalent for the voltage divider.
By a judicious adjustment of the laboratory schematic, the Thevenin voltage and resistance are trivial. By connecting the output of the voltage divider to the non-inverting terminal instead of the inverting terminal the op amp will source no current from the voltage divider, thus allowing the op amp to operate in a more linear fashion.
As is evident in the table, the calculated gain is less than 1% different than the desired gain, and is within acceptable tolerances.
No comments:
Post a Comment