# Charge battery through the transistor

I wonder if the circuit below is correct. What I need to do is: When SW1 is open, the LED is off and there is no connection between the battery and the 5v source. When SW1 closes the LED turns on and then the battery starts to be charged by the source through the short between collector and transistor emitter. Is correct? Is there a better way to do this?

simulate this circuit – Schematic created using CircuitLab

• This circuit will never work (with the switch closed) in the way you describe. The NPN needs current flowing in to the base, that's not going to happen here. 3.7 V battery suggests a Lithium based cell, these need careful charging, there are modules for this with a TP4056 chip. Use that and be safe. Trying to design your own solutions is not that easy and a meaningless exercise when you do not fully understand how components work. If you want to learn, excellent, then look at existing circuits and try to figure out how they work. – Bimpelrekkie Dec 13 '17 at 15:26
• No. Emitter voltage will be Vbe (about 0.6V) below the base. So what provides the base voltage here? Nothing. – Brian Drummond Dec 13 '17 at 15:27

## 1 Answer

This circuit will never work, as the base-emitter junction is back-biased. When SW1 is closed, the emitter sees the full 3.7 volts, while the base sees only a fraction of this voltage as determined by R1R2. For the circuit to work, disconnect R1 from the emitter and connect it to the collector. This will make sure the base is more positive than the emitter (if you design voltage divider R1R2 correctly). Here's how I would modify your circuit.

 That said, I should emphasize that you should be extra careful when charging lithium-based cells; they may explode or catch fire if mishandled. Don't use this schematic until you know exactly what you're doing and how the values of critical components affect its operation.

simulate this circuit – Schematic created using CircuitLab

• Read the comments under the question, especially Bimpelrekkie's comment. I'll bold the important parts. "...3.7 V battery suggests a Lithium based cell, these need careful charging,...". This schematic is anything but careful charging. – Harry Svensson Dec 13 '17 at 17:20