I have main device with a 3.3V serial port that has not enough power for the connected ESP. Main device powered by a single LiPo-cell. I want to power on the ESP (3.3) when the main device is powered on, so I thought using an NPN-transistor, collector to battery +, emmitter to ESP, base powered by serial port + (3.3V). Will that work? What output voltage will I get from the NPN? Max. current will be 0.5A. Do I need a resistor to the base?
Personally, I would use a MOSFET in this application since you are only using it as a switch and you want to keep the voltage drop across the device (MOSFET) as low as possible. Whether or not to use a pull-down resistor on the gate will depend on what device you are using to drive the MOSFET. If you build the circuit, and the MOSFET won’t turn off or acts erratically, use a pull-down resistor.
Here is a great MOSFET tutorial video for beginners. The MOSFET used in the video (Fairchild FQP30N06L) is very common and is one of the MOSFETs that I use the most for Arduino and Raspberry Pi output circuits where I have to control larger devices. (I buy them in bulk!) Pay attention to the part of the video where he mentions “logic level” MOSFETs. That’s what you want to use. The FQP30N06L is a logic level device.