Need help making a charging circuit

Ok so i am building a pcb for my project and i am using a atmega 328 standalone.. so on my board i have my circuit ... now i plan on putting a 3.7 500mAh lipo battery on it. This one to be exact = http://www.ebay.com/itm/221392224965?ru=http%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html%3F_sacat%3D0%26_from%3DR40%26_nkw%3D221392224965%26_rdc%3D1

and i want to know is this..

I want to be able to solder the battery DIRECTLY to the board and have it charge and function.. IDEALLY i wanna be able to have the battery work on the unit then when it dies i wanna be able to just plug a charger in to charge it. i am using this schematic here to charge my battery = https://www.sparkfun.com/datasheets/Prototyping/Batteries/LiPo-Charger-Basic-v10.pdf

On the schematic it shows its set for 500mAh charging.. i CANT use this i am told but i was told i just change the resistor to fix that.

I made a pcb in eagle and i just need to know how can i combine these? i have the battery hooked up to the standalone arduino AND the charging circuit at same time.. I DONT think thats right.. I WANT the battery to charge while the charger cord is connected but i dont want the circuit to power up while charging. So i think i need something to cut off the circuit.

can anyone help me with this?

I don't feel competent to give advice because of the risk of the LiPos starting a fire.

It may help if you go back to your first post and change the title to something more meaningful.

And please don't SHOUT YOUR TITLE - it's bad manners.

...R

I think a high-side switch like a p-MOSFET would be a way to
control the load when charging. I would wear eye protection if
soldering any live high current battery connections - a short circuit
could blast molten solder into your face if you make a mistake.

Often small LiPo's come with little JST connectors, that's a much better
idea.

yea i am going to be using a jst connector as i started thinking about it.. i just dont think i can make my pcb boards with me using same signal trace to charge and use it.. i think i will get loads of issues..

LIPO batteries dont like being deeply discharged.
Generally, the cell shouldnt be discharged below 2.8 V .
If the cell goes down to 0 V then it may not recharge at all, or will but will have lost much of its capacity.
You need some kind of cutoff to prevent this happening.

they have built in protection circuits on the batterys.. i am really just trying to find out how to make this connected to my circuit and charging circuit at same time.. can anyone chime in?

OK i decided i am not gonna have the charger circuit on my pcb .. but i wanna be able to enclose the battery still and connect it to the pcb only so is there a way i can still charge it with a external charger while still plugged into my circuit board? i can put a extra jack on my pcb just to charge it but i still dont know how to incorporate in on my schematic..

Both the Sparkfun circuit and the battery you selected should be fine.
The battery says:
"* Built-in protection circuit PCM for prevent over charging or over discharging"
So you shouldn't have an issue.
If you only want to charge at a lower level,

increase the PROG pin resistor per Figure 2-4.

well my issue is i dont know how to make my circuit.. like i said before i will be placing my battery inside something where i wont have access.. so i CANT disconnect it to plug it into a charger.. so i have it set like this.. on my pcb i have a connector for my battery and my positive and neg are going to my arduino circuit AND my charger output .. i dont think that is right.. shouldnt something separate that?

Did you look at the sparkfun circuit?
Power-in connects on the left.
The battery and your circuit connect on the right.

yes.. here is my schematic.. i highlighted what i am doing.. this is ok?

yea. if the circuit(Atmega) is running, the battery will take longer to charge. a single pole double throw switch could be used to manually select charge or run modes, or a PCHannel fet and a circuit like the arduino's auto power input selector would automatically sense the charger being connected.

Battery will connect to Power header?
Need 0.1uF caps on Vcc, AVcc.
Need current limit resistors with LEDs.

Button - get rid of resistor, use internal pullup resistor:

pinMode (buttonPin, INPUT_PULLUP);
//Wire button  to connect pin to Gnd when pressed, act on that:
if (digitalRead (buttonPin) == LOW){ // do something}

Do not drive a speaker directly - if 8 ohm speaker, add a resistor in series:
(4.2V)/.035 Amp = speaker + resistor = 120 ohm.
LiPo will charge to 4.2V Max, plan for that on the outputs - LEDs and speaker.

for speaker its going through a audio amp.. unfortunately its still not loud enough!!.. here is schematic for that.. i need to use a 3.7lipo battery so i am told i cant get the speaker to go louder.. i have the sound bite loaded to the chip ( i cant have a sd card on this due to size constraints..) if anyone could chime in on how to make it louder would be great!!!

Power equals volts (rms) squared divided by resistance. Drive the speaker using an h-bridge to increase the effective Vrms or lower the impedance of your output load.

in that schematic it shows 5v .. im only using my 3.7 lipo.. so what exactly do i have to do? what components? can i get some at radioshack to test?

Generally, to make it louder you need a bigger voltage swing.
Can you add a DC/DC converter/regulator to have a 12V Supply?
http://www.pololu.com/ carries them for example.

unfortunately i cant.. this is going in a device that has very small limits.. i have like a 50mm round by 40mm tall and i have other sorts to fit still .. like battery and such.. this is why i am limited.. i was thinking maybe a 7.4v lipo battery.. but i cant find one to fit my constraints.. my pcb is PACKED already also.. i mean 50mm round isnt alot.. so is the way its set up for power ok? my sketch is like 29,750 bytes which arduino chip takes i think 32,000 so im almost there.. my sound byte was 28,000 ...

Out of curiosity, what exactly is the project and what is the tune? I did a very similar project using an attiny85, soic h-bridge, and an integrated lipo charger and battery in package about the size of a baseball. The pcb was about .5" by 1.5".