Driving a mosfet with Comparator

ArakelTheDragon

Joined Nov 18, 2016
1,362
Here is the circuit:

https://circuitdigest.com/electronic-circuits/supercapacitor-charger-circuit-diagram

It has low efficiency do to the "LM317 linear regulator used". Its for a "5.5V" capacitor which charges to "5V", you can put "2x2.5V" in series.

To me this circuit is not good. I recommend using an "LM2596 buck boost regulator" which has "93% efficiency" and just changing the state of the "enable pin" with an MCU.

And I attach my simulation with "LTspice". The "1k" resistor is a "pull down" resistor for the MOS.
1577122543884.png
 

Thread Starter

anishkgt

Joined Mar 21, 2017
549
Thanks. I doubt i would be able to complete it to get what i want. Now matter what i do i am just going round in cricles. If somebody could complete the schematic and then explain where i had gone wrong or failed to look at, i guess i could learn.
 

Thread Starter

anishkgt

Joined Mar 21, 2017
549
Maybe looking at something like SAB MOSFET or similar would be a better option than coming up something that require a ton of experience.
 

ericgibbs

Joined Jan 29, 2010
18,766
hi anish,
To summarise your requirement.
1. When the Vinp is < 1.5V you want Vout to be High.
2. If Vinp => 1.5V you want Vout to be Low.
3. If Vin -> 2.0V , what do you want Vout to be. High or Low.??
E
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
Check the link in the previous post(#21). Its the ready circuit with explanations. Its what you need. The MOSFET requires a certain voltage and current in order to work correctly. The comparator can not supply them. You don't care about the activation and deactivation time. The pull down resistor is all you need, it will drain away leakage current preventing random activation, also it will stabilize the voltage in order to activate or deactivate the MOS and prevent flip-flop effects. The problem is super capacitors(50F) are charged with a high current and stable voltage of "maximum voltage - 10%". You can use the comparator to drive the MOS, be careful what kind of voltage will be applied over the capacitor. Don't use a "current limiting" resistor for a "MOS", ever! I will make a simple circuit and give it to you. In order to use a comparator(schmit trigger type) you need dual power supply, which is bad. If you have any knowledge of programming it will be better to use an MCU to measure the voltage and turn the power supply on or off.

Do you want a circuit with a comparator, or with an MCU?

EDIT:
Your circuit looks good, but it will take me a long time to check it. In my previous post(#21), I gave you the comparator with hysteresis, it will get activated at "1.9V" and deactivated at "2.5V". But it needs a dual power supply. Also measuring a capacitor's voltage while its charging is a very bad thing. You need to disconnect the power supply, wait until the voltage settles and then measure the real voltage.
 
Last edited:

Thread Starter

anishkgt

Joined Mar 21, 2017
549
hi anish,
To summarise your requirement.
1. When the Vinp is < 1.5V you want Vout to be High.
2. If Vinp => 1.5V you want Vout to be Low.
3. If Vin -> 2.0V , what do you want Vout to be. High or Low.??
E
When Vin = 1.5v, Vout = HIGH (Charge, switch ON a MOSFET via driver)
When Vin = 2.5v, Vout = LOW (stop charge)
 

Thread Starter

anishkgt

Joined Mar 21, 2017
549
Check the link in the previous post(#21). Its the ready circuit with explanations. Its what you need. The MOSFET requires a certain voltage and current in order to work correctly. The comparator can not supply them. You don't care about the activation and deactivation time. The pull down resistor is all you need, it will drain away leakage current preventing random activation, also it will stabilize the voltage in order to activate or deactivate the MOS and prevent flip-flop effects. The problem is super capacitors(50F) are charged with a high current and stable voltage of "maximum voltage - 10%". You can use the comparator to drive the MOS, be careful what kind of voltage will be applied over the capacitor. Don't use a "current limiting" resistor for a "MOS", ever! I will make a simple circuit and give it to you. In order to use a comparator(schmit trigger type) you need dual power supply, which is bad. If you have any knowledge of programming it will be better to use an MCU to measure the voltage and turn the power supply on or off.

Do you want a circuit with a comparator, or with an MCU?

EDIT:
Your circuit looks good, but it will take me a long time to check it. In my previous post(#21), I gave you the comparator with hysteresis, it will get activated at "1.9V" and deactivated at "2.5V". But it needs a dual power supply. Also measuring a capacitor's voltage while its charging is a very bad thing. You need to disconnect the power supply, wait until the voltage settles and then measure the real voltage.
Yes i would be using a ATmega328. Can't use a dual supply tho, i mean i have never used it thats why.
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
Here is the circuit. I am using a simple "PIC10F200" only to demonstrate, your MCU must have an ADC and PWM module, this one does not. The "PWM" frequency and duty cycle control the current through the capacitor. The capacitor will try to drain as much current as it can. I put "2x100K" resistors to protect the MCU and divide the voltage in 2(the division is not really necessary). It works in the following way: when the capacitor is first connected(voltage over "0V"), the MCU measures the voltage and starts charging based on the voltage and expected current drain. After a little time, it shuts down the power supply and waits until the voltage stabilezes, checks it and if necessary starts charging again. You can remove the down "100K resistor".

EDIT:
If necessary also change the up "100K resistor" to "10K", it would be better. The MOS has to be picked properly and a heat sink added if necessary. The MOS must be activated by the MCU voltage directly and have a low "Vgate souce threshold" and a low "Rdrain-source on". The voltage applied over the transistor will be "current through the capacitor * Rdrain source on". If necessary add another MOS transistor in order to divide the wattage between the 2.

1577129358573.png
 

ci139

Joined Jul 11, 2016
1,898
Re : #12 , #13 :: made a virtual test a while ago (notice pulse shapes/slopes/voltage-levels ...) ← good but expensive comparators
/// -- mostly (but not always) are the amplifier capabilities illustrated by it's capability to "self-drive" -- e.g. -- oscillate

comp~osc_compared.png

about
LT1715 4ns, 150MHz Dual Comparator with Independent Input / Output Supplies20mA)
LT1719 4.5ns Single / Dual Supply 3V / 5V Comparator with Rail-to-Rail Output20mA)
LT1711 / LT1712 Single / Dual 4.5ns, 3V / 5V / ±5V, Rail-to-Rail Comparators20mA)
LT1394 7ns, Low Power, Single Supply, Ground-Sensing Comparator20mA)
+ LT1720 / LT1721 Dual / Quad, 4.5ns, Single Supply 3V / 5V Comparators with Rail-to-Rail Outputs20mA) (( ← used this in conjunction with 74HCxxx CMOS ))
 
Last edited:

ArakelTheDragon

Joined Nov 18, 2016
1,362
And of course best circuit of all:

EDIT: no PWM is needed, the transistor just has to be activated by the MCU voltage, it only needs a low "Vgate source threshold". No heatshink is needed for the transistor. The rest is handled by the relay. Relays already have a lot of versions for high current.

1577130481639.png
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,766
When Vin = 1.5v, Vout = HIGH (Charge, switch ON a MOSFET via driver)
When Vin = 2.5v, Vout = LOW (stop charge)
What if Vin is < 1.5V, I assume you would want the charge ON
So if that is correct, all thats needed is a 2.5V level to turn OFF the Charge, until the Vin falls below <= 1.5V, is this what you are asking.?
E
 

Thread Starter

anishkgt

Joined Mar 21, 2017
549
What if Vin is < 1.5V, I assume you would want the charge ON
So if that is correct, all thats needed is a 2.5V level to turn OFF the Charge, until the Vin falls below <= 1.5V, is this what you are asking.?
E
Yes below 1.5v it would still charge. And cut off at 2.5v
 

Thread Starter

anishkgt

Joined Mar 21, 2017
549
And of course best circuit of all:

EDIT: no PWM is needed, the transistor just has to be activated by the MCU voltage, it only needs a low "Vgate source threshold". No heatshink is needed for the transistor. The rest is handled by the relay. Relays already have a lot of versions for high current.

View attachment 195196
I am doubt relay would be a good option here moreover don't have free pins to use for 3 relays. That was why i wanted an indipendent module to care of the charging of the caps. The project is a spot welder hence those caps can put out close to 1000A and at those current the relay contacts may weld together. The turn on time is at a max of 200ms but always between 10 to 150ms.
 

ericgibbs

Joined Jan 29, 2010
18,766
Yes below 1.5v it would still charge. And cut off at 2.5v
hi anish,
One more point, the above requirement is not a problem,
BUT,
do you want the charge to restart as soon the Vin falls < 2.5V
OR,
do you only want the charge to restart when Vin falls to < 1.5V. [OR some other intermediate value?]

IF the charge has to restart as soon as Vin falls below 2.5V, it will be forever switching the charge On/Off.

E
 

Thread Starter

anishkgt

Joined Mar 21, 2017
549
hi anish,
One more point, the above requirement is not a problem,
BUT,
do you want the charge to restart as soon the Vin falls < 2.5V
OR,
do you only want the charge to restart when Vin falls to < 1.5V. [OR some other intermediate value?]

IF the charge has to restart as soon as Vin falls below 2.5V, it will be forever switching the charge On/Off.

E
Not as soon as it drops to 2.5v but 1v.
Vin <1 = ON
Vin >2.5 = OFF
Window is between 1 and 2.5

I can't seem to open the file in LTSpice, some file 'XOPAMP' seems to be missing.
 

Thread Starter

anishkgt

Joined Mar 21, 2017
549
Amazing ! to me. What is the calculation behind it and considerations taken into account when selecting a comparator?
 
Top