Jump to content
Electronics-Lab.com Community

Automatic Fan Controller - Help (w/ relay?) Please!


abrodt

Recommended Posts

(had trouble posting first time, hope this isn't a duplicate!)

Hi all,

I am trying to build an automatic fan controller for my parent's a/v cabinet.  Here is the link - http://www.electronics-lab.com/projects/motor_light/007/index.html

I have attached pictures of my parts list (all from Digi Key) and what I did.

I am new to this but I believe I am having trouble getting the relay to activate.  I have turned the potentiometer all the way to either side, but it doesn't trigger (I have an LED hooked up to both outputs from the relay to test it so I know whether it is switching or not).  The one hooked up to the output that works when switch is not activated is staying on; I can't get it to switch to the other LED.  Anyways, this is my second try.  My first was more compact and was hard to troubleshoot with wires all over the place, so I did this second one way spaced out and as similar as I could to the given schematic so I couldn't confuse myself but I am having the same problem.  I can't figure it out.
Any help is greatly appreciated!  I really want to get this thing working!  Oh and if it helps at all to know, the LED built into the circuit is lighting.

Thanks in advance,
Adam

hmm okay apparently I can't attach a word document, so here is the parts list (all from digikey.com)-

Part Number
BC2314-ND - thermistor
SP043-100K-ND - potentiometer
497-1554-5-ND - op amp
P2N2222AGOS-ND - transistor
1N4001RLGOSCT-ND - diode
PB892-ND - relay
1.0KW-10-ND
P4.7KW-3BK-ND
1.8KW-10-ND
P10KW-3BK-ND
15KW-2-ND
150KW-1-ND
120KW-1-ND
180KW-1-ND
220KW-1-ND
91KW-1-ND
478-5086-ND - capacitor

the unlabeled ones are resistors (yes, some extra values are thrown in so I could adjust the hysterisis)
and the only part missing is the 10uF capacitor since I already had one.

post-52195-14279144185142_thumb.jpg

post-52195-14279144185796_thumb.jpg

Link to comment
Share on other sites


Okay, so this is kind of embarrassing, but I was just messing with the circuit again, and it's night now and pretty quiet.  Well I noticed that every time I touch the power to the leads of the circuit, I can faintly hear a "click" (just barely).  So the only thing I can figure is that is is the relay activating.  So maybe I read the little picture on the side of the relay wrong and the output that is working is the one when the relay is activated?  But if that is the case if still leaves me with why can't the potentiometer keep the relay from activating?

Here is a picture clarifying...

All input appreciated!

Adam

post-52195-14279144186257_thumb.jpg

Link to comment
Share on other sites

UPDATE:

Okay, so I unsoldered the relay from my first circuit to test it to see if I could get the relay to work at all (oh and I confirmed that my first interpretation of the picture on the side was correct) and I took a seperate 12v transformer and used it solely for trying to activate the coil (switch).  Well it didn't so I took a closer look at the relay description and I realized it says coil voltage is 24vdc.  I originally took it to be 24v max, but does it need 24 volts?  Could this be my whole problem?  Do I need a different relay?

If somebody could confirm this or if any of you have a different idea of what my problem is I would greatly appreciate hearing from you!

Thanks
Adam

Link to comment
Share on other sites

It sounds like you've found the problem. The coil voltage is the required voltage, not the maximum, the contact voltage is a maximum voltage rating. Actually I'd expect the coil to activate the relay at around 18V to 20V and will be able to safely tollerate 28V to 30V.

You need a relay with a 12V coil.

The 741 isn't the best IC to use for this, you could use an LM311 which is a comparator and can switch up to 50mA meaning you'll probably be able to omit the transistor.

Link to comment
Share on other sites

Hero999,

Thank you so much!  I'll probably just buy the correct relay since all I will have to do is switch it out, but I'll definitely look into the comparator as well.  I'll let you know if I get this thing working finally!
It might be a few days though.  It depends on whether I order from digikey again or give in to the steep prices at my local Radio Shack :)

Adam

Link to comment
Share on other sites

Well, the good news is I got the relay and the relay itself is working with the 12 volt supply.  It switches on and off like it is supposed to.

But unfortunately, everything else is not working correctly.  I will hook the circuit up to the supply, but no matter how I have the potentiometer set, it won't activate the relay.  The only way I can get it to activate is to cheat and give the relay the ground directly.  I did this by taking a scrap piece of wire and bypassing the C2 capacitor.  So I will do that and it activates the relay, but then strangely enough the relay won't deactivate when I let go with the scrap piece of wire.  The only way to make it deactivate is to unplug the power or short it out by touching the positive and negative leads together on the led's I have hooked up to test it.  Then the relay clicks off.

The indicator led built into the circuit barely lights up when I connect the power and gets bright when I "cheat" to trigger the relay, but then does not stay bright after I let go; it goes back to barely being lit even though the relay stays triggered.

I started messing around with the circuit trying to get it to work, and for some reason completely disconnecting the thermistor/potentiometer from the circuit doesn't do anything.  I am not really sure why.  It doesn't affect the behavior I described in any way.  So I'm starting to suspect that either the circuit was not designed correctly or I'm an idiot and haven't wired it up correctly.  I'm thinking the latter is much more likely :)

If I am not being clear please tell me and I'll try to explain it better.  I'm sorry for the longwinded message but this thing is starting to agravate me!

Any help is appreciated!

Adam

Also, if a detailed description of how I wired each piece will help (if the pictures aren't clear enough), I will gladly give it to you.

Oh I almost forgot here is my new relay if it helps at all -
http://search.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&site=us&keywords=PB875-nd&x=0&y=0

Link to comment
Share on other sites

This circuit demonstrates why the 741 is such a poor choice for this application.

It sounds like Q1 isn't turning enough to activate the relay but it's t,urning on to keep the relay activated once you've cheated by activating the relay manually. The relay has hysteresis, the turn on voltage is higher than the turn off voltage, suppose the relay activates when the coil voltage is 10V, it won't deactivate until the voltage drops below 5V or less; this property is often taken advantage of to save power.

There are a few reasons why the 741 is a poor choice for this kind application:

Common mode range doesn't include 0V. This means that both inputs need to be above zero, in order for the 741 to work properly, typically 2V but could be as high as 3V. This isn't too much of a problem here but it's not ideal as it's possible for one input to be near the rail.

The output saturating voltage is too high, typically 2V but could be be as high as 3V. This means that the maximum output voltage is 12V - 2V = 10V and more importantly, the minimum output voltage is 2V which is above the 0.6V turn on voltage of Q1. To get round this, a potential divider is used (R4 and R6) but it's not the best way of doing it because when the output is high, the base current is only 1.27mA which isn't enough to turn Q1 on enough to drive the relay.

Not critical here but the 741 is slow to start with and when used as a comparator it's even slower.

Here's a possible wa to solve this. The LED has a voltage drop of just over 2V and the transistor's base drops about 0.7V which should be enough to ensure the transistor doesn't turn on enough to activate the relay when the output is low.

Link to comment
Share on other sites

Hero999
Thank you once again for the reply.  I'm pretty sure I followed most of that at least :)  That seems to make sense.  And the LM311 comparator is sounding pretty good right now too lol...
But I'm out of town until Monday or Tuesday so I'll give your fix a try then for sure.  Thanks again and I'll update in a few days!

Adam

Link to comment
Share on other sites

You've got it connected upp as per my schematic with the LED in series with the base resistor?

You could try adding 1k between the base and emitter.

Here's an example using the LM311 comparator.
http://www.silicontronics.com/index.php?action=ezportal;sa=page;p=17

Link to comment
Share on other sites

I would have tried the extra resistor in there (yes I put it just like your schematic) but I don't think that is the problem.  I can completely disconnect the base of the transistor and the relay is still activated.  I can't figure out why.  I can disconnect the capacitor and diode as well and the relay still activates.  The only thing that keeps it from activating is to disconnect either side prong of the transistor.  The LED in series does not light.

I had a comparator (LM258) already so I tried it with a design similar to the example you posted along with other components I already had.  I attached a picture of my schematic.  Well, I gave it a try.

I found this site helpful.
http://talkingelectronics.com/projects/OP-AMP/OP-AMP-1.html

I wasn't really sure how to choose the values for sure, but that is what I came up with.  I built it and, well, it isn't working correctly.  Go figure.  I can turn the relay on and off with the potentiometer, so I can move it to pretty much the threshold voltage.  But the thermistor isn't working or something.  I can't get it to activate or deactivate the relay by heat or cold.  Not sure why.

I really appreciate you staying with me and helping me along!  I am learning a lot... :)

Adam

post-52195-14279144188324_thumb.jpg

Link to comment
Share on other sites


I would have tried the extra resistor in there (yes I put it just like your schematic) but I don't think that is the problem.  I can completely disconnect the base of the transistor and the relay is still activated.  I can't figure out why.  I can disconnect the capacitor and diode as well and the relay still activates.  The only thing that keeps it from activating is to disconnect either side prong of the transistor.  The LED in series does not light.

It sounds like the transistor has failed, it shouldn't do that.

I had a comparator (LM258) already so I tried it with a design similar to the example you posted along with other components I already had.  I attached a picture of my schematic.  Well, I gave it a try.

The LM258 is not a comparator and doesn't have enough output current capacity to drive a relay directly, you need the LM311.
Link to comment
Share on other sites

Oops, I thought it was a comparator.  Is there something I'm not understanding about this project?
http://www.electronics-lab.com/projects/motor_light/003/index.html
He uses one, but maybe does something special with it?
Also, it does output 60mA, which is enough to drive my 37.5mA (coil) relay right?
LM258 - http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-1554-5-ND
My relay - http://search.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&site=us&keywords=PB875-ND&x=0&y=0
My circuit is activating the relay when the potentiometer is turned enough.
If I'm wrong about this stuff and I end up needing the correct comparator, is everything else in my schematic good?

I'll have to try replacing the transistor on the first circuit I guess.

Thanks
Adam

Link to comment
Share on other sites

The LM258 is an op-amp, not a comparator, there is a difference, read the article linked below for more inofrmation.
http://people.na.infn.it/~barbarin/Biblioteca%20rivelatori%20ed%20elettronica%20%28per%20studenti%29/Elettronica/comparatori/sloa067.pdf


Also, it does output 60mA, which is enough to drive my 37.5mA (coil) relay right?

No, it has a short circuit output current of 60mA, (maximum), at which the output voltage is near 0V leaving nothing for the relay, look at the datasheet.
http://courses.cit.cornell.edu/ee476/labs/s2009/LM358.pdf

The LM311 is a comparator with an output current of 50mA and will drive the relay directly.
Link to comment
Share on other sites

Nope I haven't gotten the comparator yet; I was just hoping you could double check something for me.  I was reading that article you linked to more in depth and I saw the part about calculating hysteresis.  This is what I got out of it and I was hoping you could confirm or tell me I'm totally wacko.

From the link, hysteresis voltage = Rp/(Rh+Rp) where Rp is the resistance of the positive input and Rh is the resistance parallel to the comparator (the one added for hysteresis in the first place).

I got values from the specific 50k thermistor I'm using.
http://media.digikey.com/pdf/Data%20Sheets/Murata%20PDFs/NTSD1%20Spec.pdf
So the resistance at 30c (86f) is 39.8k ohms.
And the resistance at 25c (77f) is 50.0k ohms.

Now I'm using a 100k pot on the positive input (see previous schematic) and I'll assume it'll be set in the middle (50k) since the voltage at room temp coming in the negative input should be 6v.  So that should be around the threshold point.  So we'll say Rp=50k ohms.

The voltage coming in at each temperature into the negative input would be
12x39.8/89.8=5.3 volts for 30c
12x50/100=    6.0 volts for 25c

The difference is 6-5.3=0.7 volts.

So if I want the fans to turn off approximately 5c cooler than when they turn on, then Rh needs to be the following value.

0.7=50k/(50k+Rh) ----> Rh=21.4k ohms (so a resistor close to this value)

How did I do?  Anywhere on track?

Also on a side note, right now I have the potentiometer connected from 12v to ground.  Is this okay or should I add an identical value resistor on either side of it to keep it from blowing up or something of the sorts if the pot was turned to "0" ohms resistance?  I realize that it would change the hysteresis.

Link to comment
Share on other sites

Oh okay, that makes sense with hysteresis being how much it'll swing both ways and not the total.  So I'd actually need a value a bit larger than double my original value.

And that's good to hear about the pot.  I don't need to worry about it burning down my house :)
Since I have a 15 turn type I think I'll be okay with being able to set a fairly precise setpoint, but if I had a one turn type or something similar, I can definitely see the value in making the one turn a much smaller change.  It'd be like having a volume control knob, but having silent at just before halfway and blaring at just past halfway :)  The rest wouldn't be usable.

Well thanks again and I'll update when I get my real comparator in, probably Tues. or Wed.

Adam

Link to comment
Share on other sites

Okay, I know I'm asking a lot of questions, but there is something else I was wondering and forgot to ask about.  I couldn't find any guidelines anywhere on how to pick the protection diode that protects the transistor or IC or whatever from voltage spikes from the relay.  Are there any general rules you follow?  How do I know how big a diode I need for different relays?

Adam

Link to comment
Share on other sites

Hmm I think I see what you mean.  I guess I just need the "average rectified current" to be as much as the relay coil current is, which is only like 40mA or so.  And most of them seem to be at least like 50v, so that isn't even close since I'm only using 12v.  I guess what worried me is the part of the project description that said

"D1, the 1N4148, acts as a spark arrestor when the contacts of the relay open and eliminates false triggering. For my application the 1N4148 was good enough since the tiny relay I used was only 1 amp. However, you can use a large variety of diodes here, my next choice would be a regular purpose 1N4001 or something and should be used if your relay type can handle more then 1 amp."

And my relay can handle 5 amps, so I just wanted to be sure.  But now that I think about it, that shouldn't really matter since it is just the relay coil in circuit with the diode, not the other contacts handling the load of whatever is hooked up.  And most of the smaller diodes handle at least 150mA, way more than my relay's coil current.  And you mentioned for how much time it had to handle it also factored in.  I realize that it would only be for a split second in this situation, but I'm not sure if that means it can handle even more than it says for its max for such a short time?  But yeah, I see your point.  I'd be hard pressed to find one that couldn't handle the job.

Link to comment
Share on other sites

Yes, the time can be factored in, diodes can handle surges of higher currents for short periods, so it would be fine even if you used a diode with a maximum current rating of only 25mA, for example, the 1N4001 is rated to 1A but it can handle a surge of 30A for one 60Hz mains cycle.
http://www.diodes.com/datasheets/ds28002.pdf

Link to comment
Share on other sites

Finally!!!

I finally have a working fan controller.  And it works brilliantly.  I enclosed it in a cheap box from Radio Shack and put a red LED that is always on to show power and four :) green LED's that come on when the fans click on.  And there is an override switch that can turn the fans on no matter what temp the probe is at.

Hero999,
Thanks for sticking with me and answering all my questions.  You were a huge help and I learned a ton!

I attached a few pics in case you wanted to see the final product :)

Thanks again,
Adam

post-52195-14279144190955_thumb.jpg

post-52195-14279144191552_thumb.jpg

post-52195-14279144192171_thumb.jpg

Link to comment
Share on other sites

Nice work, I'm glad you've got it working.

I notice the relay contacts are connected to+V, I wish you had said that you plan to power the fans off the same power supply as the temperature sensor. You could've replaced the relay with a transistor and a couple of resistors which is cheaper, more compact and will probably last longer. Never mind, it works, which is the main thing, just ofr future reference, here's how to add a transistor to drive a load, whether it be fans or a light or a larger relay.

Link to comment
Share on other sites

Yeah I just did a little research on transistors as switches and I see what you mean, but it's all good.  I'm just glad I got it working!  But to be honest, I'll probably be bored in the near future and try it out :).  I'm studying to be an ME, but electronics, at least as a hobby, seems to be pretty interesting!

Thanks again,
Adam

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...