Years ago I installed a security system throughout our house with cameras and door sensors. The entire system works on a 12 volt power supply with backup batteries. The smoke detectors eventually ware out. When I get around to installing newer smoke detectors there is a problem. Smoke detectors use a 9 volt battery universally instead of 12 volts, and it is a real nuisance replacing batteries every few months, believe me. l don't have the time or patience to do that and so I found it much more convenient using my 12 volt main system to power all the detectors. Security systems and monitors use 12 volts yet smoke alarms use 9 volts.
Right now I have six smoke detectors, one in all the bedrooms and hallways plus a CO detector near the hot water heater downstairs by the furnace. They are all wired to the 12 volt security system. I also have several heat detectors, one in the kitchen at 105 degrees, one in the attic at 125 degrees, and one near the furnace at 105 degrees. Heat detectors never seem to ware out but they still need to be tested every few years (use a match). The smoke detectors definitely do need to be tested periodically. I buy the $10 smoke detectors, solder in leads and put a 1.8 ohm resister in line which reduces the voltage from 12 volts to more or less 9 volts. The detector is then powered from the 12 volt central system and you never have to put up with those nasty little tweets.
It's easy to test the smoke detectors. Take some paper and light it under the detector and wait for the thing to squeal. Pushing the test button is also a good way to test power but the real test is the particle chamber.
Date each smoke detector because they are only good for 10 years.
The CO detector needs to be low and near the floor behind the hot water heater or by the furnace. they are typically powered on 4.5 volts. It takes a 5.6 ohm resister to get from 12 volts to 4,5 volts because the usual CO detector draws a resistance of around 30 mega ohms.