Voltage comparator

Thread Starter

Misieek

Joined Mar 17, 2021
34
Hello guys!

I want to build some kind of voltage comparator, which will turn the P MOSFET transistor on (conduct), when the voltage drops below threshold voltage, given by the zener diode. I want to achieve small hysteresis, and fast response. The supply voltage is 12V.

I figured out something like this... but the hystheresis is around 0.5V which is too much, and sometimes the mosfet heats up.
1616021658969.png
What can I improve? :)
 

Thread Starter

Misieek

Joined Mar 17, 2021
34
Why not use an actual comparator?
Hmm, I think that to compare that voltage I would have to supply the comparator with higher voltage than I actually want to measure. That would force me to use boost step-up converter. That leads to reduction in simplicity, but I would do that if there is no simpler solution.
 

AlbertHall

Joined Jun 4, 2014
12,345
Your circuit has a 12V supply and a 15V zener. That zener will never conduct so the MOSFET will be always on.
I am confused. What is this circuit supposed to do?
 

Thread Starter

Misieek

Joined Mar 17, 2021
34
Your circuit has a 12V supply and a 15V zener. That zener will never conduct so the MOSFET will be always on.
I am confused. What is this circuit supposed to do?
Yeah, you're right, that can be confusing. I want to use this circuit as a voltage reglator for car genrator. When mosfet conducts, the current flows through the rotor, increasing voltage in car instalation to 15V. When the voltage reaches that value, the mosfet cuts off the current, so the voltage drops down. This process occurs constantly, making car voltage remain around 15V.
 

Thread Starter

Misieek

Joined Mar 17, 2021
34
No, you can divide down the input voltage and compare to a lower voltage. For example, two equal resistors to divide the voltage in half, then compare to 7.5V.

Bob
Great idea @BobTPH ! I utilized LM358 and it compares voltage well. One more thing left to do. I don't know how to drive mosfet since the output voltage 15V would be too great for IRF4905's gate.

Can I divide it one more time using zener diode 4V, and 100k resistor? Wouldn't be that too much output current for LM358?
 

AnalogKid

Joined Aug 1, 2013
10,986
There is no hysteresis designed into the circuit in post #1. Because of that, the MOSFET does not "snap" on and off; it goes through a transition region between completely off and fully enhanced (lowest Rdson) slowly enough to heat up. Also, because the circuit is an open-loop linear amplifier, there is a value for Vcc where the FET is partially conducting, causing maximum power dissipation, and there is nothing in the design to prevent the circuit from staying at that operating point long enough for Q? to overheat. A large value positive feedback resistor from Q? to R? will add a small amount of hysteresis and should reduce Q? power dissipation.

ak

ps. Reference designators work only if they are unique.
 

crutschow

Joined Mar 14, 2008
34,281
I would use a stable reference voltage for the comparator, such as a TL431, instead of a Zener.
The 15V Zener has a positive temperature of about 10mV/°C whereas a lead-acid battery has a negative temperature coefficient of about -3mV/°C per cell, or -18mV/°C for a 12V battery.

For the most accurate charging you could add some junction diode in series with the TL431 to give the desired -18mV/°C change in the battery charging voltage with ambient temperature.
If you use 2.5V from the TL431 as a reference , then two diodes in series with that reference (giving a reference voltage of about 3.9V) should provide fairly good compensation (about -15mv/°C).
The diodes should be on or near the battery so they see the same temperature as the battery.
 

Thread Starter

Misieek

Joined Mar 17, 2021
34
I would use a stable reference voltage for the comparator, such as a TL431, instead of a Zener.
Great idea, thank you. I will use TL431 in the final board.

But now... I made something like this. It is set to 15V.
1616116143284.png
It works pretty well, with 0.1V hystheresis, which is great, but only with 1k resistor load. When I connect 5W light bulb, the hysteresis is starting to become bigger, around 0.6V. What is the possible cause?
 

AnalogKid

Joined Aug 1, 2013
10,986
Check the output voltage range of the 358. Q1 might not be turning completely off. Try changing R4 to 4.7K and adding another 4.7K between the bottom of R4 and pin 7.

ak
 

AnalogKid

Joined Aug 1, 2013
10,986
It divides the voltage difference between the opamp max output voltage and Vcc. This gets Vgs down below the FET's threshold voltage in the off state.

Example: Vcc = 16 V. The FET minimum threshold voltage is -2 V, or 14 V, but the LM358 minimum max output voltage is Vcc - 4 V, or 12 V. That is more than enough to wake up the FET. With a 2:1 divider, the worst case opamp output voltage equals the worst case FET threshold voltage for less than 1 mA drain current.

ak
 
Last edited:

Ian0

Joined Aug 7, 2020
9,667
Great idea, thank you. I will use TL431 in the final board.

But now... I made something like this. It is set to 15V.
View attachment 233111
It works pretty well, with 0.1V hystheresis, which is great, but only with 1k resistor load. When I connect 5W light bulb, the hysteresis is starting to become bigger, around 0.6V. What is the possible cause?
Use a reference such as a LM4040, you'll never get a zener to be accurate enough. The zener will only be accurate at 5mA current, and yours has <1mA. A reference IC will stay accurate down to 60uA.
Be careful using a LM358 to switch a P-channel MOSFET, its output is only guaranteed to get to Vcc-2, which means it may not be capable of turning off some low-Vgs(th) MOSFETS. LM393 might be a better choice or a comparator with push-pull outputs. [edit] as @crutschow has just said
Then add a high-value resistor from pin 7 to pin 5 to give a known and repeatable amount of hysteresis.
 
Last edited:

Thread Starter

Misieek

Joined Mar 17, 2021
34
When I connect 5W light bulb, the hysteresis is starting to become bigger, around 0.6V.
It turned out, that those chinese low quality cables had 0.6V drop with only 500mA load! With that being corrected it works pretty fine.

Like I said before, I will use TL431 as a reference voltage, that will be adjustable with a potenciometer. What is more, I agree with you guys, IRL4905 has Vgs(th) from -2V to -4V, that means the LM393 would be more reliable. What value of R4 (10k???) do you recommend when using LM393?

Finally, I also want to secure the MOSFET gate, and also LM393 from voltage spikes, that are being created while cranking the car. How can I do that? Some varistor, or zener diode +20V?
 
Top