We’re pretty far away from a world full of wall-warts at this point, and the default power supply for your consumer electronics is either a microUSB cable or lithium batteries. USB ports are ubiquitous enough, and lithium cells hold enough power that these devices can work for a very long time.
USB devices are common, and batteries are good enough for most devices, not all of them. There is still a niche where& extremely long battery lifetimes are needed and tapping into mains power is impractical. Think smoke detectors and security systems here. How do power supplies work for these devices? In one of the most recent TI application notes, TI showed off their extremely low power microcontrollers with a motion detector that runs for ten years with a standard coin cell battery. This is one of those small engineering marvels that comes by every few years, astonishing us for a few minutes, and then becomes par for the course a few years down the road.
The first thing anyone should think about when designing a battery-powered device that lasts for years is battery self-discharge. You’re not going to run a battery-powered device for ten years with a AA cell; the shelf life for an Energizer AA cell is just 10 years. Add in a few nanoAmps of drain, and you’ll be lucky to make it to 2020. The difference here is a CR2032 lithium-ion coin cell. Look at the datasheet for one of these cells, and they can easily sit on a shelf for 10 years, with 90% of the rated capacity remaining.
With the correct battery in the device, you’ll need a microcontroller that runs at a sufficiently low power for it to be useful in the mid-2020s. The product for this is the CC1310, a very, very low power ARM Cortex-M3 and sub 1GHz transmitter in one package.
Once that’s settled, it’s simply a matter of putting a sensor on the board – in this case a PIR sensor – and a few analog bits triggering an interrupt occasionally. Have the microcontroller in sleep mode most of the time, and that’s how you get a low-power device with a battery that will last a decade.