Ok, so I was using 2n4401 npn transistors for this project I'm working on but I am using them to switch LEDs on and off really really fast. Like for 5 ms and then off. I'm not sure but I think I realized that these transistors are not able to switch fast enough. Like they can, but it would be much better if I had faster switching transistors. Am I right in saying that? or is that just stupid? If so, can anyone point me in the right direction as to what transistors might be faster? Thank you!
You just have to look at the datasheet for that transistor to see that it switches at speeds way fast than you want.
What is probably more important is how much current they can handle; you do not say what leds or how many you are driving with each transistor.
Again the datasheet shows they have a max of 600ma, so keeping to half that should mean they run cool and last longer.
Take a look at the 2n4401 datasheet for the Fairchild part. That transistor has typical rise and fall times in the 20-30ns range - that is a whole lot faster than anything you are doing that ends in "ms" - it can handle well over 100mhz. Unless you are talking rudder control for a large ship, 5ms is not considered "really really fast"
Ok, so I was using 2n4401 npn transistors for this project I'm working on but I am using them to switch LEDs on and off really really fast. Like for 5 ms and then off. I'm not sure but I think I realized that these transistors are not able to switch fast enough. Like they can, but it would be much better if I had faster switching transistors. Am I right in saying that? or is that just stupid? If so, can anyone point me in the right direction as to what transistors might be faster?
As mentioned, your post is not consistent with the datasheet for the devices.
Post your circuit schematic and if applicable your code.
Obviously, if you are using a 30nS device and reporting a much long rise time, something is not adding up. Do you have any prior electronics experience ? Do you have a scope ?
EXACTLY HOW are you measuring the rise time if you don't have a scope or any other means of measuring it ? Are you using an arduino to measure it ? If so , how ? (analog, digital ?)
Do you have any data ?
I assume you realize there is no point in switching leds fast for human observation. If you were switching a laser diode for communication purposes it would be relevant.
What is the basis of your conclusion that the transistors can't switch fast enough ?
What does THIS mean ?
I'm not sure but I think I realized that these transistors are not able to switch fast enough.
That doesn't sound like a very informed conclusion. (since it seems to contradict the manufacturer's datasheet)
Can you please help us understand how you came to be saying this ?
SlinkyMation:
Ok, so I was using 2n4401 npn transistors for this project I'm working on but I am using them to switch LEDs on and off really really fast. Like for 5 ms and then off. I'm not sure but I think I realized that these transistors are not able to switch fast enough. Like they can, but it would be much better if I had faster switching transistors. Am I right in saying that? or is that just stupid? If so, can anyone point me in the right direction as to what transistors might be faster? Thank you!
ms ? Do you really mean milliseconds? Microseconds? Nanoseconds? Do you know that LEDs have
finite switching times too.
Ok so that is not my problem. Thanks for that. But obviously something else is my problem. I was multiplexing like the first schematic attached (pic1) and multiplexing with code that looked like this:
//set all pins connected to the cathodes high
DigiHigh(CathodePins);
for (int i = 0; i < 4; i++) {
digitalWrite(AnodePins[i], HIGH);
for (int j = 0; j < 6; j++) {
digitalWrite(CathodePins[j], LOW);
wait(7);
digitalWrite(CathodePins[j], HIGH);
}
digitalWrite(AnodePins[i], LOW);
wait(44);
}
//set all cathode pins low
DigiLow(CathodePins);
Which worked out perfectly fine! except for the fact that the arduino due is not powerful enough to handle that many leds so I decided to do some LED driving. So I made the schematic shown in pic2. Please note that it was 4 signals connected to the anodes and 6 signals connected to the cathodes but in pic2 it's 6 signals connected to the anodes and 4 signals connected to the cathodes. I changed the code to look like this:
//set all anode pins low
DigiLow(AnodePins);
for (int i = 0; i < 4; i++) {
digitalWrite(CathodePins[i], HIGH);
for (int j = 0; j < 6; j++) {
digitalWrite(AnodePins[j], HIGH);
wait(7);
digitalWrite(AnodePins[j], LOW);
}
digitalWrite(CathodePins[i], LOW);
wait(44);
}
//set all Anode pins high
DigiHigh(AnodePins);
Where's the rest of the code?
And what does it do that makes you say it's not working?
I'm concerned that you say there are 6 anodes in your matrix, but you're looping through a 16-element array for the cathodes....
To make the LED light up, the anode needs to be driven high, and at the same time the cathode must be driven low. It doesn't look like that ever happens in your code - of course, it's hard to say not knowing the rest of the code.
pic1, if it's drawn correctly, is wired wrong...
pic2 looks like you're on the right track...
What kind of transistors are you using right now?
You need NPN transistors on the low side (these turn on by driving base high), and PNP transistors on the high side (which turn on when you drive the base low).
DrAzzy:
And what does it do that makes you say it's not working?
It works, it's just that the LEDs hardly flash on. Like they look pretty dim
DrAzzy:
I'm concerned that you say there are 6 anodes in your matrix, but you're looping through a 16-element array for the cathodes....
sorry it was supposed to be 6 I fixed it in the code.
DrAzzy:
What kind of transistors are you using right now?You need NPN transistors on the low side (these turn on by driving base high), and PNP transistors on the high side (which turn on when you drive the base low).
I am using NPN transistors for both high side and low side. Like this tutorial here:
Do you understand that the human eye is NOT CAPABLE of seeing LEDs switched rapidly ?
DO YOU UNDERSTAND THAT ?
The human eye operates on the principle of POV (Persistance Of Vision).
The human eye cannot see anything less than 10 mS (not sure of exact number) but you get the idea.
Your circuit may be correct and your software may be correct but your understanding is clearly wrong.
In addition, while I haven't had time to examine your code your multiplexing may be too slow .
Problem: You went to Instructable for advice. Which is not much different from asking a backwoods redneck mechanic who fixes ford pickup trucks for locals.... to work on your Tesla. The Instructable author is a "computer engineer" and it shows.
Your LEDS Will not light properly if you are not making the transistors do their best for you. What is best is using a PNP for High side switching... not NPN as you got from Instructables. The "I made it so its good" is not serving you well here.
With PNP in place of NPN switching the +V side to the LED's, they will actually fully turn on (conduct better) and your LED's will likely be brighter.
With PNP in place of NPN switching the +V side to the LED's, they will actually fully turn on (conduct better) and your LED's will likely be brighter.
If you reduce the pulse width you have to increase the current proportionally up to at least 10x.
raschemmel - that's not really accurate (are we talking about the same thing? What you say is surely true for a single flash (if it's short enough), but in a matrix, you go through the matrix repeatedly and quickly, so the LEDs are effectively PWM'ed) - the eye is fairly good at seeing brief flashes of light, and in such situations, is actually more sensitive to the peak brightness than the average brightness. As long as you go through the whole array frequently enough, it's fine. You need to run through the loop fast enough that the time it takes to go through the whole matrix is too fast for you to see, so the result with that code would be that every LED appears dim, but on.
I don't know what Wait() does since you haven't posted that part of the code, but I assume it's a short delay. why do you have that wait(44) there? During that time, if i read your code right, no LED is on. So it's spending like 44/51ths of it's time with no LEDs on. Why?
How many flashes of "x' mA for "y" mS equal pne flash of 10 mA for 1000 mS ? ( in terms of photon output)
the eye is fairly good at seeing brief flashes of light, and in such situations, is actually more sensitive to the peak brightness than the average brightness.
FYI, "peak brightness" means more current.
( less time = more current)
pwillard:
With PNP in place of NPN switching the +V side to the LED's, they will actually fully turn on (conduct better) and your LED's will likely be brighter.
This is not true. PNPs and NPNs do not vary greatly in VCE(sat) (VCEsat is the voltage across the transistor when fully on and saturated). In fact, on silicon integrated circuits where both devices are built on the same mask set, NPNs are vertical devices and PNPs are horizontal it is NPNs that are faster and have lower VCEsat for equivalent currents.
As for switching the high side or low side, makes no difference.
The problem is that an NPN emitter follower (common collector) circuit used as a switch will never reach saturation. Having both base and collector resistors (as shown in Pic2) adds to the voltage drop problem. I would expect the VCE drop to approach 2V.
Try duplicating just one of your NPN high side drivers and tie "signal" to 5V. Then measure how much voltage is lost collector to emitter.