# Summing Op-amp 4558 mod needing help

#### JessyM

Joined Oct 11, 2019
8
Hello, I'm new here and with minimal knowledge to electronics, I'm working part time for an electronics company to help fund my studies. I am faced with the following inverting op-amp circuit to modify R2 to work with a potentiometer instead. V1=-15 and V2=+5 and actually 7 resistors (390K - 47k) at the node "A" where only 1 at a time is selected according to a panel selection so that Vout drops from +1v ~ 0.2v. (i'm pretty sure that's what I measured). Originally controlled from a microprocessor thru a 4051 that selects the resistors according to the panel selection. I hope this all makes sense to someone. First, I don't understand how to write out the KCL the negative supply and current flow are confusing me. Btw, does anyone know of a free simulation app to help me with this kind of thing? thank you all in advance, have a great day

#### Attachments

• 40.9 KB Views: 48

#### crutschow

Joined Mar 14, 2008
26,053
I don't understand how to write out the KCL the negative supply and current flow are confusing me.
It's quite simple.
You just assume an ideal op amp (which works well for most applications) which means the (-) input is a virtual ground (stays at 0V).
Then the current through the input resistor is simply Vin / Rin.
To maintain the (-) input at 0V means the current through the feedback resistor must be the same or Vout / Rfb (R3).

This means for a positive voltage input, the output voltage must be negative, and vice versa.
does anyone know of a free simulation app to help me with this kind of thing?
Several of us on this site use the free LTspice from Analog Devices.
It's a powerful analog simulator but has a somewhat steep learning curve.
That is helped by several available tutorials and many sample circuits that show how it works, as well help from us here.
It's well worth learning.

Edit: Below is the LTspice simulation of a simple op amp inverter circuit with a gain of -2 (similar to the one you posted):

Last edited:

Joined Mar 10, 2018
4,057

#### JessyM

Joined Oct 11, 2019
8
Thank you so much for the help. I kind of worked out the formulas but it seems that the voltages are not adding up (or subtracting) as they should. Vout=R3/R3+R1xV1 and with the added resistors Vout=R3xV1/R1 + R3xV2/R2. R3 is actually 10K not 100K resistor.
I get Vout=1.128V without the added resistors but when I plug the values into the other formula, the voltage seems to increase instead of decrease down to zero, what am I doing wrong? Btw, thanks for the plugs on those apps, I will try them out.

#### ericgibbs

Joined Jan 29, 2010
11,637
hi Jessy,
Does this LTSpice circuit show the basics of your design, please Edit the image as required so that we can see what you have in mind.
I have used 47k values for all the '7' resistors, change the value to suit.

E

#### Attachments

• 61.7 KB Views: 18

#### ci139

Joined Jul 11, 2016
1,696
Practical circuit to calibrate for a specific potentiometer -- a Falstad Simulation

More determined v. -- Falstad
... it seems i passed an unnecessary dis-improvement : fixed v. -- Simulation
( drag upper pot's slider left and set 1.0V by middle pot.m's slider . . .
.. drag upper pot's slider right and set 200mV by lower pot.m )

+ a Basic , Simple ( , Supply dependent ) Simulation ← it uses a full possible input range and divides it down to required scale (so it's less susceptible to any ripple) . . . is less precise and less stable than prev. v but uses a lot less parts

Last edited:

#### JessyM

Joined Oct 11, 2019
8
@ericgibbs, here is the drawing, tried my best to represent the actual circuit. Btw, the +5V comes from a 4051 thru the resistors. only 1 resistor is selected at any given time to reduce the Vout from +1V down to 0.2v.
thank you everyone else for your advice and ideas, much appreciated

@ci139, what is this simulation software? thank you everyone

#### Attachments

• 126.8 KB Views: 19

#### ericgibbs

Joined Jan 29, 2010
11,637
hi J.
I will try a sim and post the results.
I guess you are aware that the 4051 requires a Vcc of +10v in order to switch +5v signals.?
Also the internal resistance of the 4051 will have a small affect on the 'gain'

E

#### ericgibbs

Joined Jan 29, 2010
11,637
hi,
This is a rough LTS sim of your circuit, I had to change a 47k to 50k to give a 0Vout.
Are these steps within accepted tolerances for your project.?
E

Update:
Note: the outputs of the 4051 resistor drive pins must be at 0V when not selected, do NOT allow them to 'TriState' ie float, as that would slightly affect the 'gain'

#### Attachments

• 35.9 KB Views: 8
Last edited:

#### JessyM

Joined Oct 11, 2019
8
Hi that's what the circuit does, but what I need to know is how does the circuit work? Where and how does the voltage/current flow to be able to drop down from 1V to 0V. The 4051 is irrelevant as it will be removed in the redesign of the panel and a pot will replace all 7 resistors to save some space. Help me understand how I can achieve this mod with the pot, I tried the equations in my previous post but I'm doing it wrong, I should be getting less voltage instead of more. I can't throw parts at something if I can't explain how it works. thank you for you help

#### ericgibbs

Joined Jan 29, 2010
11,637
hi.
Why did you start the Thread describing a 7 resistor network and using a 4051 to select the resistors, when you intended using a potentiometer.???

If you use a Pot, how will you know what value the Pot is set too, in order to give say, 7 voltage steps.?

E

#### ci139

Joined Jul 11, 2016
1,696
(more bugs found : a master update)

(( mis-referenced formula discovered & removed -- see .docx ))

a missing but used as a default → ref.

the practical use of this identity is to predict the V.out so that V.-in = 0 ... e.g.

s
PS! , note : (± ΔU.-in) = [ /!\ ] = (– U.-in) , e.g : R1NEXT = R1PREVU.-in·R1'
_____________

use excel or other PC math tool /!\ revised = used a formula from different R naming scheme ... there were bugs previously
• set value for R1 (the Vout increases if R1 (-- offset to neg. vtg.) decreases)
• set value for R3 (the Vout increases if R3 (-- offset to pos. vtg.) increases)
• set value for Vout
• compute V-in

• V-in < 0 → decrease R1 OR increase R3
• V-in > 0 → increase R1 OR decrease R3
otherwise you need to derive a formula for Vout (might be tricky complicated and error prone due the V.-in = ±0V = V.+in) . . . maybe and not
(the Microsoft Word (?why they hire inadeqate stuff) crashed so the following has sign errors ...)

(( updated at .docx & on the fig. ↑ above ↑ ))

the last formula suggests you want to modify the Neg. going resistor -- e.g. -- R1 (see .xlsUpdate with successive approximation feature for R1)

#### Attachments

• 1.6 KB Views: 1
• 23.7 KB Views: 2
• 81 KB Views: 2
• 24.7 KB Views: 2
Last edited:

#### JessyM

Joined Oct 11, 2019
8
@ericgibbs, all we care is that the voltage drops from 1v - 0v with the pot. don't care about the steps as its not digitally controlled anymore. I just gave an example of the existing circuit to be modified. sorry if you didn't get that..
What is confusing is that normally you turn the pot clockwise and expect the voltage to increase, in this case the voltage has to decrease from 1v - 0v...I don't know is this possible?

@ci139..Ughh!! seriously.. I guess I asked for it!! let me see if I can even start to digest that...OMG!!

#### ericgibbs

Joined Jan 29, 2010
11,637
hi jessy.
This is what you get when using a Pot instead of the individual resistors, the lines on the plot represent the Vout for those 'original' values.
To get a direction change in voltage when turn the POT, just swap over the two outer wire to the Pot.

E
Note the Pot range is from 50K thru 390k.
So to get that range from a Pot, use a 50k fixed resistor in series with a 340k Linear Pot.
As 340k Pot may be difficult to source, you may have to compromise in using say a 500k Pot and marking an end stop at 340k.

E

#### Attachments

• 61.1 KB Views: 8

#### ericgibbs

Joined Jan 29, 2010
11,637
hi,
This modified circuit maybe a better option. [ Reverse the Pot end wire to change the voltage direction]
E

#### Attachments

• 56.8 KB Views: 19

#### ci139

Joined Jul 11, 2016
1,696
Random "Voltage" -- a tinkercad's (interactive) simulation

+ a less fuzzy ver. of it

!!! tinkerCad is a nightmare -- unless you're the simulators' expert and know how to fool this particular one !!! = use as the last option or better don't
__

guess I asked for it!! let me see if I can even start to digest that...OMG!!
i must admit being a bit sick and slow at this time (just doing something to keep me busy by ... anything)

there is no musts -- if you don't require something or can't yet understand something -- ignore it -- it'll be avail here for couple of years (at least) -- you only need to index (bookmark) it for further purposes (to be to allocate find it then)

if you still haven't found your solution -- keep asking what you need for it ...

Last edited:

#### JessyM

Joined Oct 11, 2019
8
Thank you so much guys, I really appreciate it. I will breadboard this circuit to see if it works well on its own and in the existing circuit and it its good, I will move on to the next stage.. inserting a waveform in that circuit to go from 1V > waveform, square or triangular
Keep you posted.. Have a great evening

#### JessyM

Joined Oct 11, 2019
8
@ericgibbs, the circuit works beautifully, only thing its drops and stays at about 320mv. Also, I noticed with the 45K resistor before the pot, it drops my Vout to 500mv and without it +1.04V . Maybe I'll try to make a 390k with the 500k pot and a parallel resistor?
thank you

#### ericgibbs

Joined Jan 29, 2010
11,637
hi,
Sometimes it is necessary to use a 'trim pot' to get the exact value of a resistor.
Let us know how it goes.
E