View Full Version : Relay question again
07-07-2009, 12:26 PM
I have a question regarding this 5v coil relay. I want to make sure I have built the circuit correctly to protect the prop. My main question is regarding R3 is 1K enough or should it be a 2K ?
07-07-2009, 12:58 PM
1k means a maximum current of 3.3V/1000 Ohm = 3.3mA which can be easy done from a prop-IO-pin (max current 30 mA but max current of a group of 8 pins 100 mA)
It depends on how much current your relay needs.
with a 1k-base-resistor the base-current will be something around (3.3V-0.7V)/1000 Ohm = 2.6 mA
let's ESTIMATE your transistor type 2N3904 has a current-amplifcationfactor of 80 so this means 2.6*80 = 208 mA
which is slightly above the max current-rating of 200 mA mentioned in the datasheet of the 2N3904
with a 2k base-resistor the current delivered by the transistor would be 104 mA
So how much current does the relay need ?
Post Edited (StefanL38) : 7/7/2009 6:03:16 AM GMT
07-07-2009, 01:30 PM
According to the spec sheet its 1000 mw with 36 ohms resistance. PDF is attached.
07-07-2009, 01:59 PM
@Stefan - your reasoning to use a 2K base resistor to "lower" the transistor current is incorrect although your other calculations are fine. The lower value base resistor will make sure that the transistor is fully saturated so that the voltage drop from collector to emitter (Vce) is as low as possible thus achieving a switch like action. Ideally the Vce should be 0V and then the transistor would dissipate no extra power at all but that would never happen. Increasing the base current does not "make" more current flow through the collector once the transistor is saturated.
@Greg - looking at the relay datasheet you need around 200ma at 5V (that's the trouble with low-voltage coils) so the 2N3904 would be at it's limit here so it would be better to use say a 2N2222 or something like that. If you had a higher voltage to work with you could just as easily switch at those voltages with the same circuit. BTW, the 10K resistor is redundant in this configuration so you can leave it in but I wouldn't bother myself.
2N2222 (600ma max)
1K --> Vce = 220mv @ 200ma = 44mw
2K --> Vce = 990mv @ 200ma = 200mw (coil will actually see 4V and draw less current but you get the picture)
07-07-2009, 05:55 PM
It looks like you have a 1K resistor with the green LED. That is very unlikely to light up with a 5volt supply. I have had trouble with merely 470ohm resistor and green LEDs. So you might breadboard it to see what value suits you.
The 2n2222a runs a full 1000ma. Since there are several generations, the value sheets can be confusing. The above figures will likely work because they are conservative and based on the older, original 2n2222. But be wary of using surface mount versions as they cannot dump as much heat at TO-92 packages and such. I'd personally use the 1k and feel more assured that I am running an ON condition at full saturation.
Ain't gadetry a wonderful thing?
aka G. Herzog [ 黃鶴 ] in Taiwan
07-07-2009, 07:05 PM
@Loopy - A green LED drops around 1.8V to 2V which means that around 3ma will flow through the LED which is ok as an indicator.
The common/cheap 2N2222 is actually a PN2222 or plastic pack and the maximum current varies with type and manufacturer (600ma typical) but things get ugly if you do try to run them at full current as the Hfe (gain) drops and you need way more drive and also the Vce saturation voltage climbs and in combination with the collector current spells imminent doom for the tiny speck of silicon. Datasheet figures are always to be taken in context and max figures are just that and one cannot assume that other parameters are not affected.
BTW, the ST 2N2222A is in a metal can but the max collector current figure of 800ma is for a pulse of less than 5ms.
07-07-2009, 10:58 PM
Thanks Peter. The data sheet I downloaded claimed the 2n2222a would handle 1000ma. But 600ma is quite adequate for more relays. In fact, I am looking at 12volt relays that demand a mere 60ma. I am still not quite sure 1000k will allow a green LED to light. I get I should run a breadboard test to see what I am not understanding.
Personally, I prefer to drive 12volt relays in quick replacement sockets and not engineer to tightly. Having an On indicator is very smart as relays do wear out and one needs to verify the circuit is toggling.
Ain't gadetry a wonderful thing?
aka G. Herzog [ 黃鶴 ] in Taiwan
07-07-2009, 11:16 PM
Thanks for the replies. I found this relay on sparkfun (http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=119) and they claim that the relay only draws 80ma and the led draws 20ma.
07-07-2009, 11:30 PM
Greg, the 80ma mistakenly quoted on Sparkfun is for the 12V coil version, not the 5V one they are using which needs 200ma. The led only draws 20ma if you drive it sufficiently but nobody ever really needs to drive an led at 20ma anyway as that tends to be really bright with modern leds. To drive the led at 20ma you would need around 150ohms.
07-07-2009, 11:49 PM
I think I can still make this work. I need to change my voltage regulator to 1 amp (lm2940) from 500ma (lm2937) because I need to drive 2 of these at the same time.
07-07-2009, 11:57 PM
If you have a regulator then what is your input voltage? It makes sense to match the coil voltage to the input voltage and then you wouldn't need to beef up the regulators etc
07-08-2009, 03:06 AM
So if I have a 24 volt transformer (doorbell type) and I switch the relay to this one (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=PB303-ND) the circuit as is will drive it ? the 24 volts is not regulated will that be ok?
The spec sheet says 18V max to drive the coil. Will 24V be ok this should be around 42Ma draw on the coil correct?
07-08-2009, 04:44 AM
the specs say coilvoltage 24V
I do not understand what the specs mean by "Control On Voltage (Max) 18 VDC" ??!!??
If your transformer is NOT regulated I would highly recommend to measure what voltage it has while no or a small current
is taken from it. Just to be REALLY sure the transformer-output is DC ?
07-08-2009, 04:55 AM
The 18V spec means that the max voltage needed to turn on the relay is 18V across it. It is a max, because they don't often spec the min to turn it on.
But the voltage may go higher than that, as the coil is rated for 24V across it.
It may go higher, many relays allow 130% as a do not exceed voltage.
Relays are spec'd this way because they are often driven by unregulated DC, just transformed, diode bridge, cap type circuit. So this helps you figure out how much droop is allowed in this circuit and therefore how big a cap is needed.
07-09-2009, 08:01 AM
Attached is a revised circuit. I have switched to 24v Relay and using an unregulated 24V supply. So I think this will work, is the 1K resistor on the led ok ? Being that I have no switched from 5 Volts to 24V does it need to increase as well ?
07-09-2009, 08:28 AM
That's fine but yes you do need to change the led resistor because a lot more current is going to flow at 24V. Just use Ohm's law where R = V/I so that V = 24-2(led)/5ma = 4400. So a value of around 4.7K is fine but you could go down to 2.2K but it gets very bright but still well within ratings.