I'm a completely new to the world of electronics. I love programming, not putting circuits together. So I have no idea when it comes to something like this. Basically I'm looking for a transistor to be triggered by my arduino to run some 5V sensors. The sensors have a peak current of 100mA, so they can not be powered from the PWM pins. A max of 4 sensors will be running on the line, all on, so the peak current would be 400mA. I was recommended this transistor (http://www.digikey.com/product-search/en?WT.z_header=search_go&lang=en&site=us&keywords=SS9012GBU-ND&x=-1468&y=-51). The power source that will run through the transistor is 5V and can easily handle the current. I was told I need to supply the base with .95V to trigger the transistor.
I guess I need a resistor between the arduino pin and the transistor base? If so, could someone recommend something. My project is not bread board style, so something with a through hole mount like the transistor has, or something that could be used with a 2.54mm housing connection would be great!
Any resistor with a suitable resistance will do you.
The resistance isn't critical. You want it high enough that it doesn't cause too much current to flow from the Arduino (~20mA max), but you want it low enough that enough current flows into the base to allow enough current through the transistor.
As you're only dealing with 100mA it's not going to be much of a problem.
So grab yourself a resistor - 1/8W or 1/4W would be fine, with a resistance of say 1K? (very common, that) and you should be fine.
I'm sure others will recommend other values, but 1K is a "reasonable" value for most situations like this.
1K is too high. You are intending to switch 400mA with a transistor that only has a typical hfe of about 75 at that current. I suggest you aim for about 20mA base current, which requires a resistor of about 200 ohms.
It's a PNP transistor, so the schematic attached to reply #2 is not correct. You need to connect the emitter of the transistor to +5V, and connect the sensors between the transistor collector and ground.
waterboy550:
2. It's a PNP transistor, so the schematic attached to reply #2 is not correct. You need to connect the emitter of the transistor to +5V, and connect the sensors between the transistor collector and ground.
What do you mean connect the sensors between the transistor collector and ground. I was under the impression with a PNP transistor I would connect the emitter to 5V power source, the base would go to my arduino digital pin, and the collector would then be the hot 5V for the sensors when the transistor is triggered.
Is my thinking correct?
Also, very basic question, does it matter the way the resistor is used? Shouldn't the bands be on one side or another?
waterboy550:
2. It's a PNP transistor, so the schematic attached to reply #2 is not correct. You need to connect the emitter of the transistor to +5V, and connect the sensors between the transistor collector and ground.
What do you mean connect the sensors between the transistor collector and ground. I was under the impression with a PNP transistor I would connect the emitter to 5V power source, the base would go to my arduino digital pin, and the collector would then be the hot 5V for the sensors when the transistor is triggered.
That is exactly what I mean (with the resistor between the transistor base and the Arduino output pin).
waterboy550:
Also, very basic question, does it matter the way the resistor is used? Shouldn't the bands be on one side or another?
it doesn't matter which way round you connect a resistor.
waterboy550:
Also anyone want to weigh in on what watt rating the resistor should be? 1/4 watt or 1/2 watt?
Your output pins are low power, so if you're aiming for max 20mA (as outlined above) at 5V, the maths will be 0.02 * 5 = 0.1W max. 1/4W will give you heaps of headroom.
So, I've got to ask... Why are you driving the sensor from a GPIO pin? Do you need to turn it on and off for some reason under program control? I usually just connect the sensor input voltage to the +5v supply.
Also, the data sheet advertises a "Low 3.4mA average current requirement." I didn't see the 100mA spec. Maybe I overlooked it...
I'm powering cycling them so they aren't running 24/7, this application is consistently running and takes readings once an hour. Also the sensors store memory of past reads and a power cycle is the only way to clear the memory.
I currently have this all working. I was under the impression that the transistor would be open, no power flow, if no power was applied and closed, power flowing, when power was applied to the base. However I am experiencing the opposite. Anything I can do to change this? I'm guessing not.
If you look at the data sheet here is the power requirements for the sensors.
Operates on 3V - 5.5V. The average (and peak) current draw for 3.3V operation is 2.1mA (50mA peak) and 5V operation is 3.4mA (100mA peak) respectively. Peak current is used during sonar pulse transmit.
I was under the impression that the transistor would be open, no power flow, if no power was applied and closed, power flowing, when power was applied to the base. However I am experiencing the opposite. Anything I can do to change this? I'm guessing not.
That's true for an NPN type. I think I saw that you are using a PNP type, which is consistent with what you're seeing, per dc's note.
You would need to re-layout your circuit differently for an NPN (not difficult - google "transistor as a switch").
waterboy550:
I am currently using a PNP transistor. I was told there were no NPN transistors that would provide 5V.
If you want to do "high side switching" - i.e., controlling the power feed to a device, as opposed to switching the ground connection, then yes you should use a PNP, or a P-channel MOSFET.
That's pretty much correct Jerry, if one is using the transistor as a switch.
If using it as an amplifier, i.e. using it as a current control, then the perceived output voltage will depend on the current x impedance of the load.
PNPs like to Source current, NPNs like to sink current.
However, NPNs can be used to Source current as well, look at the output stage of a logic device
Just need more stuff in front of it to drive it at the correct levels.
So is it possible to use a NPN transistor to have a 9V connection at the emitter, take some type of 0V - 5V base (controlled by an I/O switch), and get 5V on the collector? I would like the transistor to be open (no power running from emitter to collector) when 0V is applied and only close (let power flow) when the base provides something from 0V - 5V.