Pages: [1]   Go Down
Author Topic: Arduino Leonardo & Relay Problem  (Read 2219 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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!

 

Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1655
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: October 20, 2012, 11:36:27 am by pwillard » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1655
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes a generic NPN like 3904 is fine.

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

I use this circuit all the time:

« Last Edit: October 20, 2012, 11:39:57 am by pwillard » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cheers will give that a go later smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Been the show to get resistors, sadly I''m still having no luck smiley-sad 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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyone? smiley-sad

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

Pages: [1]   Go Up
Jump to: