Aiuto per calcolare resistenze per LedCube

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. Transistor - Wikipedia

thanks again

thank you very much!! :slight_smile:

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:

"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?

  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?
Philips 2N2222 datasheet 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

Emitter to ground.
Base to 220 ohm resistor; other side of resistor to Arduino plane output pin.
Collector to cathodes of the 9 LEDs in the plane. The series resistors for the LEDs will be between the 9 anode lines and the corresponding Arduino outputs.

perfect,
(each floor will have 12 LEDs in my project)

thanks, thanks, thanks very much