Ah yes i see it cant go lower than 0V but expected output is negative. Thanks. So what can I do to add v1 and v2?I don't know what you expect the output to be. If you power the opamp from bipolar rails, the output would be -3 V. But if you insist on making the negative supply rail 0 V, how reasonable is it to expect the output to be correct? It's going as low as it can.
Do you understand how this configuration implements a summing function?
Provide a negative power rail.Ah yes i see it cant go lower than 0V but expected output is negative. Thanks. So what can I do to add v1 and v2?
In the schematic V1 is taken from charging battery positive side whose voltage goes up as it charges. V2 is a node between series resistor between 12.5V supply. Its parital circuit shown. V2. Is not real voltage supply you see. However i do need to add those voltages. I cant get negative rail from wall mounted 120V adapter that converts to 12vdc.Provide a negative power rail.
If you don't want the polarity inversion, then you can either invert the inputs or the output, but either approach is going to entail having that negative rail.
If you must only have a single supply, then you can bias your inputs and output accordingly. You will need to decide how you deal with that bias in the final result.
I have no idea what it means for a node to be "between series resistor between 12.5 V supply."In the schematic V1 is taken from charging battery positive side whose voltage goes up as it charges. V2 is a node between series resistor between 12.5V supply. Its parital circuit shown. V2. Is not real voltage supply you see. However i do need to add those voltages. I cant get negative rail from wall mounted 120V adapter that converts to 12vdc.
Let me explain from scratch. You already know that I am building circuit to turn my landscape light on and off from this forum: ambient temperature problem | All About CircuitsI have no idea what it means for a node to be "between series resistor between 12.5 V supply."
Could you provide a more details sketch of your actual application?
What is the purpose of adding these two voltages together?
How accurate does the resulting sum need to be?
What is the range of voltages that need to be summed?


sorry buddy to confuse everyone. However problem Y charging relates to Problem X summing voltage because summing voltage is needed to keep 100mA constant for Problem Y.This does not make any sense. It is a typical X,Y problem. You are trying to solve problem X but the real problem is problem Y.
You want to charge a battery with 100 mA constant current and stop charging when the battery voltage reaches 8.4 V. That is problem Y. It has nothing to do with problem X.
In your schematic, my Rload is my battery I suppose. Battery has fixed internal resistance I think. You realize I need to sink the 100mA current into the battery not out of the battery. So voltage between at Out terminal always has to be greater than the battery voltage. Thats the only way it can charge. What would be the voltage at Out terminal? Is it constant? Is it varying? If it is varying then is it greater than battery voltage all the time? Keep in mind battery voltage also increase as it charges.I don't see how you came to that conclusion. You can build a 100 mA constant current source without using a summing amplifier.
View attachment 360763
The output voltage of the regulator will be whatever it needs to be, subject to being no more than Vin less the dropout voltage, in order to make the programmed current flow through R1 (and, hence, into the load).In your schematic, my Rload is my battery I suppose. You realize I need to sink the 100mA current into the battery not out of the battery. So voltage between R1 and Rload always has to be greater than the battery voltage. Thats the only way it can charge. What would be the voltage between R1 and Rload? Is it constant? Is it varying? If it is varying then is it greater than battery voltage all the time? Keep in mind battery voltage also increase as it charges.
I meant what would be voltage at out terminal of lm317. See edited previous post. Will it adjust itself so that current sinks into battery?The output voltage of the regulator will be whatever it needs to be, subject to being no more than Vin less the dropout voltage, in order to make the programmed current flow through R1 (and, hence, into the load).
If the load is the battery, then the voltage between R1 and Rload will simply be the battery terminal voltage.
This will give you a constant current charging current, but it will not prevent overcharging. That requires some additional circuitry, which could be as simple as a transistor and voltage divider that will shunt the 100 mA around the battery.
How the regulator works is it adjusts the output voltage so that there is a 1.25 V difference between Vout and Vadjust. So the output voltage will me 1.25 V higher than the battery terminal voltage. If R1 is a 12.5 Ω resistor, this will result in 100 mA flowing into the battery.I meant what would be voltage at out terminal of lm317. See edited previous post. Will it adjust itself so that current sinks into battery?
Any where cheap I can get LM317?How the regulator works is it adjusts the output voltage so that there is a 1.25 V difference between Vout and Vadjust. So the output voltage will me 1.25 V higher than the battery terminal voltage. If R1 is a 12.5 Ω resistor, this will result in 100 mA flowing into the battery.
You might spend some time reviewing the LM317 data sheet. It contains several example circuits, including a few battery charger circuits.
I have no idea what sources you have access to for electronic components. But wherever you get parts from, they almost certainly have LM317 regulators -- they are very ubiquitious.Any where cheap I can get LM317?