Anyone here who has powered raspberry pi with batteries like lipo or alkaline batteries? I need to know how to do it.
You will need a voltage regulator to properly supply your pi (PSU @ elinux.org, there is related questions on RPi SE). Additional protections should be considered if you feed through GPIO.
Basically to answer you question, you can use the Peukert's Law as a first approximation:
C = t*I^k
k is an adimensional constant ranging in [1.1;1.3] depending of the battery,
I is the current drawn (you need to sum all components of your circuit, including your GPS. RPi draws 1A when idle),
C the battery capacity (the fundamental specification of the battery with a dimension in A.s) and
t the discharge time.
t = 1/2h, I = 2000mA and
k=1.2 leads to
C = 0.5*2000^1.2 = 4573 mAh, then you better to select a
Battery voltage must be chosen accordingly with the voltage regulator you selected. Do not forget that you need a good 5V supply in order to service your RPi.
Caution: LiH battery needs to be handle with care, it may explode and cause injuries. You need a dedicated circuitry to charge and discharge it. If you are not used to, select regular NiCd or alkaline Battery.
Something that works well for me is using a portable power pack as opposed to a battery. These are convenient due to the fact that they can plug up via the usb port, and they are easy to charge. I have a solar powered one thats around 2000 mAh that can run my pi for an hour or 2 (havent timed it just ball parking it). Or recently i got a portable charger that has a 6000 mAh battery that can power it for at least 4 hours (once again just ball parking it). I have tried the battery method before but it seems a bit overly complicated and runs a risk of ruining my Pi. So thats why i opted for this. Anyway i hope this helps you out. I highly recommend this route above any other. Cheers!!!