A battery is a device consisting of electrochemical cells and two nodes namely anode and cathode and provide energy to the electronic devices. Batteries tend to expend their charge very quickly. A battery can change chemical energy into electricity by putting certain chemicals in contact with each other in a specific way. The function of a battery is to put the right chemicals in the right relationships, and then it puts a wall between them. When the two sides of a battery are linked by a wire or another conductor then the electrons start to flow.