LM311 Voltage Comparator

Status
Not open for further replies.

shacklebolt

New Member
Hi I'm not an EE but I am building a circuit for a project that I'm working on. I built the circuit today but it doesn't work and I think the problem is either how I am am using the LM311N or possibly the NPN transistor.

The idea is:
-The AC voltage is either on or off, when on it is half-wave rectified and smoothed (turns out to be approx. 0.37V) and attached to pin 2.
-In order to set the reference voltage attached to pin 3, the battery voltage is divided (turns out to be approx. 0.17V)
-Ideally, the op amp would compare the two voltages and only output (pin 7) if 0.37VDC is achieved.
-The since i believe the op amp can't handle all the current required to run the motor (could be wrong), I am using an NPN transistor-- this could be part of the problem

Is there some glaring mistake I've made in the design? Am I allowed to ignore the other 3 pins of the op amp?

Thanks,

Peter
 

Attachments

  • Circuit 5-20.jpg
    85.6 KB · Views: 1,877
hi,
Check the LM311 datasheet, the output is open collector, you need a pull up resistor to +V.

EDIT:
I would also suggest you have the motor in the collector circuit of the transistor, add a suppression diode across the motor.
 
Last edited:
Thanks for the quick response Eric! I'm new to electronics and not exactly sure how to implement your suggestions

For the pull up resistor, would one end be attached to pin 8 and the other to the power source?

As for moving the motor, are you saying to attach one side of the motor to the battery and the other end to the transistor collector? Any specs I should look for in a suppression diode/where would that be placed?

Thanks,

Peter
 

hi Peter,
Look at this, you may need to reduce the resistor to say 1K, to increase the base drive.

EDIT: the NTE123 is underrated for 360mA stall current, it could get hot.
 

Attachments

  • Circuit 5-20.jpg
    58.8 KB · Views: 419
Last edited:
Update

Hey Eric,

I updated the circuit (see attached)-- my multimeter reads 6.3ish VDC between the leads where the motor should be and doesn't change depending on the AC input.

Peter
 

Attachments

  • Circuit 5-20 new.jpg
    86.5 KB · Views: 329
Hey Eric,

I updated the circuit (see attached)-- my multimeter reads 6.3ish VDC between the leads where the motor should be and doesn't change depending on the AC input.

Peter

hi,
What voltage do you measure on pin #7 of the LM311.?? with respect to 0V.?


EDIT:
Looking at the circuit as whole, the voltages you added dont seem correct.???
 
Last edited:
0.786VDC between pin 7 and gnd

Ok,
That means the motor, if connected should be running.
Give me an hour or so and I will run your circuit in simulation and get back to you.

EDIT:
This is your circuit in LTspice, the motor will always be running.

What is the input freq of the 0.99Vac .??

The diode will drop approx 0.7V.?
 

Attachments

  • AAesp01.gif
    29.2 KB · Views: 340
Last edited:
Cool thanks! The motor was running-- but it didn't turn on/off depending on the VAC input-- i.e. the VAC input had no effect on the voltage between pin 7 and gnd
 
Cool thanks! The motor was running-- but it didn't turn on/off depending on the VAC input-- i.e. the VAC input had no effect on the voltage between pin 7 and gnd

What is the frequency of the AC input.

A clearer image.
 

Attachments

  • AAesp02.gif
    41.3 KB · Views: 323
The input frequency is 440Hz-- just to make sure were talking about the same thing, I only want the motor to run if the DC signal into pin 2 is above the reference voltage.
 
Last edited:
The input frequency is 440Hz-- just to make sure were talking about the same thing, I only want the motor to run if the DC signal into pin 2 is above the reference voltage.

hi,
Do you have pin 4 of the LM311 connected to 0V.?

It works in simulation.
 
update 2

Yeah I did have pin 4 connected to gnd-- should I disconnect it? So according to the simulation if I follow the attached diagram (and all of my components are good) it should work?

It's pretty late here, so I'm going to have to work on it more tomorrow thanks for the help so far and I'll let you know what I find tomorrow.

Peter
 

Attachments

  • Circuit 5-20 new2.jpg
    87.1 KB · Views: 288
Started the whole circuit over from scratch, I may have had the transistor C & E pins switched but flipping it didn't help-- do you think one of my parts could be bad/fried?
 
I tried breadboarding the circuit again with all new parts.

The motor turned on at first and then it seemed that when I turned on the AC Voltage, it turned the motor off. It could have been wishful thinking/me bumping a connection loose, but I tried it again and the motor stays on no matter what. I wonder... do I need a different/stronger transistor?

Peter
 
Ground is just the reference node for the circuit. In the attached drawing, the nodes circled in red all need to be connected together.
 

Attachments

  • motor driver.PNG
    83.3 KB · Views: 261
Wow i feel like an idiot! It works!!!

hi,
I ran a couple more sims, I would advise that you add the 470K hysteresis, else you have the 'jitter' at the threshold.

Look at the images

EDIT:
Just seen Roff's post,,, did you really have all the 0V's 'floating'.???? doh.!
 

Attachments

  • AAesp01.gif
    32.3 KB · Views: 265
  • AAesp02.gif
    35.4 KB · Views: 254
Last edited:
1N4001 diode is very important, it protects your transistor, else you may need a fresh transistor everytime you run your circuit, and it has to be connected in reverse biased, else the motor will not work.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…