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?

• In the circuit you've shown, the ADS1115 will always try to measure a voltage level of $V_{uC-out} - V_{BE}$ (probably 4.3 ~ 4.4VDC), not the actual battery level. I would recommend a practical circuit but you need a small signal PNP transistor (2N2222 is NPN btw). Nov 24, 2017 at 11:08
• To be clear, what exactly do you mean when you say the ADC is powered by the micro? Do you use a GPIO pin to power it, or do you set the ADC into single shot mode via the I2C interface? Nov 24, 2017 at 20:03
• YOu would really need to add a lot more of the schematic than that. Not much of this question makes any sense, and the little schematic you did give us does not help matters. Nov 24, 2017 at 21:16