Go Down

Topic: Switching Trasistor - Diversity of Values (Read 274 times) previous topic - next topic


I'm no expert in Electronics, in fact you can write what I know about it on the back of a first class postage stamp using a 2 inch paintbrush, and I'm certainly an almost blank slate when it comes to the Arduino Uno / Nano, but one recent project has had me baffled. It all revolves around a transistor used as a switch, not as a current amplifier.

I wanted to build my 5 year old grand-daughter a night light and decided to go one step further and build a 3x3x3 LED cube. Like most people, I suppose, I searched the internet for 3x3x3 LED cube build tutorials.

Of the 1 x 10E LotsOfZeros so called tutorials around, especially on YouTube, I'd say that 95 per cent of them are about as informative as my grand-daughter would be in discussing nuclear physics, and about as popular as giving King Herod a job as a babysitter.

Conversely, there are some really good ones out there, including a workable code ( however, getting build error ... prog_uchar does not name a type ... gave me bloody headaches until I worked out what was wrong ). But one thing about these 'good ones' that I found was that, while they mostly ran off 5v, all used relatively the same transistors for switching, only a relatively small proportion used the same value Resistor to the base of the transistors. I found projects that 'worked' using resistors of values between 1k and 47k. This confused me somewhat, and forced me to patronise Google again in the search for the definitive formula for the value of the relevant resistor.

Let's use the BC547A as an example, and I refer to it's Datasheet. The DC current gain HFE, is 110. The Base-Emitter saturation voltage, VBE, is 0.7v.  To make it easy, let's assume that the current to the collector is 10mA ( 0.01 A ) from the plane / layer of the cube and call it IC( this assumes a common negative layer / plane, and a common positive column setup ). Therefore, the Base Biasing Current, IB will be IC / HFE. So to turn on the transistor as a switch, we only need a voltage above 0.7v and a current of a few micro amps to saturate the Base to a 'hard on' state ( no euphemism intended ).

Therefore, as far as I can see, and based on my limited knowledge, the value of the resistor from the Arduino pin, controlling that relevant layer / plane, to the base of the transistor is given as:

R1 = ( Vin - Vbe ) / IB
R1 = ( 5 - 0.7 ) / 0.00009
R1 = 47.777k ohms ( call it 47k, I think anything bigger won't work )

So, I set up a multiplexed 2x2x2 cube using Red LED's ( 1.7v @ 20 mA full brightness, but ran them at 10mA with 330R resistors ) and used 47K resistors to the bases of both transistors. Voila ! works perfectly.

I am at a loss as to why people use 1k resistors to accomplish the same effect, aren't they just draining current from the battery or power source at a much faster rate ? Also, and obviously, the resistor value will change with a different value of IC, but on a multiplexed circuit, depending really on how you set up, I really can't see it needing to be lower than 22K.

Of course, I could be totally off track and talking a complete load of Trump, but the logic I put into it, and the end justifying the means, makes me wonder.

Any thoughts ?


It could be important to try to drive it to it's lowest collector/emitter voltage if you use the transistor as a switch.
More voltage for the load, and less across the transistor (0.1volt@50mA).
Also less heat if you are switch a high current load.

Hfe from the datasheet becomes irrelevant when collector voltage drops below base voltage.

Look for the saturation graph in the datasheet. Ic = 10 Ib is written inside.
For full saturation, as on the graph, you need a base current that's 1/10 of the collector current.
If you don't need full saturation, it's possible to increase it to 1:20 for small transistors.

Go Up