Power supply self control using transistor