Smoke alarms are devices that detect incipient fires and alert the persons present. Smoke alarms can be battery-operated or connected directly to the mains electricity, in which case batteries are used as a back-up power source to ensure proper function.