I'm making a binary clock that is normally powered using USB 5V.
I already have a battery (CR2032) for the RTC chip. So I want to also use this battery to power the board, when a button is pressed (and USB isn't connected). So you can tell the time, when you don't have a USB port nearby.
This is the schematic I came up with:
Now my question is: when the board is powered via USB, does the PNP transistor prevent the 5V from going into the battery (when the button is pressed)?
Also, since the IC-INPUT has a pull-up to 5V, is there any danger in that 5V is coming into the battery via the pull-up (~30K), 3K3 and 33K? When applying Ohm's law I get around 0.03mA of current, so I guess I'm good. But I don't want to have the battery explode on me.
Note that I'm also using the button as an input for the microcontroller.