What I have is I think a standard problem in home electronics but I can't wrap my head around it. I'd like to control an IKEA light chain from an ESP32 board. The chain is basically a set of LED diodes connected parallelly. The power cannot be sourced from the pin itself because it exceeds board limitation of 40mA draw (the lights consume 0.72W which is ~144mA at 5V). I want to shift somewhat linearly 0-3.3V from the pin to 0-5V to the lights to turn them on/off and dim.
At first I tried tried using a BC337 NPN transistor but I'm only getting 2.6V max.
I've also tried using an L293DNE motor driver but the max voltage drops to 2.7V under load.
What are some other ways to do it? I've read somewhere that a MOSFET transistor might work.
How can I find a proper transistor and calculate the emitted voltage based on values from its specification.
Is there a standard name for what I'm trying to achieve? I'm basically looking for keywords here so I can find relevant information.