I have a 12v led strip and have tested the current draw at ~500mA per colour.
I want to drive this via my Wemos GPIOs which are 3.3V @ 12mA max.
For testing I have been using 2N2222 transistors with 330Ω resistors and it seems to work well, in that the current draw is similar as via 12V directly. Ideally I should aim for 12mA base current right, so 220Ω resistor?
Although measuring the base current only gives 4mA which is less than I would have expected given (3.3 - 0.7)/330 = ~8mA, any explanation for this?
Also with a transistor gain of 500/8 = 62.5 (or 500/4 = 125?) I think the transistor is not fully switched on, and it does start to get hot quite quickly so this is probably true.
I suspect that gain is too high so I need to cascade 2 transistors to increase the gain in two steps. Like 5mA -> 50mA -> 500mA. So it would be something like GPIO 3.3V via 510Ω to give (3.3 - 0.7)/510 = 5mA, then 12V via 220Ω to give (12 - 0.7)/220 = 51mA
I also have some IRL540N mosfets which I tried but these don't fully switch on at 3.3v so would need a transistor to switch these anyway.
edit: Looking back at my original order for these transistors and these are what I bought https://www.aliexpress.com/item/2N2222A-Free-shipping-100pcs-in-line-triode-transistor-NPN-switching-transistors-TO-92-0-6A-30V/32816748799.html they say 2N2222A on the packaging but are not the old style metal case ones, so not entirely sure what they are now MSP2222 maybe?