Smoke detectors function best when they are placed in an ideal location in the home. They need to be high up on a wall (within 5 to 12 inches of the ceiling) or on the ceiling itself where they can detect smoke most readily. Keep them away from dead air space, such as near a corner or within 5 inches of the ceiling or wall edge. They should also be clear of any air ducts, windows or outside doors that might bring in a draft. Finally, make sure they are at least 20 feet away from stoves, fireplaces or bathrooms where smoke or steam might create a false alarm.
Excessive dust buildup can interfere with the sensors in a smoke detector and decrease its effectiveness. Use a hose and duster attachment on your vacuum cleaner to keep the space around the smoke detector free of dirt, and use a compressed air canister to remove dirt from its sensors and internal wiring.
The wires on a smoke detector can loosen or become damaged, which makes its performance intermittent at best. Remove the plastic casing on the smoke detector to check its wires. If they're damaged, it's probably best to simply throw the detector away and purchase a new one.
Batteries are probably the number-one cause of a malfunctioning smoke alarm. When they go dead, it simply won't work. Luckily, most smoke alarms are designed to give out a soft chirp when their battery runs low, alerting you to the problem. Those that don't should be checked every 6 months for waning batteries. It always pays to keep a few spare batteries around the house so you can put fresh ones in your detector without a hassle.
Generally speaking, you should have one smoke detector for every bedroom in your home, plus one additional smoke alarm for each room occupied during the day such as the living room or study. Hallways should have one smoke alarm installed every 30 feet, and one should be placed at the very top of any stairs in the house.