The Sycamore Fire Department says batteries in a smoke alarm should be changed at least twice a year, even if the detectors are hardwired into the electrical system. In the case of hardwired detectors, the battery will keep the detector functioning in the event of a power failure.
In addition to changing the batteries twice a year, you should test your smoke alarm every month by simply holding down on the test button. You should also vacuum your alarm at least once a year; dust and cobwebs can impair sensitivity, and never paint over a smoke alarm. In order to maintain the highest level of protection, the Sycamore Fire Department recommends that your smoke alarms should be replaced every 10 years.