Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Why does the LM311 works only if pin 4 is disconnected?

Status
Not open for further replies.

rick6

New Member
Hi all, first time poster here!

I've searched online for temperature fan controller and i came up with the schematic in the attachement.

It's based on a LM311 and it seemed a pretty straight forward circuit. I already got the parts and built it in my test board, but it won't turn on the relay no matter what temperature is on the thermistor or what position the potenciometer is.
Strange thing is that if i disconnect pin nº4 (which was connected to ground along with pin nº1) the circuit works exactly as it should.

This is great but it bothers me why it didn't work according to the given schematics.

Anyone kind enough to give a light?

Thanks in advance
 

Attachments

  • Fan-Controller-Circuit.png
    Fan-Controller-Circuit.png
    6.7 KB · Views: 49,430
hi rick,
Pin #7 is an open collector output, which means it cannot act as a current source that is able to drive the transistor Base.
So when you ground pin #4, then pin #7 as stated is o/c, so the transistor will never switch on.

The circuit is wrong.
E
 
...
This is great but it bothers me why it didn't work according to the given schematics.

That is because most schematics posted on internet hobby sites are poorly conceived and poorly executed by newbies...
 
Thanks for the replies.

So is it ok to leave the circuit as i did? Exactly as showed in the attachement but the grounded pin 4? Or would you advise connecting the transistor that drives the relay in any other way?

The circuit seems to work fine that way, i just noticed that when temperature drops on the thermistor the relay instead of switching off quickly, it hesitates a couple of times between On and Off until it actually turns off (it all happens in a slipt second but i bet it give the protection diode a good kick). Probably low voltage from the driver transistor at that poing in time that is making the relay intermittent. I'm able to make this go away by putting a electrolytic capacitor in series with the relay, maybe the given schematic is also missing that.
 
rick,
You could connect pin#4 to 0v and add a 4k7 resistor from pin #7 to +12V.
 
Thank you ericgibbs, i will try that later at night and provide you feedback on how it went.

I appreciate your help.
 
Thank you ericgibbs, i will try that later at night and provide you feedback on how it went.

I appreciate your help.

hi,
OK,, the 4k7 will allow the o/c output on pin #7 to pullup when the transistor requires Base current.
Did you say the relay 'chatters' when near the control temperature.?

E
 
Most comparator circuits use "hysteresis" to prevent the output from oscillating (chattering) when the input voltages are near the threshold voltage.
 
ericgibbs and audioguru, yes that what it does. Maybe that pullup resistor between pin 7 and 8 (positive 12+) will prevent that from happening, making the capacitor in parallell with the relay useless. By the way i said previously i putted a capacitor in series with a relay, i meant a capacitor in parallel :)
 
Last edited:
If there is a capacitor parallel with the coil of the relay then the transistor driving it might burn out.
It sounds like you did not look up "hysteresis" in the datasheet of the comparator IC. It is made with one or two resistors.
 
Rick, what is the resistance of the relay you are using.? The 311 can sink up to 50mA intrinsically, so if the coil resistance of the relay is 240 Ohms or higher, you can dispense with the pull-up resistor, the base resistor, and the transistor. One added resistor would stop the chattering.
 
Well i did manage to make it work pretty good.
I'm sorry because i'm pretty newb myself and i never did work with a comparator chip before, so i wasn't really aware of hysteresis (or even the word itself as english isn't my first language) but i did google it, and i think i got it right. Basically i needed to feed a bit of the output (pin7) to one of the inputs with a resistor.
For starters i did you you told me ericgibbs, i used that 4k7 pullup resistor across pin 7 and 8 (having pin4 finally grounded) and it worked great, but i still had the chattering relay when the temperature on the thermistor dropped slowly, so i believe that this is when hysteresis come into play and i added a 56k resistor (after googling a about "LM311 hysteresis resistor") across the output (pin7) and a input (pin2), and after that it worked flawlessly. Not really sure about my 56k resistor pick, but everything seems to be working as it should.

Now MikeMl, i did measure my relay resistance and it measures about 260 ohms. Is really ok to get rid if the transistor and base resistor? I though that it would be safer for the IC if a transistor was driving the relay. I still haven't tried it, but do you think that the IC could drive a relay by itself and even a led along with it?

Thank you all for the help so far.
 
Last edited:
Adding a LED may be pushing it depends on the LED. It's probably a "one of" so cost and size isn't that much of a deal breaker.

Driving it directly inverts the behavior, so you may have to swap the - (inverting) and + (non-inverting) inputs of the OP amp. CW and CCW positions are not labeled on the pot. i.e. . In what direction will the fan turn on.

Since this is a 12 V fan, you can put the LED on the fan side and it would not matter.

Now if this really is a cooling fan, and the fan is supposed to turn on when the temperature gets too hot, if you provide some fan specs like voltage/current one can even get rid of the relay.

You need the hysteresis.

Now you know that everything you read don the INTERNET is true? :(

Everyone called it and the circuit won't work as drawn. Most comparitors are open collector.
 
Yes, the LM311 can drive the relay directly. It is rated for 50mA. A 260 Ohm relay draws 44mA at 12V input. That leaves ~5mA to light a LED, which is more than enough for an on/off indicator.

Do you want the relay to pull-in on temperature rise, or on temperature drop? What temperature range do you want it to work?
 
Last edited:
Hi "KeepItSimpleStupid" (just quoting your nickname so forum outside readers won't think i'm name calling you ;) ). Indeed adding the led after the relay may be a even smarter ideia, i don't know why i haven't figured it out before, here is where i was really stupid and could actually make it simpler.
As for getting rid of the relay and driving directly the fan from the IC might be a bit of a strech as it will be driving 6 different fans.

MikeMl, the purpose of this circuit is to make a "small" computer i have connected to my TV a bit more silent when playing movies, and when it hits higher temperatures like 65 ºC it turns on a few fans inside (when for example playing games or such demanding tasks besides a playing a video file).
 
Ok Rick, Mikes custom design service...

Simulation shows increasing and then decreasing temperature(Green Trace, scaled at 1degC/V) vs time. That effects the simulated thermistor resistance, which causes the comparator to change states. Note the hysteresis; cut-in at 63 degC, cut-out at 61degC. The red trace shows the relay coil current. The adjustment pot is centered to get it to trip near 65degC. You could temporarily use a pot, find the setting you like, then measure the resistance above and below the wiper, an replace the pot with two soldered in resistors...

The LT1011 is a proxy for your LM311. If someone wants the .asc file, just ask.
FanController.jpg
 
I'm sorry for never awnsering back MikeMl and thank you for the simulation.
I got rid of the transistor and added the hysteresis resistor as advised, and also coupled the led as you've showed. It all worked great but the fact that the led lit up a few ºCs before the relay got triggered. Maybe i should have tried other hysteresis resistors but i left it as it was so i could be warned that the computer was getting a hot just before the relay kicked in (like a pre-warning).

The only (more or less) unwanted effect was that when the computer was doing some job and keeps steady hot temperature the circuit keeps cyling between on and off.
I understand that the circuit is doing it's job, but there's not much i can do by adjusting the pot without making it trigger the relay either too soon or late.
I'll keep checking for other circuits for this task.
For now thank you all for the help!
 
The only (more or less) unwanted effect was that when the computer was doing some job and keeps steady hot temperature the circuit keeps cyling between on and off.

That's how thermostats work - when it gets too hot the fan turns on, and then when it's cooled down enough it switches off again - and the cycle repeats.

What are you expecting it to do?.
 
2 degrees of Hysteresis isn't too bad. This is what's basically called bang-bang or on/off control.

To get strict control, you need to incorporate a PI or PID controller. The latter is Proportional, Integral Derivative. These controllers either require tuning or can have autotuning algorithms built-in to determine the constants. The integral term makes the setpoint and measured value agree. The Derivative term works on disturbances.
I've done PID in software without auto-tuning.

The other problem is output, In your case, you would need PWM or pulse width modulation to control the fan speed.

The sophistication of commercial controllers vary all over the map. They usually provide a standard signal, sometimes configurable, such as 0-5, 0-10, 0-20 mA, 4-20 mA for such application. That sort of signal would have to vary the speed of the fan from 0 to 100%.
 
These guy's are the real deal, I am very young and very limited in knowledge, what I am trying to say is, dont go running off with my idea thinking it is the answer, because i might have it wrong! Anyway, there are some computer fans that 2 or 3 settings for speed, the speed of these fans is determined by which of the control wires is pulled high, so you could use that. Or another way
Quad comparator outputs to resistor network, resistor network connects to voltage regulator pin, voltage from regulator determined by the resistor, so you set comparators for different temps, so as temp rises more voltage to fan, this should give you a slow to fast fan with little effort. But I am not to be taken on my word, I sometimes see solutions that are not really there.
By the way have a very good look around for fans, i have two that run really fast at only 18mA!!!
yes 18mA not 180mA!!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top