AA battery power source

There is also more efficient way - use more than 2 batteries and switching regulator with 5V output (MC33063 ...) . Linear regulators (like 7805) change P = (Vin-Vout) * I into heat.