Go Down

Topic: Arduino Leonardo & Relay Problem (Read 2385 times) previous topic - next topic

Funkoid


I'm trying to control a small circuit by triggering a relay via an arduino output, I've following the suggestions here (http://blog.makezine.com/2009/02/02/connecting-a-relay-to-arduino/) so my setup looks as like this...



R1 - 1k
T1 - I've tried both 2n3904 & BC5480
RL1 - Rayex Elec LU-5 5V DPDT Relay (http://www.maplin.co.uk/2a-dpdt-bt-type-47-equivalent-relay-37522)

I have output pin 7 set to turn on and off every 2 seconds, if this pin is wired as in the diagram the relay coil doesn't get activated?
Even though the relay is rated at 5v it only appears to get triggered by 3.3v or the arduino output pins not the 5v run.

If I bypass the R1 and T1 and run output 7 directly to the relay coil, the relay is triggered and everything works however I'm concerned about burning out my arduino with the resistor and transistor being there for a reason. Is it safe to run it directly off the output pin?

Many thanks for your help in advance, this is my first project!




pwillard

#1
Oct 20, 2012, 06:27 pm Last Edit: Oct 20, 2012, 06:36 pm by pwillard Reason: 1
Quote
Is it safe to run it directly off the output pin?


Almost never is it considered "safe".

The most likely reason for it not working is that the transistor is not wired correctly.  In this case the current draw at 5V = the Maximum allowed pin current.  Rule of thumb:  Never run a pin at it's maximum ratings...   Maximum ratings are are not a goal to be met but rather a barrier to be avoided.

There is really nothing special about this relay that would make it difficult to drive with an NPN transistor.

Datasheet:  http://us.100y.com.tw/pdf_file/Bestar_BT.pdf

Funkoid

Thanks, do the spec of the transistors I'm using look okay? I've triple checking the transistor pins and they look okay  :smiley-red:

pwillard

#3
Oct 20, 2012, 06:37 pm Last Edit: Oct 20, 2012, 06:39 pm by pwillard Reason: 1
Yes a generic NPN like 3904 is fine.

http://www.reprise.com/host/circuits/transistor_pinouts.asp

I use this circuit all the time:


retrolefty


Thanks, do the spec of the transistors I'm using look okay? I've triple checking the transistor pins and they look okay  :smiley-red:


The relay coil only requires around 40ma so a 2N3904 should work ok. You probably are not getting enough base current to saturate the transistor to full on, try lower ohm resistor for the base, say 220 ohm.

Lefty

Funkoid

Cheers will give that a go later :)

Funkoid


Been the show to get resistors, sadly I''m still having no luck :( Same issue again, I'm starting to think it may be the way i've wired it on the bread board? Sorry if its messy and not to convention but i'm only just starting out  :smiley-red:


Funkoid

Anyone? :(

Is there any way of troubleshooting what I have? What sort of voltage should i see coming off the transistor?

Go Up