I am hoping to use a WeMos D1 Mini to control a Raspberry Pi. To save battery, I want to put the microcontroller into deep sleep and wake it up by pressing a button. The same button should be used to activate a method that will put the controller into deep sleep after shutting down the Raspberry Pi.
The thing is that the WeMos wakes up by shortly shorting the RST pin with GND. No problem with a push button. But when the microcontroller is awake, I don't want it to reset if the button is pressed - I rather want to detect the button press. So I am hoping to use two transistors, one NPN and another PNP, so that when I am waiting to wake up, the NPN allows the RST to connect to the button, where the other end is connected to ground via another NPN transistor enabled by the same base signal. When I want to detect a button press, the PNP will then allow the flow between the pins used for button reading.
So all transistors are using the same controller.
Except that it's not working. Last time my WeMos was even getting a bit hot, so I think I am shorting something.
Do I need diodes, for example between the button and the collectors of the two first transistors? Is there a better way to achieve this? (colours mean the wires do not touch)., f