# Can I switch an L78L05 with a transistor?

I need some help. I have the following circuit.

simulate this circuit – Schematic created using CircuitLab

The highlighted area is what I am having trouble with. I understand that I cannot use the component (transistor) in the that area as it shows on the diagram but I hope you can push me in the right direction. Here is what I am trying to do. When the button (Switch) is pushed the whole circuit is powered. The MIC5219's enable pin activates the chip which is powering the ATMEGA. That way, when not needed I can power the whole chip/circuit down and preserve power. Once the chip starts up first thing I pull pin D8 high which keeps the MIC5219 powered. Then I can run my program and move the servo.

My issue: The 7805 uses about 2mA in standby mode even when nothing happens. I need to shut the power flow off somehow and was thinking using a transistor. The connection between the 7805 and the battery has to be cut off in order to save these 2mA but of course the transistor does not work that way. How can I design that part of the circuit to have a "switch" that I can control with pin D8 and activate the power flowing through the 7805 and provide the power to the servo?

Just in case you wonder why I want to do this? The MIC5219 does not provide enough current to the circuit and the voltage drop when the servo starts up causes the whole circuit to reset and start over. Not the desired behavior. That's why I want to provide the servo with its own voltage regulation.

Thank you very much for your help.

EDIT:

@justme @vtolentino could you guys please have another look at the updated circuit and advise if I got that right? Really appreciate your feedback.

• The 7805 is not a good choice for this. It requires about 2.5V difference between the input and the output. Your 7.4V battery voltage is not (quite) high enough, and it will probably drop while your system is running.
– JRE
Apr 12 '20 at 23:27
• I don't know. It actually works quite well except for the 2mA the 7805 is using while nothing happens. That is why I need to cut the power off when not needed. Do you have an idea how I can accomplish that? Apr 12 '20 at 23:30
• Adding to the comment of @JRE. If you are going to select a new regulator, pick one which has already an enable pin, so that you save all the trouble and cost of implementing the switching logic. Apr 12 '20 at 23:30
• @vtolentino. For sure. But I need this switching logic and use up what I have. In a new design I totally would consider that. Any idea how I can use what I have to accomplish shutting the voltage off for the 7805? Apr 12 '20 at 23:33
• @realShadow You can have a look at this question electronics.stackexchange.com/questions/492669/… . It implements exactly the switching logic you would need. Apr 12 '20 at 23:36

There is a question which addresses the switch you need, and an adaption of it can be seen in the following image. Depending on your needs (e.g. faster switching), you could eventually get rid of $$\C_1\$$ and replace $$\R_2\$$ with a shortcircuit.

NOTE: The component values were not optimized.

• thanks for the link. I updated the circuit in my original post. Could you please let me know if that was the right update? Apr 13 '20 at 18:04
• If you are going to use a NPN, you have to remove the resistor $R_2$, add some base resistor to the NPN transistor, and connect the $C_4$ to the source of the mosfet $M_1$. The rest looks alright. I will update my answer to make it clearer. Apr 13 '20 at 18:43
• That is freaking awesome. Thank you so much. I will also updated my design in my question. I will do the last modification and move the 10K (R3 in your circuit) and then I should be done. Thanks a loooooot. Apr 13 '20 at 19:09

You can use a PNP transistor or a P-channel FET as a switch between battery and 7805. But you need to use another NPN transistor or N-channel FET to drive it.

• Could you draw up a quick design for that, please? Apr 12 '20 at 23:37
• I updated the circuit. Could you please let me know if that's correct? Really appreciate your feedback. Apr 13 '20 at 18:03
• @realShadow The schematic I am looking at right now shows that the pushbutton will apply 7.4V directly to the base of Q1, which will destroy it. You should add the modified schematic, not change the original, so we can follow the sequence of answers and edits. Apr 13 '20 at 18:09
• Nope. Few things wrong. For starters, it'll blow up BJT transistor Q1 if you push the button. And there is nothing to turn Q2 off. R2 will keep power always on (U1 and Q1) Apr 13 '20 at 18:12
• @ElliotAlderson good point. I will recreate it. Sorry. I am really struggling with this one. Give me a few minutes. Apr 13 '20 at 18:23