Electronics > Beginners

Need assistance in calculating resistors in a differential amplifier

(1/4) > >>

mitrynicolae:
Hello guys

I need your assistance in calculating R1 R2 R3 and R4 resistors from the attached schematic. The requirements are that at 25V the opamp should output 2V and the opamp should be powered from a single 5V supply.

Also please let me know if what I am trying to achieve is correct.
- if the base of the transistor is off and no battery is connected then the opamp should output 0V
- if the base of the transistor is on but  no battery is connected then the opamp should output 2V
- if the base of the transistor is on and the battery is connected then the opamp should output a value between 0 and 2 volts depending on the battery resistance (RL is used to simulate this resistance)
- if the base of the transistor is off but a 12V battery is connected then the opamp should output 0.96V
- if the battery is placed by mistake in reverse and the base of the transistor is off then the output should be 0.

Also please let me know the following:
1. is what I am trying to achieve correct or not?
2. in case of the reverse voltage on the opamp (+ and - not the supply), will the opamp survive?
3. what resistors I should change with potentiometer (only one if possible) in order to have possibility to adjust the output in case the resistors are not precise
4. is there any other method to measure the voltage between the specified points
5. regarding my schematic, could you also post the equations that lead to the calculated values or at least how you deduce them?

P.S. Please note that RL only simulates the battery internal resistance.

radiolistener:
Here is very nice video from Dave which explains how it works:

alex.martinez:

--- Quote from: mitrynicolae on April 06, 2019, 07:43:24 pm ---Also please let me know if what I am trying to achieve is correct.
- if the base of the transistor is off and no battery is connected then the opamp should output 0V
- if the base of the transistor is on but  no battery is connected then the opamp should output 2V
- if the base of the transistor is on and the battery is connected then the opamp should output a value between 0 and 2 volts depending on the battery resistance (RL is used to simulate this resistance)
- if the base of the transistor is off but a 12V battery is connected then the opamp should output 0.96V
- if the battery is placed by mistake in reverse and the base of the transistor is off then the output should be 0.


--- End quote ---

You have two batteries in the system...I have no clue of which one you are talking about...


--- Quote from: mitrynicolae on April 06, 2019, 07:43:24 pm ---2. in case of the reverse voltage on the opamp (+ and - not the supply), will the opamp survive?

--- End quote ---
It should, +-32 V of input common mode, you can check the datasheet of the LM324AD


--- Quote from: mitrynicolae on April 06, 2019, 07:43:24 pm ---3. what resistors I should change with potentiometer (only one if possible) in order to have possibility to adjust the output in case the resistors are not precise

--- End quote ---

By a resistor being not precise, you mean if their tolerance is too large? What it is done to avoid this is to use high component values (100 k for instance) so that the tolerance is not so critical in general. But if you worry about acurracy, grab a decent multimeter and measure the components, adding pots all over the place ends up being messy. If you want tunability, add pots on small resistors (1 k, 5 k...)


--- Quote from: mitrynicolae on April 06, 2019, 07:43:24 pm ---4. is there any other method to measure the voltage between the specified points

--- End quote ---
I do not know whether you refer to mesuring the voltage in the simulator or in a physical sense...but I would suggers you that you post more info...


--- Quote from: mitrynicolae on April 06, 2019, 07:43:24 pm ---5. regarding my schematic, could you also post the equations that lead to the calculated values or at least how you deduce them?

--- End quote ---
They have posted an opamp tutorial prepared by Dave, I strongly advice that you watch it and try to understand the system, rather than guessing values from a simulator.

mitrynicolae:
Thank you Martinez for your time!

Meanwhile I figured out the solution. The issue was in my logic. For the sake of simplicity let's consider that the supply voltage is 20 volts. I then divided this voltage to 10 and got 2V on the positive input of the opamp. Then I have set the R3 and R1 in order to match the R2 and R4. The issue was that the output voltage excedeed 2V. Which if you think about it is absolutely normal. The opamp tries to match positive input with the negative input by compensating with the output. In my case R1 and R3 acts as a voltage divider. The maximum voltage that the opamp can measure is when the positive input of the opamp is 2V and the R1 is conected "ground". This can be achieved by turning on the transistor and disconnect the load. Since the opamp will try to match the positive input with the negative input (at 2V) and since the R1 and R3 act as a voltage divider, and since R1 is connected to ground (we already demonstrated that) then we can calculate the required output.
(Vout-V2)/R3 = V2/R1
R1Vout - R1V2 = R3V2
Vout = (R1+R3)V2/R1
After applying the actual values we can determine that the Vout is aprox 2.2V which also the simulation suggested.

Thank you all for the answers. Sometimes even if you know the theory you just think that it will be easier to play around with the values. It turned out that with electronics is different and you can get quickly very frustrated when in fact the solution was to take a paper and a pencil and calculate the values. After a night of sleep I found the logical gap in the design and I have recalculated the values. I have attached a schematic of the actual (working) design. I know that I should use greater resistor values in order to not waste the current but I have a lot of 1k and 10k resistors and I don't want to buy other resistors.

For others who might face the same issue I also suggest this site: "https://www.electronics-tutorials.ws/opamp/opamp_5.html".

@martinez the external battery is marked on the schematic with a rectangle with + and - signs having the text "ExternalBattery". (You did not see this coming  :-DD :-DD :-DD)

mitrynicolae:
P.S. The fine tuning potentiometer should be placed in series with R3. We all know that resistors (even at 1% tolerance) will not be spot on and we need a way to fine tune the output. In this case R3 should be 9.5k (9.53k is the closest that you can buy) and a potentiometer of 1K. This will allow a correction of 5% up or down.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod