Offline
Newbie
Karma: 0
Posts: 5
|
 |
« on: March 06, 2013, 11:09:39 am » |
 If you can't see this image I've attached it. I’ve used a 2n2222 Transistor, an Arduino Uno, a 12 volt power supply, a 12 volt relay and a multi-meter. On the figure, C represents the collector side of the transistor and E represents the emitter side, R represents the 12 volt relay and M represents the Multi-meter. The base is connected with a 330Ohm resistor or a 10K resistor (I’ve tried both). In principle the relay should be turned on whenever the PWM from the Arduino is high, but it is not turning on or off for whatever the signal is. I should have get 12 volts – 0.7 volts = 11.3 volts at the relay side, but instead I’m getting around 4.6 volts. What did I do wrong? Shouldn’t the drop of the transistor be 0.7 volt?
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #1 on: March 06, 2013, 11:17:51 am » |
Your simply applying an NPN transistor improperly. You should wire it up as a 'low side switch' with the emitter grounded, the collector to the motor and motor to +12vdc. A reverse wired diode across the motor terminals is a good idea also.
Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #2 on: March 06, 2013, 08:34:37 pm » |
Why not? This transistor is just a switch, right? You should have get around 11.3v after being transferred through the transistor.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 73
Posts: 6631
Arduino rocks
|
 |
« Reply #3 on: March 06, 2013, 08:44:43 pm » |
No a transistor is not a switch - it switches, but its not that simple (MOSFETs are conceptually a bit more like switches incidentally).
For an NPN transistor to conduct the base voltage has to be above the emitter voltage. The Arduino can only generate 5V, so the emitter in your circuit has to be less than 5V (about 0.6 to 0.7V below in practice).
The circuit configuration you have is called an emitter-follower, and it not used for switching, its used for buffering analog signals typically.
You need a "common-emitter" configuration. emitter to ground, collector to load, base via resistor to Arduino - many examples all over this and other sites - so long as there is enough current through the base resistor it rises 0.7V above the emitter and allows conduction.
For a transistor to be a switch it needs to go from hard-off to hard-on under control - hard-on is called "saturated" and requires more base current than you might naively suppose (if the transistor has a gain of 100, saturation might require the base current to be > 1/20th of collector current). In saturation the collector voltage falls to very close to ground (below the base voltage in fact).
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #4 on: March 06, 2013, 08:47:36 pm » |
Why not? This transistor is just a switch, right? You should have get around 11.3v after being transferred through the transistor.
Just trying to tell you how you can make it work. Using a NPN transistor in a high side switch requires a base voltage too high to safely wire directly to a arduino 5vdc output pin unless you use a two transistor circuit. http://www.rason.org/Projects/transwit/transwit.htmLefty
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #5 on: March 06, 2013, 10:34:25 pm » |
Ok thanks for the response guys. What I'm trying to make here is an H-bridge using only 4 2n2222 transistors. After googling, I found that the collector side of the two transistors should be connected directly to the +12v source and each of their emitters to each side of the motor as shown in the following website http://electronics.stackexchange.com/questions/7235/motor-driver-using-only-a-2n2222-transistor, you are saying that in order for the above circuit to work the base voltage should be as high as the motor needs to rotate. Anyways check it out and tell me what u think.
|
|
|
|
|
Logged
|
|
|
|
|
Inland Empire, California, US
Offline
Full Member
Karma: 1
Posts: 181
|
 |
« Reply #6 on: March 07, 2013, 01:50:28 am » |
You really should use a PNP transistor for high side switching as NPN are for low side. The information in that website is not quite accurate. While that is general idea for an H-Bridge, you need PNPs between the positive supply and the load.
|
|
|
|
« Last Edit: March 07, 2013, 01:55:25 am by seanz2003 »
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #7 on: March 07, 2013, 02:16:16 am » |
You can always use an other two 2N2222s to get the base voltage on the top pair of transistors up to 12V. Otherwise that circuit will not work. There is a lot of that sort of miss information about.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #8 on: March 07, 2013, 02:17:52 am » |
Could u suggest me some PNPs suitable for this job?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #9 on: March 07, 2013, 02:24:20 am » |
http://forum.allaboutcircuits.com/showthread.php?t=22555You still need driver transistors though if you are using a 12V supply.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #10 on: March 07, 2013, 09:16:31 am » |
Problem solved! I’ve used two 12 volt relays, four 2N2222 NPN transistors, and an Arduino of course. I’ve connected the circuit as shown below. There seems to be one problem though, when I connect a small 6v dc motor it works fine, but when I connect a motor (a typical car window opener), the transistors will get hot and the motor won’t turn on. I suspect the transistors aren’t designed to carry that much current so I need a higher rating transistors (Correct me if I’m wrong). Could you list a higher power (Voltage and Current) rating transistors which can equivalently replace 2N2222s. Thank you all!
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #11 on: March 07, 2013, 12:58:21 pm » |
I am not sure I understand that schematic it doesn't use conventional symbols. I suspect the transistors aren’t designed to carry that much current so I need a higher rating transistors They are not, only about 600mA which is nothing for a motor of that size. Could you list a higher power (Voltage and Current) rating transistors which can equivalently replace 2N2222s I would not be surprised if there were not thousands of these. In fact with this current then a transistor is not the best solution and you need a logic level FET. It depends on where you live what is available in your location. Find a suppler and look for an n-channel logic level FET.
|
|
|
|
|
Logged
|
|
|
|
|
|