Powering arduino

Hey guys, I am trying to make a project using arduino uno and 3 liion batteries.
Each liion batttery sometimes charges upto 4.1V and therefore the total v is 12.3V.

Can i directly connect this power supply to arduino bu connecting it with the vin pin.
I also need to measure the voltage of the battery using a voltage divider.

Anyone have any idea on how my components should be connected ?

Edit: I will also be powering 4 brushless motor with the same battery.

Mostly use a driver like ld293d. It can take quiet a high amount of charge.

What will i need a l293d for ??

I just wanted to know if its safe to power arduino with 12v and how should i connect the resistrs to also use a voltage divider to measure battery voltage.

Yes, you can do this, it is standard practice. There are almost thousands of online examples of the kind of voltage divider you need.

First I would not use a L293D, you have limited power available from the batteries. Use a MOSFET output driver instead. The L293D will have a voltage drop in the range of 2.5V. At 1 amp that will result in 2.5 watts of power wasted. The MOSFET bridge may have 0.1 volt drop, probably less. This results in a large savings in power and increase performance and battery life. For the divider you need two resistors. You can calculate that with the voltage divider calculator located at: Voltage Divider Calculator. My recommendation will allow about 15.5 volts max giving you some head room.

12K 5.6K
^----Analog Input

Powering a UNO via the "Vin" pin or "barrel jack" is asking for problems. The on-board regulator is barely able to provide power for the microcontroller and USB chip without overheating - there will be a temptation to use the "5V" pin to power other things and at some stage you will come unstuck. :astonished:

And you waste power in heating a linear regulator. You should get a switchmode "buck" converter and use it to power the Arduino via the "5V" pin and all other components which require 5 V.