Smoke detectors should be installed in every bedroom, outside each bedroom, and on each floor of a house. These should be interconnected so if one sounds they all sound. [1]
Code requires the above, plus hard wired, with battery backup if power goes out [2]