Does Any One Know Where I Can Get Hold Of A Relay For That Can Drive 5v Of The Raspberry Pi At A Good Price If There Is One On The Store Could Someone Post The Product Name / No.
Thanks In Advance
Does Any One Know Where I Can Get Hold Of A Relay For That Can Drive 5v Of The Raspberry Pi At A Good Price If There Is One On The Store Could Someone Post The Product Name / No.
Thanks In Advance
Charles,
Before part numbers are found, a couple of questions.
1. What will the relay be switching and will it be AC or DC?
2. How many amps must the relay be able to switch?
3. Does it just need one contact or two?
You will also need to add a transistor (NPN something like a BC537 or 2N222) see this webpage http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/ for what you need, and then once you have answered the above questions we can point you towards a relay.
Colin
Colin,
Thanks For The Help So Far.
I Am Switching A DC Fan That Runs At 1.2W Or 0.24 Amps At 5 Volts, I Would Only Need 1 Contact.
Also On The Web Address You Provided I Found A Post That Explained How Someone Else Had Used A Relay In This Way, They Used A N18AW, Relay A Diode, A 1.2Kohm Resistor And A 2N3904 Transistor All From Maplin Electronics (Maplin.co.uk) - Would That Be Good Match For What I Described Above.
Thanks Again Charles
Charles,
Yes the N18W would be fine, you could also use the NA16W, this one only has one contact, but as they are the same price you just don't use the extra set of contacts. The BC series of transistors are likely to be slightly cheaper as they are a European type rather than the 2Nxxxx which are US.
The 2N3904 is fine, though I would go for slightly extra current gain and select the BC549C, this means drawing less current from the Pi chip pins.
You are looking for a transistor that has an IC rating of between 100 to 300mA and has a gain (Hfe) of 200 - 400 min. The base resistor should be between 4k7 to 6k8, 5k1 being the optimal value. You could use the 1k2 resistor you mention, but you would be at the limit of what the Pi pins can supply.
Pi pin = 3v3 - 0v7 / resistor value. Pi pin max is 20mA so a 5K1 resistor = 500uA at the base of the transistor to switch it on. The approximate 0v7 value = the voltage drop between the base and emitter.
With an Hfe of 400 this means 500uA will allow the transistor to easily pass the 100mA required by the relay coil.
Colin
Charles,
Yes the N18W would be fine, you could also use the NA16W, this one only has one contact, but as they are the same price you just don't use the extra set of contacts. The BC series of transistors are likely to be slightly cheaper as they are a European type rather than the 2Nxxxx which are US.
The 2N3904 is fine, though I would go for slightly extra current gain and select the BC549C, this means drawing less current from the Pi chip pins.
You are looking for a transistor that has an IC rating of between 100 to 300mA and has a gain (Hfe) of 200 - 400 min. The base resistor should be between 4k7 to 6k8, 5k1 being the optimal value. You could use the 1k2 resistor you mention, but you would be at the limit of what the Pi pins can supply.
Pi pin = 3v3 - 0v7 / resistor value. Pi pin max is 20mA so a 5K1 resistor = 500uA at the base of the transistor to switch it on. The approximate 0v7 value = the voltage drop between the base and emitter.
With an Hfe of 400 this means 500uA will allow the transistor to easily pass the 100mA required by the relay coil.
From Farnell the Finder Relay (part #1872939 the 6v version could be used as well) would be ideal and cheap too, just freight might be expensive. Damn, no longer available in the UK.
Colin
Whoops, sorry the 1K2 would be OK, I misplaced a decimal point or two.
Message was edited by: Colin Barnard Calculation mistake.