Constant current source problem

Thread Starter

psoke0

Joined Mar 31, 2017
196
With your 1 ohm sense resistor the current should be about 700 mA. So the 690 mA when the output is shorted is about right. What is the MEASURED voltage input to your circuit when the output is shorted. In other words what is the voltage from your supply that you claim is 5.1 volts when it is providing 690 mA of current ?

Les.
okay Les. i measured it and its measuring 4,75 v under that load there is something horribly wrong here :( my power supply is old computer atx :( do you think when i conencting my battery because of that voltage drop that is why cant give 690 mA to the battery ?
 

LesJones

Joined Jan 8, 2017
4,189
Yes. If you subtract the voltage across the current sense resistor and the battery voltage then you have nothing left for Q2 to work with. This is what I think we have all suspected from the start but it has taken 61 posts to get you to check it. Are you using the 5 volt auxiliary output or the main 5 volt output of the ATX power supply ? You would be better off starting with a 6 or 9 volt wall wart type power supply.

Les.
 

Thread Starter

psoke0

Joined Mar 31, 2017
196
Yes. If you subtract the voltage across the current sense resistor and the battery voltage then you have nothing left for Q2 to work with. This is what I think we have all suspected from the start but it has taken 61 posts to get you to check it. Are you using the 5 volt auxiliary output or the main 5 volt output of the ATX power supply ? You would be better off starting with a 6 or 9 volt wall wart type power supply.

Les.
omg. i didnt know that under load the voltage should not drop. thank you for that information. i take the desktop power supply and open it and i found red and yellow wires. red one gives 5,1 v and yellow ona gives 12 v output . voltage supposed to be not drop. i think my power supply is not good :( but what im planing to do is to use phone chargers to run this curcuit so i can just plug the usb cable to the adapter and charge the battery with this curcuit :( do you think these days phone chargers can handle 1 amp at 5,1 v ?
 

Thread Starter

psoke0

Joined Mar 31, 2017
196
omg. i didnt know that under load the voltage should not drop. thank you for that information. i take the desktop power supply and open it and i found red and yellow wires. red one gives 5,1 v and yellow ona gives 12 v output . voltage supposed to be not drop. i think my power supply is not good :( but what im planing to do is to use phone chargers to run this curcuit so i can just plug the usb cable to the adapter and charge the battery with this curcuit :( do you think these days phone chargers can handle 1 amp at 5,1 v ?
okay i think i have to test them and see if they can stay still with that much of amp draw
 

LesJones

Joined Jan 8, 2017
4,189
I think even with exactly 5.1 volts you are working with a very tight voltage margin. You first need to confirm that your circuit workes correctly when supplied with 5.1 volts. I have no idea what range of voltages and currents phone chargers give out. The only one I have is rated at 5.0 volts and 350 mA. I have seen a number of USB power supplies rated at 5.0 volts an 1 amp.

Les.
 

Thread Starter

psoke0

Joined Mar 31, 2017
196
I think even with exactly 5.1 volts you are working with a very tight voltage margin. You first need to confirm that your circuit workes correctly when supplied with 5.1 volts. I have no idea what range of voltages and currents phone chargers give out. The only one I have is rated at 5.0 volts and 350 mA. I have seen a number of USB power supplies rated at 5.0 volts an 1 amp.

Les.
yes i will do that. if you are saying that its is tight voltage im working with then how do the tablets and phone battery charging circuitry manage to do that. are they using special mosfet or transistors for that
 

LesJones

Joined Jan 8, 2017
4,189
They will probably use special chips designed to charge lithium cells from 5 volts. The chip would have an op amp for comparing the voltage across the current sense resistor with a much lower reference voltage than 0.7 volts that is used in your circuit. You will be able to find suitable chips if you type in something like "lithium battery charging IC" into a search engine. The LTC1734 is one that looks like it would do what you want.

Les.
 

Thread Starter

psoke0

Joined Mar 31, 2017
196
They will probably use special chips designed to charge lithium cells from 5 volts. The chip would have an op amp for comparing the voltage across the current sense resistor with a much lower reference voltage than 0.7 volts that is used in your circuit. You will be able to find suitable chips if you type in something like "lithium battery charging IC" into a search engine. The LTC1734 is one that looks like it would do what you want.

Les.
or we can search for low collector emiter saturation voltage transistors :)
 

LesJones

Joined Jan 8, 2017
4,189
Q2 should not be running in saturation in this application. The limiting factor is the base emitter voltage of Q1 All silicon transistors will have about the same value of about 0.7 volts. Using a germanium transistor would be the only way to reduce this value. I would not recommend that as a solution. You could use the other half of your op amp to compare the voltage across the current sense resistor with a reference voltage from another TL431A and potential divider. You could try a reference voltage of 0.2 volts which would gain you 0.5 volts. (You would need to reduce R1 to 0.29 ohms)
You could also use the electronics ftom one of the powerbanks that one of the pound shop chains sell. The IC in the one I bought is a M9833E but I can't find a datasheet for it. That draws about 500 mA when charging from 5.0 volts so it is close to your requirements
Les.
 
Last edited:

Thread Starter

psoke0

Joined Mar 31, 2017
196
Q2 should not be running in saturation in this application. The limiting factor is the base emitter voltage of Q1 All silicon transistors will have about the same value of about 0.7 volts. Using a germanium transistor would be the only way to reduce this value. I would not recommend that as a solution. You could use the other half of your op amp to compare the voltage across the current sense resistor with a reference voltage from another TL431A and potential divider. You could try a reference voltage of 0.2 volts which would gain you 0.5 volts. (You would need to reduce R1 to 0.29 ohms)
You could also use the electronics ftom one of the powerbanks that one of the pound shop chains sell. The IC in the one I bought is a M9833E but I can't find a datasheet for it. That draws about 500 mA when charging from 5.0 volts so it is close to your requirements
Les.
okay i understand thank you Les :)
 

crutschow

Joined Mar 14, 2008
34,420
Below is the LTspice simulation of the circuit modified to use another comparator in the package to generate the constant current.
This allows the voltage across R1 to be much lower (100mV in the simulation) to provide more voltage headroom.

I changed to the LM339 comparator which simplified the circuit, since it has an open-collector output, allowing simple ANDing of their outputs.
(Compensation capacitor C1 allows comparator U5 to operate as an op amp.)

I also changed the BJT to an N-MOSFET to better handle the high current.
M1 needs to be a logic-level type with the ON resistance, Rds(on) specified at a Vgs of 5V or less (threshold voltage, Vth, typically about a volt or so).

The reference voltage for the constant-current is provided by added TL431 reference, U4.
It generates 2.5V which is reduced by voltage divider R2 and R7 to 100mV.
This gives a charging current of 0.5A with R1=0.2Ω.

I added pot U3 to allow precise adjustment of the charge cutoff voltage.

upload_2017-4-2_12-8-59.png
 

Attachments

Last edited:

Thread Starter

psoke0

Joined Mar 31, 2017
196
Below is the LTspice simulation of the circuit modified to use another comparator in the package to generate the constant current.
This allows the voltage across R1 to be much lower (100mV in the simulation) to provide more voltage headroom.

I changed to the LM339 comparator which simplified the circuit, since it has an open-collector output, allowing simple ANDing of their outputs.
(Compensation capacitor C1 allows comparator U5 to operate as an op amp.)

I also changed the BJT to an N-MOSFET to better handle the high current.
M1 needs to be a logic-level type with the ON resistance, Rds(on) specified at a Vgs of 5V or less (threshold voltage, Vth, typically about a volt or so).

The reference voltage for the constant-current is provided by added TL431 reference, U4.
It generates 2.5V which is reduced by voltage divider R2 and R7 to 100mV.
This gives a charging current of 0.5A with R1=0.2Ω.

I added pot U3 to allow precise adjustment of the charge cutoff voltage.

View attachment 123804
thank you :D but i have a question about old circuit. if lets say im going to use 12 v supply and i changed the values for that input voltage and its just gives me what i want 700 mA and will shut the power when battery at 4,10 v. Beautiful everything is fine. now the question is if i use this curcuit and connect it to the tablet battery while tablet is running is it goingto do damage ? i think it shouldnt because the curcuit will give max current of 700 mA and if tablet wants lets say 300 mA then battery will get charged at the same time with 400 mA of current right ?
 

crutschow

Joined Mar 14, 2008
34,420
thank you :D but i have a question about old circuit. if lets say im going to use 12 v supply and i changed the values for that input voltage and its just gives me what i want 700 mA and will shut the power when battery at 4,10 v. Beautiful everything is fine. now the question is if i use this curcuit and connect it to the tablet battery while tablet is running is it goingto do damage ? i think it shouldnt because the curcuit will give max current of 700 mA and if tablet wants lets say 300 mA then battery will get charged at the same time with 400 mA of current right ?
Yes.

But you should use the circuit with the TL431 to establish the cutoff voltage so it doesn't depend upon the stability of the 12V supply voltage, since Li ion batteries are very fussy :eek: about being overcharged.
 
Last edited:

Thread Starter

psoke0

Joined Mar 31, 2017
196
Yes.

But you should use the circuit with the TL431 to establish the cutoff voltage so it doesn't depend upon the stability of the 12V supply voltage, since Li ion batteries are very fussy :)eek:) about being overcharged.
you and Les. are awesome :D i learned alot from you guys its just like im drowning in to knowledge :D you have answered alot of question has been in my mind for a long time :D thank you so much :D
 
Top