Batteries are easy to use. The only caveat is to ensure that the battery (or batteries) you have chosen can
supply enough current at the right voltage. With the right choice of battery and a carefully designed system,
you can achieve extended operation over very long periods. For example, a small PIC- or AVR-based
computer can (depending on application and design) operate for up to two years off a single AA battery. A
poorly designed system can drain a battery in minutes. A poorly chosen battery unable to supply sufficient
current will result in erratic operation, or may result in the system being unable to start at all. When choosing
a battery, consider not just its average current capability but also its peak current. An embedded computer
may need only an average supply of 20 mA but may require as much as 100 mA at peak loads. This is
especially true of systems using flash memory, which may require high currents during write operations. The
battery for such a system must be able to supply not just the continuous load, but also the peak load when
required.