One of the many design choices you face when designing an electronic device, is how to power it. It's often just an afterthought, but for finished products that go beyond simple prototype and must function error-free for years, it's crucial. The basic choices we have are:
- Use (rechargeable) batteries
- Use an external power supply (like a wall wart)
- Built a power supply into the device (and feed it mains or other external power)
- Harvest external energy source (like solar or thermo energy)
Obviously, sometimes a combination is applicable, like using solar power combined with rechargeable batteries.
They all have pro's and con's. For instance, whether battery operation is an option depends on power consumption and location/accessibility (e.g.: Is it not near a power source? Can the batteries be replaced?). A good power source is a must for any microcontroller circuit. Not only from safety and environmental point of view, but also to ensure its long lasting uninterrupted workings.