How can I get rid of an old smoke detector or CO detector?

Some retailers will take back detectors which they sell, or they may be brought to the twice a year household hazardous waste collection.