Powering LEDs via external 5V supply not Uno

Apologies for the "newb" question. My test project has consisted of only a couple of LEDs, wired to an Uno, and fade up when tapping a capacitive touch switch. At scale I expect to have close to 50 of these LEDs, and realize I need to re-engineer this test setup to take power from an external 5V supply, and not from the Arduino in order to migrate this to the larger setup.

Unfortunately I'm a bit stumped. The circuit right now uses Arduino GND and receives the 5V+ from PWM~9 (when the switch detects a touch event).

Where I mess up the circuit is if I move my +5V from PWM 9 and connect to the power supplies +5V then does my LED's ground side go into the PWM? I'm suspecting "no", because from what I've learned so far ground is typically shared across all the components, and we don't want to connect that to a PWM.

So, if this is the case, I would now have LED's ground connected to the Arduino's GND and have basically removed any "switching" from the equation... hence, my need for someone to point me in the right direction.

For the NeoPixels it was much more straight forward, because you always feed +/- right into the strip, and they only light up because of the data received. Basically, I don't have that 3rd wire here... these are just normal 2 wire LEDs.

Really appreciate any help, thanks! Stephen

For anyone who comes across this. It turns out a MOSFET Transistors is what you need. Here's a good circuit diagram to get you started:

https://bildr.org/2012/03/rfp30n06le-arduino/

I bet those diagrams start a debate about the need for a resistor between the Arduino pin and the gate...

If a person wants to damage an Arduino by following some uninformed hobbyist's recommendation to leave out the MOSFET gate resistor (150 Ohm minimum), there is no need for debate.

The project will probably work for a while.

Hey guys - here’s the circuit as it works right now virtually…had to order some parts. The two main resistors are 10k, the one going into the LED is 470ohm. The external power will be 5V, but the 9V was what was available.

jremington: If a person wants to damage an Arduino by following some uninformed hobbyist's recommendation to leave out the MOSFET gate resistor (150 Ohm minimum), there is no need for debate.

There's debate about it even on this forum, among folk who seem to know what they're talking about.

(I might add I have no way of knowing which is the correct view, and I always err on the side of safety and use a gate resistor. That's not because I believe it's needed, but because it does no harm, and there's a view that not using it might cause harm.)

who seem to know