Smoke and carbon monoxide detectors are essential warning devices that must be installed in all dwellings. Check your local building codes for the proper wiring. In my area the detectors must be connected to AC power and have a battery backup. The battery in each device should be replaced periodically. Devices should also be checked periodically.
The detectors should also be replaced every six to ten years as recommended by the manufacturer. The electrical components in the detectors age over time and this can make them less reliable. Lower reliability can mean more false alarms or it could inhibit valid alarms. Trapped dust and particles could compromise the operation of the detector. It may sound when tested but this does not mean it will work properly in a fire.