Please review; should be simple. Pretend the boxes are +/- from leds, as they're actually SMD headers so I can wire the leds off-board. 3 "banks" of 8 leds each. off an arduino/esp8266 mcu pin, pulsing.
2n222a transistor. "LED"s are TSAL6200s, and resistor values should be fine at 220 or MUCH less. Base resistor 2k2.
There's literally almost nothing on the back of this PCB - I'm just starting to play around w/ SMD options. Any reason I can't make a basically unrelated PCB on the backside, if I'm sending it out to be manufactured anyways?
dirtyharry2:
I understood a 2n222a to be good for .8a, which should more than cover these 24 based on the values I'd chosen, no?
You need to saturate the transistor for that. That means 1/10 of the collector current into the base. 80mA. Something an Arduino can't deliver.
If you saturate the transistor, ~0.4volt will fall across collector/emitter. That's ~320mW. The tiny transistor will get very hot.
If you don't saturate the transistor (not enough base current), a higher voltage will be across the transistor, and it will be in silicon heaven within seconds.
A logic fet and three strings of eight IR LEDs with one current limiting resistor per string is an option.
You will need at least 12volt for that. Maybe even 15volt.
Leo..
So just a heftier mosfet in place of the 2n, and up the voltage? Why only one series resistor - I understood that one resistor per led like I've got was the preferred way. I'm way underdriving these leds, but want reliablity.
Edit: A quick read says mosfets often have switching issues, and I'm pulsing at 38kz, if that's relevant.
Can I "chain" transistors, to limit the draw on a pin, and then say split them to multiple transistors to share load/heat? These parts are cheap-as-dirt, and I have space on the board and will be just place/paste/bake, so it's all about efficiency/reliability here.
A string of "two IR LEDs and one current limiting resistor" will work on a 5volt supply.
That halves the current needed for a single LED configuration.
One LOGIC fet (with 220ohm gate resistor and 10k bleed resistor) can drive all the strings.
Leo..
You can do three with that LED:
Forward voltage IF = 100 mA, tp = 20 ms VF 1.35 typ 1.6 max V
3 x 1.35 - 4.05 Typ
3 x 1.6 = 4.8 Max
Use Low Rds N-channel MOSFET like AOI518 (thru hole) or AOD510 (SMD), then limit current with a resistor per string:
(5V - 3 x 1.35V)/.02A = 50 ohm
20mA from Fig 7.
Plan for lower voltage so no surprises with unexpected current draw.
Can use higher current if your design will be pulsing the current, 100uS on time.
Thanks... I'm learning about logic MOSFETs now. I need 24 LEDs for the project... So 8 banks of 3? They don't need independent control, all pulse at 38khz.
So keep with the 5v, and use 8 SMD 510s, at 3 per string, 1 resister per string? And presumably a base resistor from each, all heading to the MCU pin?
Seems manageable and still able to fit on 1 side of a 2" board, but will be tighter. Costs a few bucks more per board for components though. Will try to find a comparable FET off aliexpress, etc.
dirtyharry2:
How about something like the ULN2803 Darlington?
I keep saying this.
The ULN2x03 is essentially obsolete technology. Darlingtons exhibit terrible performance in switching applications, they have been replaced by FETs. If you want to use a shift register, use a TPIC6B595 or its lesser or more current rated versions which combine the shift register with an efficient FET driver rated to 50 V and containing "kickback" protection for inductive loads.
Thanks Paul. I'm looking into those now. I'd much rather use 3 TPICs than 8 FETS, just for space/cost, if possible. Have to link it all to just 1 pin though, as I've only got the one 'tone' and these will just be running off digisparks.
Am I overthinking this? I thought I had it nailed with the single 2n. Simple question I guess is: Pulse 24 'medium' power leds in the easiest way, at 38khz. Go :P.
As I understood it, parallel beats serial. No single point of failure. But everyone wants to do combinations of serial and parallel, and I'm understanding that to be (a) to waste less power off 5v and (b) to balance individual variances in the LEDs via averaging.
The logic MOSFETs above seem to be better than the 2n222a, just because they basically act as a better mousetrap, drawing less from the pin and outputting more. Good things, both, given that I'll kill a pin if I can only get 10x power amplification, as above.
So, keep the PCB as above, but replace the 2n222a with one of the logic MOSFETs, and wire it as 8x3, rather than the 24x1 I have above? Saves room via resistors, just have to reroute. Or do I really need multiple MOSFETs for some reason?
1 (one) MOSFET can switch those 8 strings of 3 if you only want to switch them all on and all off together.
Like I said, I switched 35 strings with 1 part. I had 60mA flowing thru the strings, 2.1A pulses of light turning on & off.
Got a schematic? Can't tell from the PCB layout what is what.
Should be like the attached. 10K from Gate to Gnd keeps the MOSFET off during Arduino reset time.
I'll attach an img in a second, with my handwritten circuit. I see schematics everywhere, and some say resistors are needed in a few places, and some say that they're specifically not. The "terminator" is a hard-draw to ground, as a few places say that when the pin goes down, it might not enough to stop the mosfet from basically floating, especially if you're PWMing. The relevant part of the PCB is attached, although I'll delete the 2n222a obviously.
Put the pulldown resistor on the gate side, not the uC side. I have used 270 and 10K a lot and it works fine.
There is a slight voltage divider effect, so 5V from Arduino becomes 4.86V at the gate, with a real logic level part that is fine. The 270 limits the current out of the arduino to about 5V/270 ohm = 18.5mA to charge/discharge the gate capacitance. You could lower that even, 5V/30mA = 167, so 180 ohm.
"a few places say that when the pin goes down, it might not enough to stop the mosfet from basically floating, especially if you're PWMing."
Incorrect. When PWMing, the Arduino is driving the pin high & low, at whatever current level the series resistor to the gate allows. The only time there is a chance for floating is when the 328P is reset, the bootloader is doing its thing, the IO pins are all INPUT (default state after a reset), and the sketch has not yet started to drive the pin high or low.