Question regarding transistors.

Thank you all! Hope I can do something from now on :wink:
One last quick question, the NPN 2N2222 is too much for this, or I could use it as well?

That one will work.

Thanks, I'll try and see what happens!

An easy way to control 60 MA of leds is to use 2 pins, together to control the leds. Make SURE that you turn both pins high or low at the same time, or you may fry your atmega chip.

An easy way to control 60 MA of leds is to use 2 pins, together to control the leds. Make SURE that you turn both pins high or low at the same time, or you may fry your atmega chip.

I could be mistaken, but I would think that is a bad idea, because each pins voltage could be slightly different and so each pin would source different amounts of current and it could cause issues.

Seems to be a hack solution.

That is such a poor solution. Use a discrete transistor and do it right.

You can use a transistor to allow the arduino to drive higher-current loads, but exactly which kind of transistor you use, and how you connect it, is dependent on the type of load. Also, you can't use a transistor to "protect" the pins while duplicating ALL of the functions of an arduino pin (sink current, source current, high impedance, input...) So if you were hoping for a "general purpose pin protection scheme", I'm afraid you're out of luck...

You really need to get a better understanding / an understanding. .. of ohms law, then you need to understand the basics of a transistor esp it's gain.

Let's say you feed 1ma (an arduino supplies around 20ma comfortably) let's say the gain is 100 of the transistor this value varies sometimes 60 gain sometimes 200, darlington can be 2000 and higher, opamps higher still.

1ma to the base of transistor will amplify 100 times (transistor specific, datasheet) allowing around 100ma to flow between collector .
and emitter.

Since you can safely suck up 20ma from 1 arduino pin, you could supply 1ma to 20 resistors

Ohms law/transistor gain.

arduinorgb:
An easy way to control 60 MA of leds is to use 2 pins, together to control the leds. Make SURE that you turn both pins high or low at the same time, or you may fry your atmega chip.

Hang your head in shame! :astonished:

The possibility, even remote, that two pins connected together could be set to alternate output levels, means that represents very poor engineering practice indeed.

And while the absolute maximum rating per pin is 40 mA, recommended is only 20 mA so you should not be planning for more than 40mA total.