MarkoeZ 68 Posted January 4, 2012 Share Posted January 4, 2012 Hiya, For a new small project i want to use a relay with the MSP430. I obtained a simple 5 volt relay, which i tested with a 2x double A battery pack (about 2.8/2.9 volt effectively) and it worked fine with the 15v AC signal i'm trying to switch. Now i know it's not a good idea to hook it up to the msp430 directly. So, what would be the "proper" way to attach stuff? I did some googling, but most diagrams are way too complicated for my objective, or don't really seem safe for use with the msp430 (or I am just looking at the wrong places ; ) Thanks, MarkoeZ p.s. rest of the project is shaping up nicely, so expect a new topic soon Quote Link to post Share on other sites
RobG 1,892 Posted January 4, 2012 Share Posted January 4, 2012 You need 3 things, base resistor, NPN transistor that can withstand relay's current, and a protection diode. I think there was a discussion about this already. MarkoeZ 1 Quote Link to post Share on other sites
MarkoeZ 68 Posted January 4, 2012 Author Share Posted January 4, 2012 Ah thanks! I had all those elements in place (except the protection diode, but not really crucial in a battery test setup). But turned out i had a transistor that was too weak since im trying to switch it on 3 volt instead of the regular 5, and a resistor that was too high. This Page from a previous discussion turned out very helpful, measuring resistance and calculating from that. Quote Link to post Share on other sites
oPossum 1,083 Posted January 4, 2012 Share Posted January 4, 2012 MarkoeZ 1 Quote Link to post Share on other sites
MarkoeZ 68 Posted January 4, 2012 Author Share Posted January 4, 2012 [attachment=0]relay.png[/attachment] Yup, exactly the setup i have in place now But thanks for the help anyway! Quote Link to post Share on other sites
nuetron 64 Posted January 4, 2012 Share Posted January 4, 2012 How about this? http://www.falstad.com/circuit/#%24+1+5 ... .1+1+-1%0A Quote Link to post Share on other sites
MarkoeZ 68 Posted January 5, 2012 Author Share Posted January 5, 2012 Thanks again people, Been working on this: http://www.43oh.com/forum/viewtopic.php?p=15256#p15256 Bluetooth door lock Cheers! Quote Link to post Share on other sites
kenemon 29 Posted January 5, 2012 Share Posted January 5, 2012 Can you guys explain that animated schematic, It is pretty wild... Quote Link to post Share on other sites
MarkoeZ 68 Posted January 5, 2012 Author Share Posted January 5, 2012 Can you guys explain that animated schematic, It is pretty wild... If i could i would. But dont really understand it myself (the safety of it), and could not get it to work on my breadbord. Do I need a specific type of diode? Just used some ones I had laying around for the quick test... kenemon 1 Quote Link to post Share on other sites
GeekDoc 226 Posted January 6, 2012 Share Posted January 6, 2012 Can you guys explain that animated schematic, It is pretty wild... The point of the animation is to show the importance of the diode; it is there to protect the circuit from the inductive surge produced when the relay releases. 1- 3v3 is applied to the circuit, and the relay closes 2- 3v3 power is removed, the relay opens. The collapse of the magnetic field creates a reverse current in the relay's coil. The protection diode (note the orientation) allows the current to harmlessly dissipate (without entering the rest of the circuit) 3- The circuit stabilizes. (This all happens in a small fraction of a second.) EEs in the forum: Please correct me if I am mistaken. kenemon 1 Quote Link to post Share on other sites
nuetron 64 Posted January 6, 2012 Share Posted January 6, 2012 Can you guys explain that animated schematic, It is pretty wild... Do you mean the animation itself, or the circuit it represents? Quote Link to post Share on other sites
username 198 Posted January 7, 2012 Share Posted January 7, 2012 http://en.wikipedia.org/wiki/Relay Not sure theres not much to understand with a relay? A relay is simply a magnetically controlled switch. The magnetic control element is simply an inductor with a resistor in series. A relay generally has 4 input pins. 2 contacts should have ~ 10-100ohms of resistance between them. Use your multimeter to find these. This is the inductor that you use to control the switch. Apply whatever voltage is specified in the datasheet for the relay. The relay that I used with my oven was a "5V relay" and thus I applied 5Vs to it and used a simple LSD configuration as seen below with a mosftet. No protection diodes are really required because, provided your driving your relay correctly (aka not pumping a crapload of current through it) the inductive kickback shouldn't be enough to damage the fet. Another thing to note is that the relay is not polarized, a resistor in series with a inductor is not a polarized element so there is no positive or negative terminals. The other 2 contacts on your relay are you switch elements. They should go from infinite resistance to 0 resistance depending on the voltage you apply to the control element. Again, no polarization since its simply a switch. Simple representational diagram is below. Hope that helps! Sorry if your question was already answered. Quote Link to post Share on other sites
Rickta59 589 Posted January 7, 2012 Share Posted January 7, 2012 ... and thus I applied 5Vs to it and used a simple LSD configuration as seen below with a mosftet.. LSD is Low Side Driver? -rick Quote Link to post Share on other sites
username 198 Posted January 7, 2012 Share Posted January 7, 2012 Yes that is correct. LSD(Low side driver) meaning a transistor between GND and load. A HSD (high side driver) would be a transistor between power and the load. As for usage of a mosfet, versus a BJT.... well you saw my flop in the IRC.... Ultimately, which to use depends on your application and as far as us hobbyists are concerned, it generally comes down to personal preference. The reason being you can commonly make either work. I personally prefer mosfets because they do not require a constant current to be applied at the gate in order to be turned on. Hook them up directly to the msp430 and not worry about current consumption. (provided i'm not pwming at a fast frequency) Regarding the protection diode, I take back what I said. As a rule of thumb it is probably best to have one in your circuit when dealing with inductive loads. Here is an excellent video regarding them: Rickta59 1 Quote Link to post Share on other sites
kenemon 29 Posted January 7, 2012 Share Posted January 7, 2012 I was just looking for a little narration to help me understand it a little better, and i got it. Thanks neutron Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.