I have to say first of all that I'm not an electronics expert, but I have some basic knowledge.
I want to connect the ADS1115 circuit to my uC using I2C, and measure the "battery level". My problem comes with the powering: ADS1115 is powered by the uC and because of that when the uC turns off it does too, but obviously the battery I'm trying to measure doesn't and keeps applying energy to ADS1115 which is of course not desireable and could burn it.
Of course I can use a relay and cut the connection between ADS and battery but I'm wondering if can make up something using 2N2222 transistor that I already have.
I'm thinking on something like the foloowing but I'm almost sure that it will not work.
simulate this circuit – Schematic created using CircuitLab
Reading through my own post I have to say that is really confused, let try to explain my porpouse better and adding some extra info that could help. I have some circuits in charge of stabilize the battery power, output of this circuit is connnected to the uC and ADC is sharing this output (that is what I mean when I said power by the uC and not using a PWM, GPIO or another uC output, I know not clearily explained). I think that this part is clear now, lets continue with my problem, when power supply is off, the previously mentioned output is not suppling energy, but the ADC is still connected to the battery and this cause the ADC to get hot and may end burned, because of that I need a way to cut the connection between ADC and battery when power supply is off, I was trying to avoid using relays and use 2n2222 because I already have a bunch of it and I was thinking on something like the picture above, I know it won't work but hopefully some modifications over it could get it working.
Any ideas? What can/should I do?