Aiuto per calcolare resistenze per LedCube

Buongiorno a tutti quanti, mi trovo a parlare ed a fare una domanda su un argomento di cui si è davvero molto parlato nel web; e vi chiedo scusa di questo, tuttavia, non sono in possesso delle conoscenza che mi permetterebbero di ricavare le migliori resistenze da applicare al progetto che vorrei realizzare:

seguendo progetti vari ho notato nella maggior parte dei casi (al di la della solita disposizione del catodo in comune su ciascun piano e dell'anodo in comune nei LED della stessa colonna verticale), l'impiego: (considerando un cubo 3x3x3) di 9 resistenze da 220 ohm, ognuna per ciascuna colonna verticale; e l'impiego di 3 resistenze da 22 K-ohm per ciascun piano, ciascuna collegata ad un transistor NPN. per poi collegare ciascuna terminazione ai pin di controllo ovviamente...

come in questo link ad esempio: http://www.instructables.com/id/LED-Cube-and-Arduino-Lib/?ALLSTEPS

Ma la domanda che mi sorge è questa: tali valori per le resistenze sono ottimali anche nel mio caso? impiegherei dei LED 20 mA; 3.0-3.2V

Vi ringrazio per la disponibilità

-Phoed-

(Supply volts - led volts) / current = resistance 5v - 1.1v / 20ma = 195ohms 3.3 - 1.1v / 20ma = 110ohms 3.0 - 1.1v / 20ma = 95ohms

Thanks for the reply cyclegadget, but in my case will be: (5V-3V) / 0.02A = 100 ohms?

and what is the reason for the 22k-ohm resistors connected to the transistors? is it correct?

thanks again

Phoed: Thanks for the reply cyclegadget, but in my case will be: (5V-3V) / 0.02A = 100 ohms?

I used 1.1v as an example. If your leds drop 3volts, then yes 100 ohms is correct.

and what is the reason for the 22k-ohm resistors connected to the transistors? is it correct?

In this case, the transistor is an amplifier. The base requires a smaller current to control the collector to emitter circuit. The 22k-ohm resistor protects the base from over-current damage. http://en.wikipedia.org/wiki/Transistor

thanks again

thank you very much!! ^_^

As with many instructables, that one has some serious deficiencies:

  • 2N3904 or BC548 would be very poor choices for the transistor, especially if you want to scale it to more LEDs. 2N2222A or BC337 would be OK.

  • 22K is far too large a value for the base resistor. 1K would be a better value to use, or 220 ohms for larger cubes.

Thank you very much for your help dc42,

do you think are ok transistor BC237B? because I have a lot in the box...

That circuit calls for NPN transistors. BC237B are PNP so not suitable. It would be possible to redesign the circuit and modify the code to use PNP transistors, and then BC237B would be suitable.

That's true...

I know I'm asking a lot, but could you explain how to modify the circuit? I'm sorry but I don't know much about the transistors....

If my question is too difficult to explain, is not a problem, and I thank you anyway for availability

thanks thanks thanks

I found this datasheet about BC237:

http://www.datasheetcatalog.org/datasheet/philips/BC237.pdf

“NPN general purpose transistors BC237; BC237B”
is it correct or not?

Sorry, I made a mistake, I mistook BC237 for BC327. Unfortunately, BC237 is optimised for low currents, just like 2N3904. But as the current you are switching is only 60mA (3 * 20mA), it will be OK. I suggest you use base resistors no higher than 1K.

EDIT: I got it wrong again, the transistors need to switch 9 LEDs at a time, i.e. 9 * 20mA = 180mA. So BC237 is not suitable.

Perfect, but between the various values of the transistor datasheet, what is the value that must be greater than or equal to 180mA?

thanks

You are looking for the following:

  1. Collector current rating above the value you want to switch.

  2. Vce(sat) quoted at or above the current you want to switch.

  3. hfe at or around the current you want to switch should be reasonably high, say 50 or more.

  4. Vce(sat) times the current you want to switch must be below the maximum allowed power dissipation.

THANK YOU dc42, now it is more clear, so if I want for example to have a plan with 12 leds, for that I could use a transistor that supports 12x20mA = 240mA;

then 2N2222A is ok for my experiece? http://www.datasheetcatalog.org/datasheet/philips/2N2222.pdf

  1. Collector current> 240mA
  2. Vce(sat) above the current I want to switch
  3. hfe > 50 4... ?

is it correct? And what is the best resistance for the ground?

I am very grateful

Phoed: THANK YOU dc42, now it is more clear, so if I want for example to have a plan with 12 leds, for that I could use a transistor that supports 12x20mA = 240mA;

then 2N2222A is ok for my experiece? http://www.datasheetcatalog.org/datasheet/philips/2N2222.pdf

  1. Collector current> 240mA
  2. Vce(sat) above the current I want to switch
  3. hfe > 50 4... ?

is it correct?

Yes, 2N2222A meets the requirements - although BC337 is better because it has higher hfe and lower Vce(sat). ZTX851 is better still, but more expensive.

Phoed: And what is the best resistance for the ground?

Please explain what you mean by "resistance for the ground".

"resistance for the ground" is the resistance connected to each plane of the cube, connected to the transistor...

Is ok 1K?

If you mean the resistor connected between the base of the transistor and the Arduino pin, then 1K (giving base current around 4mA) is rather high given that you are switching 240mA. I would use 220 ohms (base current around 18mA).

yes, is "the resistor connected between the base of the transistor and the Arduino pin". Sorry for my inaccuracy...

I will entrust to your experience dc42, but could you please explain the calculations you have done to understand it?

thank you very much

To switch a transistor full on, you need to supply it with enough base current. You could calculate the base current by dividing the collector current by the hfe, however hfe is typically measured at Vce = 10V, whereas we want Vce (the collector-to-emitter voltage) to be well under 1V when we turn the transistor on. So you need more base current than the value implied by the hfe. A guide is to look at the conditions under which Vce(sat) was measured, given on the datasheet. For the 2N2222A, Vce(sat) is measured with Ib = 0.1 * Ic. So to will achieve the manufacturer's Vce(sat) figure, we need to supply a base current of 0.1 times the collector current, which is 24mA in this case. In practice, we can usually tolerate a slightly higher voltage drop than the Vce(sat) figure given in the datasheet, so a slightly lower base current will do.

Thanks for your great availability dc42!

I will use the transistor you suggested (BC337 or ZTX851) for the next "cube", because I was lucky enough to find six 2N2222A from my grandfather...

now at last I understand a little 'more about the transistor, but... I hope it's last question... how to connect? Arduino_Pin --> base of the transistor --> 220 Ohm resistor --> plane of the cube with 12 Leds Vss --> emitter of the transistor Vdd--> Collector of the transistor?

........or something is missing????? I apologize but these things I've never seen

thanks again