Multiple power sources

I want to power my project with a 9V battery and monitor the voltage level. Positive side goes into an on/off switch and from there it goes into a voltage divider (and then to pin A0) and into a DC-DC regulator, which I use to power the Arduino (Vin). I added an jpg of my setup for more details.

The 9v battery powers the project fine and I read accurate voltage levels with the divider. There are however a few things I do not understand.

  1. When the on/off switch is set to off and I power the Arduino with 5V from the USB, the onboard DC-DC regulator led turns on. I measured 4.45V on the “out” side (green cable) and 3.47V on the “in” side.
    Is the “Vin” of the Arduino powering the regulator? If so, is there a way to prevent it from happening? Using a diode or something?

  2. If a were to power the Arduino from the 5V USB and the 9v battery could a damage something (arduino or the 9v battery)? I’m using a rechargeable 9v battery and I feel like it does town fast, I know that 9v battery are not the best option and it might explain why it is doing down so fast, but I still feel like it does it faster than usual. Might just be an impression, but can this setup be the cause?

  3. Is this setup “ok” in general? Should I add something to protect a component?

Any help appreciated. Thanks.

One thing you can do is read THIS THREAD in the tutorials section. It may not answer your question(s) exactly. But still pertains to the subject at hand.

6V to Vin is not enough voltage to get the 5V regulator to regulate properly. You need at least 7V to Vin to be sure that the 5V regulator will work right. Or set the external regulator to 5V and power through the 5V pin on the Uno which is actually better because it will bypass the (weak) 5V regulator.

What is the current capacity of the 9V battery (in mAh [milliamp hours)? The Uno consumes about 50mA itself so a 300mAh hour battery will last less than 6 hours at best.

and 3.47V on the "in" side.

The "in" side of the DC DC converter? How are you measuring that?

Thanks for your answers guys.

It's a 9V 175mAh battery, which is pretty bad but it's the only a have right now.
I measure (using a multimeter ) 3.47V on the "in" side of the DC-DC converter yes. Are those coming from the voltage divider (which is connected to pin A0) ? Or does the DC-DC converter allow current to flow "in the wrong" direction ?

I read that there is a 1.2V voltage drop if I use the Vin to power the arduino, so i should in theory put at least 6.2V (or 7V as you suggested), why is the Arduino working fine with only 6V then? Am I damaging the board ?

Finally is this setup correct in the end?

I will implement your idea to put 5V directly in the board, it's seems easier indeed.

Sorry I have so many questions !

Setup.jpg

RedIron:
I measure (using a multimeter ) 3.47V on the "in" side of the DC-DC converter yes. Are those coming from the voltage divider (which is connected to pin A0) ? Or does the DC-DC converter allow current to flow "in the wrong" direction ?

Yes, the DC-DC converter does. Minor and generally harmless point.

RedIron:
Finally is this setup correct in the end?

Obviously not.

The on-board regulator has two specific limitations (in addition to the drop-out voltage). It is inefficient - it simply burns the difference between the input voltage and 5 V, and it cannot supply more than a hundred milliamps or so before it overheats and (hopefully reversibly) shuts down. The latter will not concern you if you are powering from a battery and do not expect the Arduino to be connected to anything else which draws current.

So using a "buck" regulator and the inefficient series regulator together is even more inappropriate as they both have a leakage or "quiescent" current as well. And not only that, but the UNO has a USB-serial converter chip which also draws current whether you need it or not and cannot (practically) be put to sleep either.

If you want efficiency for battery operation, an 8 MHz Pro Mini which will run at 3.3 V (or up to 5 V, it is not a problem) powered by a rechargeable lithium cell and with the regulator and pilot LED disabled, is the proper approach.