In this section, we will discuss setting up the power supply for the Raspberry Pi Zero. We will discuss powering the Raspberry Pi Zero and the motors of the robot. Let's discuss the major components of our robot and their power consumption:
- The Raspberry Pi Zero requires a 5V power supply, and it draws about 150 mA of current (Source: http://raspberrypi.stackexchange.com/a/40393/1470).
- The two DC motors of the robot consume about 150 mA each.
- The camera module consumes 250 mA of current (Source: https://www.raspberrypi.org/help/faqs/#cameraPower).
The total power consumption estimate is about 550 mA (150 + 150*2 + 250).
In order to calculate the battery capacity, we also need to decide the duration of continuous operation before requiring a recharge. We wanted the robot to operate at least for 2 hours before requiring a recharge. The battery capacity can be calculated using the following formula:

In our case, this would be:
http://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-battery-life
According to the Digi-Key calculator, we need to account for factors that affect the battery life. Accounting for such factors, the battery capacity would be:
We took this number into account while purchasing a battery for the robot. We decided to purchase this 2200mAh USB battery pack that operates at 5V (shown in the picture later and the link for purchase has been shared with the bill of materials discussed earlier in this chapter):

Ensure that the battery pack is fully charged before assembling it on to the robot:
- Once the battery pack is fully charged, mount it on to the robot using double-sided tape and plug a micro-USB cable, as shown in the picture:

- We need to verify that the Raspberry Pi Zero powers up when a battery pack is used.
- Plug in the HDMI cable (that is connected to a monitor) and using a very short micro-USB cable, try to power up the Raspberry Pi Zero and make sure that everything powers up correctly.