Make a 5 volt battery supply for any Arduino
Powering your Arduino from a 9v battery and the built-in linear regulator is inefficient; 9v batteries have very low energy capacity, and
using a simple linear regulator (perhaps 60% efficient) wastes much of it. 9v batteries are also quite expensive compared to other battery types.
A switching regulator can be over 95% efficient. 14500 Lithium cells, which are the same size as AA cells, but deliver 3.7v each, are much more cost effective in the long term than disposable alkaline cells.
This project shows you how to make a regulated 5v supply that is about the same size as a 9v battery, and which you can connect direct to the 5v pin (NOT the power socket, nor the VIN pin) of your Arduino or other circuit.
Gather the parts
The core of the circuit is this regulator module which will take up to 23v in and output from 1 to 17 volts depending on adjustment (as long as the input is higher than the desired output). It costs less than a single 9v battery.
You also need a battery snap, some heat-shrink tubing, and a battery of some kind. I recommend a 2xAA holder holding two 14500 lithium cells, which are rechargeable 3.7v Lithium Ion cells and cost less than $5 a pair.
Assemble the parts
Use your assembled battery
A handy tip for when working with 9v battery snaps, when you need to switch on and off, just connect ONE pin, and rotate the snap until the snap makes contact with the outside of the other pin to turn on. You can rotate the snap to bring the pins apart to switch off.