Question:
What transistor values do I need?
boo2
2012-02-05 05:44:32 UTC
I am trying to make a circuit where a transistor turns on a solenoid. The source is a 12V battery, and the Solenoid runs off a 12 VDC as well. The base current source would be supplied from a computer chip (Basic Stamp) running at 5VDC and around 30 mA (I think). The collector post for the transistor would be connected to the battery directly...unless there is a better way. Any help out there? What values am I looking for in a transistor?
Five answers:
Jonathan
2012-02-05 13:24:45 UTC
I'm going to put into my own words what you wrote: You have a 24V solenoid that is rated at 1A, full draw. You will be running it at 12V, which you assure us will still work with the relay because of what you've read other people saying. This means it will "pull in" at 12V, which implies it will do that with about half an amp. Unless it is one of those relays that can be cross-wired for either 12V or 24V operation. In which case, the current required at 12V might be doubled to 2A. You don't state the relay, don't provide a web link to it, and therefore there is no way anyone can cross-check these details. We just have to make broad assumptions. In this case, I have to assume that it could be as bad as 2A @ 12V, though it could be as little as ½A for all I know.



This variation of 4 is right at the point where BJTs go from cheap to expensive. A PN2222A can possibly (maybe) handle ½A. (Same with 2N3904.) If you drive it so that the Vce is low, perhaps 0.3V or so, then you might be talking about a fifth or a sixth of a watt, which it can dissipate. But if this is really 2A, then that's not the right part. And you go from "easy to get" to "less easy, and more expensive." Plus, probably, some heat sinking as well if you plan to run this continuously -- which is another thing you don't state.



As far as it goes for the BASIC Stamp, as you surmise there is a total port dissipation limit as well as a per-port pin limit. And anywhere near those limits, you cannot expect the output of the pin to be either 0V or 5V. These are MOSFET outputs and they aren't that big -- they will be severely loaded down, which means there will be a voltage drop across them. This means the design, if it plans on using 20mA or more, must take into account these drops as well as everything else. It's much better to design for much less. You should expect to supply no more than about 5mA, maybe 8mA, though I'd want to keep it lower than higher, if possible.



So. What to do? You can use a MOSFET, instead of a BJT. The nice thing there is that the MOSFET outputs will play nicely with the MOSFET driving the relay. The bad side is that they cost more. If you are cheap as I am (I like to pay less than a penny for a BJT), then they are on the order of 50 to 100 times more expensive and I say "to heck with that." But if you don't mind paying a dollar or two, then perhaps a MOSFET would be good. You need to make sure their gate threshold voltage is compatible with your 5V rail voltages (if you find one with too low of a gate threshold then the 5V might puncture the oxide and destroy it, though I doubt you will run into that problem.) Otherwise you need to select an NPN BJT that can support the higher currents implied.



I'm going to hold short of getting into more detail until I understand better about the relay you are using. There are other issues, such as the use of a snubber or free-wheeling diode to deal with inductive issues in the relay when switched off. But until I know more about the relay, a specific design should be held back, I think. The possible range of details are too large a span, right now.



What I'd be looking for is the avoidance of boutique parts and the use of standard, well-worn path parts that have proven themselves to be generally available at decent prices from a variety of suppliers. By the way, the web has hundreds if not thousands of web pages on driving relays from microcontrollers. You might be able to find a specific design for the relay you actually have and at the voltage you are supplying.



Another detail that would be nice to know is this: You have a 12V battery. You don't say how the BASIC Stamp is supplied with 5V. I know they all have a 5V regulator on board and that this regulator can handle "up to 12V" at its input. But if you are using a car for this, then you have yet another problem to deal with that you haven't talked about here. Car systems are notorious -- they have huge spikes which almost need to be treated like lightening strikes (more than 100V) and the normal operation is NOT 12V or less, but higher. So that would almost certainly exceed the specs on the BASIC Stamp, if you are doing that. So more details here, too, please.
Roger
2012-02-05 05:56:54 UTC
Use a NPN transistor with the emitter connected to ground, the collector to the negative side (if the solenoid is polarized) of the solenoid, and the base of the transistor connected to the basic stamp with a 470 ohm resistor, this will limit the current by 10 mA. If the solenoid does not require more than 100 milliamps a 2N2222 transistor can be used. If the solenoid requires more current you will have to find a power transistor. The transistor will act as an inverter the logic 1 from the basic stamp will turn the solenoid on. If the solenoid is polarized it has an internally connected diode to suppress the back emf when the solenoid is turned off. If the solenoid is not polarized, you will need to connect a diode such as a 1N4001 across the relay. The anode of this diode is connected to the collector - solenoid junction, and the cathode to the +12 volts.
billrussell42
2012-02-05 05:55:16 UTC
You need the current needed to drive the solenoid. That determines the current needed in the transistor. For example, if it is 5 amps, you need a transistor that is capable of 5 amps at about 20 volts. A 2N3055 is one example. At that current, it has an HFE of about 20, so you need a base drive of 5/20 = 25 mA, which is too close to your output of 30 mA, so you need another stage hooked up as a darlington. A 2N2222 would do fine.



And the 30 mA seems high, that may be only sink current in the low state.



The exact connection depends on your application. You will need the two transistors, some resistors and protection diodes.



"the collector is connected to the battery", that is one connection method, there are others. It requires more circuitry, however.



Email me if you want more help.
.
2012-02-05 06:06:10 UTC
I will assume the solenoid uses no more than 1 amp, use a transistor that can handle that, look for the maximum collector current in the data sheet

put the solenoid between the collector and 12 volts

but emitter to 0 volts

put diode from 12volts (cathode end) and collector, use IN4007

use 1kilohm base resistor



You could use a n channel power fet, substitute connections like this

source->emitter

drain->collector

gate->base



the 30ma is the consumption of the basic stamp and not relevant
treider
2016-09-22 04:03:16 UTC
Design circuit is determined by those advisor traces ... Power supply DC voltage. Input sign degree. Output sign anticipated degree. Output vigour anticipated degree. Frequency reply prohibit. Oscillation frequency and waveform. Size of circuit. Available materials. Cost ! Example: A pre-ampl level output present is approximately 1mA. The last output vigour level might pass as much as a couple of amperes.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...