Power supply for ATmega328P

Hi everyone, I hope this is the right section, because I do not know where to post this topic.

However, I have made the prototype of a gyroscopic camera mount and now I am trying to get rid of the Arduino board, i have my PCB design almost ready, I miss only one thing under the electronic point of view: the power supply. I would like to use Li-Ion or Li-Po batteries, and I would like to charge them exactly like a Gopro or a mobile, so without taking out the batteries and with the mount turned on or off. I was thinking about two Li-Ion batteries of 3,7V (so 7,4V).

What type of circuit do I need to design to charge the battery and to supply power from the battery to the ATmega328 at the same time? I really do not know. The first device I have in my circuit is an L7805 voltage regulator which brings the V down to 5V and gives current to all the circuit.

On the outside of my case I would have a port to charge the batteries using a Li-Ion or Li-Po recharger.

What about using Gopro batteries? how could i use them?

Thank you very much!

Here's an example: https://www.sparkfun.com/products/11231 Buy one, use it as a module for testing and then think about copying that circuit onto your PCB.

I have one of these but I have yet to plug it into a project.

L7805 is a no-no for battery applications, it wastes power. You better use a switching regulator, like a buck converter or else.

Thank you for your answers.

MorganS isn't this one better? https://www.sparkfun.com/products/10217
It seems more simple and little. What does this circuit does? it controls the charging of the batteries so I do not have to use an external balanced charger?

Mart256 what about this one? http://www.hobbytronics.co.uk/d24v3f5-5v-regulator but I think that 300mA is too little because I have to power the ATMEGA, the accelerometer and a servo.

probably this one is better https://www.circuitsathome.com/products-page/power-supplies/switch-mode-dc-dc-step-down-converter-kit

or maybe this http://www.ti.com/product/TPS63061/samplebuy

Can you help me choosing the better way to complete the project? If you need more information about the circuit I can give you, just ask me.

Thank you all, guys

The 10217 from Sparkfun isn't any better, in my opinion.

Start here for a good introduction on multicell charging considerations: Overview | Multi-Cell LiPo Charging | Adafruit Learning System

You will see that it isn't so easy.

I would recommend a single cell set up with a boost converter such as:

Ok, thank you very much! the regulator you post me is a step up, but I would need a step down and step up together, I think. Because the battery goes from 8.2 to 2.5 V and I need 5V so maybe this one works fine? Pololu 5V Step-Up/Step-Down Voltage Regulator S7V7F5

Are Li-Ion batteries more simple to use? Maybe I could use them.
Maybe I could use GoPro batteries, so I could use the GoPro battery charger, and when I want to charge it I just take it off and put it on the charger. In this way I don't have to buy a Li-Po/Li-Ion balance and control circuit.