battery a device that converts chemical energy into electrical energy .