Author Topic: Driving a Mosfet with a compartor LM339 ... What I am doing wrong ???  (Read 4532 times)

0 Members and 1 Guest are viewing this topic.

Offline EneaTopic starter

  • Contributor
  • Posts: 11
  • Country: it
Hi folks,
I would like to use a comparator LM339 to drive a power MOSFET.

If the input voltage is above my threshold  -> gate HIGH - mosfet ON - the motor runs - LEDON ON - LED OFF OFF
If input voltage is below the threshold -> gate LOW - mosfet OFF - the motor stops - LEDOFF ON - LEDON OFF

LEDs are driven correctly.

But Pin1 that drives the MOSFET is LOW and I am not able to drive the MOSFET. WHYYYYYYY ??? What I am doing so wrong ???

For example, VIN = 11V ----> V2 = 9.6V (so the leds work just fine) BUT the pin for the  gate has V1 = 0 !!

Many thanks in advance for your help!!!

Notes.
Yes I am aware the mosfet I use is not a logic transistor who need 10V and proper temperature management ... but is ok in my application even if Vgs is in line with VCC <10V
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2074
Re: Driving a Mosfet with a compartor LM339 ... What I am doing wrong ???
« Reply #1 on: February 23, 2017, 02:00:53 pm »
The output of a LM339 is open-collector, it will only sink current. It needs an external source to pull-up the output.
 

Offline mjs

  • Regular Contributor
  • *
  • Posts: 117
  • Country: fi
Re: Driving a Mosfet with a compartor LM339 ... What I am doing wrong ???
« Reply #2 on: February 23, 2017, 02:02:17 pm »
LM339 like most comparators has an open collector output. Your LEDs work, because they're between VCC and OC output.

Change the R8 to be between gate and VCC instead of gate and GND.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6146
  • Country: ro
Re: Driving a Mosfet with a compartor LM339 ... What I am doing wrong ???
« Reply #3 on: February 23, 2017, 02:02:43 pm »
LM339 has open collector outputs, which means it can sink current coming from the V+, but it can not source (generate) current to V-.

To generate a positive output voltage from LM339 (as needed to control a FET), you need to put a resistor between the LM339 output and V+.

Offline Codebird

  • Regular Contributor
  • *
  • Posts: 161
  • Country: gb
Re: Driving a Mosfet with a compartor LM339 ... What I am doing wrong ???
« Reply #4 on: February 23, 2017, 02:37:22 pm »
"If the input voltage is above my threshold  -> gate HIGH - mosfet ON - the motor runs"
... and immediately drops the supply voltage, causing it to turn off and your circuit to oscillate in weird and unpleasant manner.

Getting the LM339 to switch a MOSFET is easy, but for your voltage-triggered-switch application you'll need a little hysteresis. Otherwise it'll be unstable.
 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: Driving a Mosfet with a compartor LM339 ... What I am doing wrong ???
« Reply #5 on: February 23, 2017, 02:44:22 pm »
And I'd use that extra comparator to add a time delay.  Any motor turning on will seriously drag down the voltage for a period of time. Don't forget the diode on the motor.
 

Offline Richard Head

  • Frequent Contributor
  • **
  • Posts: 685
  • Country: 00
Re: Driving a Mosfet with a compartor LM339 ... What I am doing wrong ???
« Reply #6 on: February 23, 2017, 02:47:07 pm »
Also, all the hash from the motor needs to be filtered with a decent sized electrolytic so it doesn't upset the comparator. Alternatively RC filter just the comparator supply.
 

Offline EneaTopic starter

  • Contributor
  • Posts: 11
  • Country: it
Re: Driving a Mosfet with a compartor LM339 ... What I am doing wrong ???
« Reply #7 on: February 23, 2017, 05:49:00 pm »
Hi folks,
many thanks to everyone for all the answers. Now the circuit works !!!

I appreciated also all the extra tips, and yes the diode was not in the schematic but was included in the project.

 :-+ :-+ :-+ :-+ :-+ :-+ :-+

Thanks all once more !!!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf