Op-amp Design Simulation - KiCAD8 Simulation

Thread Starter

sara mell

Joined Jul 8, 2024
11
Hello, I would very much appreciate it if anyone can help me understand why the following op-amp circuit is giving me wrong values in simulation. I use Kicad 8 for simulating this. The input voltage is 3.6V with current value of almost 30mA, I expect to recieve an output voltage of 3.3V and almost 30mA output so that can be supplied to ICs further down. The numbers make sense before the Q1 NPN, but after that, the numbers make no sense, including voltage and current numbers through resistors. Could you please tell me what could be wrong in this circuit? Thank you.
 

Attachments

dl324

Joined Mar 30, 2015
18,220
Welcome to AAC!
I expect to recieve an output voltage of 3.3V
If the zener voltage was exactly 2.4V (which it won't be), you should expect 3.2V from the transistor.

What is the supply voltage for the opamp? If it's 3.6V, it ain't gonna work.
almost 30mA output so that can be supplied to ICs further down.
There is nothing to limit current.
the numbers make no sense, including voltage and current numbers through resistors. Could you please tell me what could be wrong in this circuit?
How can we determine that for ourselves if you don't tell us what they are?

Why do you have unnecessary wire bends and so much "whitespace"?
 

WBahn

Joined Mar 31, 2012
32,703
Hello, I would very much appreciate it if anyone can help me understand why the following op-amp circuit is giving me wrong values in simulation. I use Kicad 8 for simulating this. The input voltage is 3.6V with current value of almost 30mA, I expect to recieve an output voltage of 3.3V and almost 30mA output so that can be supplied to ICs further down. The numbers make sense before the Q1 NPN, but after that, the numbers make no sense, including voltage and current numbers through resistors. Could you please tell me what could be wrong in this circuit? Thank you.
How can we tell you what is wrong with the numbers when you don't tell us what the numbers are? We are NOT mind readers.

You say that your input current is 30 mA. How much current is flowing in R3?

Apparently you want 3.2 V at your circuit output. Assuming you got that, how much current would need to flow through R4+R5?

In light of the above two questions, how can you expect nearly 30 mA to be available to follow-on ICs?

What does the voltage need to be, approximately, at the base of the transistor in order to get 3.2 V at the emitter?

What is the maximum output voltage of an LM358 that you can rely on, if it is powered from 3.6 V?

If you are powering the LM358 from some other supply, what is that voltage?

Have you looked at the datasheet for the LM358?

If not, do so. What is the minimum supply voltage the opamp needs in order to be able to drive the base of the transistor adequately?
 

dl324

Joined Mar 30, 2015
18,220
With 3.6V supply voltage you cannot get more than about 2V out of the op amp, and maybe about 1.3V out of the transistor emitter.
It gets worse. With a 3.6V supply, the input can't go above 2.1V. LM358 experiences output inversion when the input voltage range is violated.
1720494801518.png
 

ronsimpson

Joined Oct 7, 2019
4,647
A low dropout voltage (LDO) regulator is hard to make. 3.6V to 3.3V is only 0.3V of difference.
Don't make one just spend the 80 cents, I can get them for 30 cents.
These regulators are complicated and not stable. Do not try.
Long before LDO was a name I got a job because in the interview room there was a chock board with a specification of a power supply posted. Several of their engineers had tried and failed. While I was waiting, I put up a schematic. Each engineer entering the room asked who drew that? Dr. Webb, when he entered said "how simple, who did this?" Then he said "hired".
1720495836779.png
 

Thread Starter

sara mell

Joined Jul 8, 2024
11
How do you know the values are wrong?

Hi, thank you for your reply.

well, I think the values are wrong, becasue first at some points the current and voltage values are not even close to what I calculated on paper. And another reason I believe they are wrong, is because at some points I get negative values for voltages and currents. I’ve uploaded the graphs I get after simulating the circuit on KiCAD 8.

After Battery
The circuit is powered by a 3.6V Li-Ion battery that maximum provides 1.2A (the voltage can infrequently pulse to 3.67V, accroding to datasheet) . The first screenshot shows the voltage right after the battery (V_Net_BV1-Pad1_) and V(/n1), that starts from zero up to 3.67V which sounds about right.
Screenshot 2024-07-09 at 9.25.47 AM.png




Screenshot 2024-07-08 at 10.26.41 PM.png




Charging of capacitors C1 and C2
This part might be also ok, since the charging time that calculated also matches with what the simulation shows.

Screenshot 2024-07-08 at 10.31.28 PM.png





Around Diode (D1) and R3
I’m not sure if the current values passing through diode and R3 are correct. Based on what I calculated, the current should have been around 21 mA, but the graph shows 27 mA. The diode is a 2.7V Zener diode.


Screenshot 2024-07-08 at 11.01.17 PM.png





Around NPN transistor
The current and voltage values are teribbly low and scary to me, even some negative numbers as current in base and emitter of transmitter, only the voltage at collector looks find to me.


Screenshot 2024-07-08 at 10.33.04 PM.png


Screenshot 2024-07-08 at 10.32.34 PM.png


Screenshot 2024-07-08 at 10.31.58 PM.png


Screenshot 2024-07-08 at 10.31.07 PM.png





Resistors
The values for R4, R5, R6 don’t really make sense.


Screenshot 2024-07-08 at 10.33.43 PM.png
 

Thread Starter

sara mell

Joined Jul 8, 2024
11
It is hard to respond when I don't know the numbers. "wrong"
I assume the supply for the LM358 is 0V and 3.6V but I do not know that.
To get 3.3V out Q1-Base must be 3.9V. U1 cannot make 3.9V.
View attachment 326485
Thank you for your reply and the drawing you created.

I would appreciate it if you check the simulation and circuit drawing I’ve included in response to Papabravo.

Knowing that the supply voltage is 3.6V (max.3.67V), then do you suggest any other reliable method that I can use to ensure that the voltage is levelled down to 3.3V with minimum noise becoming ready for ICs further down?
 

Thread Starter

sara mell

Joined Jul 8, 2024
11
Welcome to AAC!
If the zener voltage was exactly 2.4V (which it won't be), you should expect 3.2V from the transistor.

What is the supply voltage for the opamp? If it's 3.6V, it ain't gonna work.
There is nothing to limit current.
How can we determine that for ourselves if you don't tell us what they are?

Why do you have unnecessary wire bends and so much "whitespace"?
Thank you for your reply.

I understand now your point, and my apologies if some parts of my work seems to be nonsense. I’m a chemist and this is part of a bigger project I’m doing. I started teaching myself electronics a couple of months ago.

The ICs I need to use further down the circuit, together draw 30mA in active mode and at sleep-modes it will be lower than 30mA. For the simulation numbers, I would appreciate it if you could check the pictures I uploaded in response to Papabravo above. Do you think op-amp is a good method to level down voltage and filter out current to make it ready to be fed to ICs at 3.3V? is there any other method you recommend? Do you think 5V power supply can solve the problem if we decide to keep the op-amp configuration?
 

Thread Starter

sara mell

Joined Jul 8, 2024
11
How can we tell you what is wrong with the numbers when you don't tell us what the numbers are? We are NOT mind readers.

You say that your input current is 30 mA. How much current is flowing in R3?

Apparently you want 3.2 V at your circuit output. Assuming you got that, how much current would need to flow through R4+R5?

In light of the above two questions, how can you expect nearly 30 mA to be available to follow-on ICs?

What does the voltage need to be, approximately, at the base of the transistor in order to get 3.2 V at the emitter?

What is the maximum output voltage of an LM358 that you can rely on, if it is powered from 3.6 V?

If you are powering the LM358 from some other supply, what is that voltage?

Have you looked at the datasheet for the LM358?

If not, do so. What is the minimum supply voltage the opamp needs in order to be able to drive the base of the transistor adequately?
Thank you for your reply and your questions.

Yes, you are absolutely right. I’m a chemist and a newbie in electronics. I started teaching myself electronics a couple of months ago, so my work may seem nonsense at some points :). I found a lecture note which in the lecturer was doing the calcualtions of op-amp, so knowing that the power supply gives 3.6V and I need 30 mA at maximum when ICs are in active mode with 3.3V output, I did the calculations. I also assumed the values for R1 and R2.

So, one question, knowing that the voltage drop is not significant (0.3V) do you recommend using op-amp method? or do you know if there are better methods to do the job? Do you think 5V power supply can solve the problem if we decide to keep the op-amp configuration (3.3V is still the output required)?



IMG_1625.heic


IMG_1626.heic


Screenshot 2024-07-09 at 10.57.59 AM.png
 

Thread Starter

sara mell

Joined Jul 8, 2024
11
View attachment 326523

With 3.6V supply voltage you cannot get more than about 2V out of the op amp, and maybe about 1.3V out of the transistor emitter.
Hi, thank you for your reply and the table you uploaded.

Do you think op-amp can be helpful for this circuit? or is there any other method to use? do you think increasing power supply to 5V from 3.6V would solve the problem?
 

Thread Starter

sara mell

Joined Jul 8, 2024
11
A low dropout voltage (LDO) regulator is hard to make. 3.6V to 3.3V is only 0.3V of difference.
Don't make one just spend the 80 cents, I can get them for 30 cents.
These regulators are complicated and not stable. Do not try.
Long before LDO was a name I got a job because in the interview room there was a chock board with a specification of a power supply posted. Several of their engineers had tried and failed. While I was waiting, I put up a schematic. Each engineer entering the room asked who drew that? Dr. Webb, when he entered said "how simple, who did this?" Then he said "hired".
View attachment 326526
Hi, thank you for your reply and thank you

Do you LDO can be an alternative to this op-amp configuration I suggested above? if not, what other methods than op-amp or LDOs do you recommend? If we can increase the supply power to 5V (while 3.3V output is still required) do you think the problem will be solved?
 

dl324

Joined Mar 30, 2015
18,220
Do you think 5V power supply can solve the problem if we decide to keep the op-amp configuration?
No.

A lightly loaded LM358 output is guaranteed to get within 3V of the positive supply. That would be 2V with a 5V supply. You need around 4V. We always use worst case specs unless you're going to cherry pick parts.
 

ronsimpson

Joined Oct 7, 2019
4,647
Do you LDO can be an alternative to this op-amp configuration I suggested above?
A LDO regulator is built for this job.
The op-amp circuit has many problems. If you do not understand, then get a LDO regulator. There are many different ones. Look for 100mV (or less) drop out voltage.
 

Irving

Joined Jan 30, 2016
4,996
The other thing to consider when using LiPo batteries to deliver a 3.3v supply is run-time. Even with a good LDO (<100mV) you will experience issues once battery voltage drops below around 3.45v. You haven't said what format of battery you are planning to use (cylinder, pouch, etc) or capacity (mAH). Its hard to estimate run time as most users want high currents down to 80% or 90% depth of discharge (DoD), which is typically to 2.7 or 2,5 volts. With a good quality (eg Samsung, Panasonic, etc) 18650 cylindrical cell at 2800mAH capacity your likely capacity to 3.45v is going to be around 1800 - 2000mAH - I know it sounds counter-intuitive, but you're not using a significant part of the discharge curve. Nevertheless, thats still 60 hours run time. With a small, say 450mA, pouch, you could be losing more than 50% capacity; even so that's still 7h run time.
 

Thread Starter

sara mell

Joined Jul 8, 2024
11
The other thing to consider when using LiPo batteries to deliver a 3.3v supply is run-time. Even with a good LDO (<100mV) you will experience issues once battery voltage drops below around 3.45v. You haven't said what format of battery you are planning to use (cylinder, pouch, etc) or capacity (mAH). Its hard to estimate run time as most users want high currents down to 80% or 90% depth of discharge (DoD), which is typically to 2.7 or 2,5 volts. With a good quality (eg Samsung, Panasonic, etc) 18650 cylindrical cell at 2800mAH capacity your likely capacity to 3.45v is going to be around 1800 - 2000mAH - I know it sounds counter-intuitive, but you're not using a significant part of the discharge curve. Nevertheless, thats still 60 hours run time. With a small, say 450mA, pouch, you could be losing more than 50% capacity; even so that's still 7h run time.
Thank you for your reply.
I was thinking of using SAFT LS 14250 primary Li-SOCL2 cells. Is this battery reliable you think? are there better choices?
 
Top