If this happens, then your smoke detector's chamber is defective. You must replace it. The chamber is the part of the detector that detects the presence of smoke.
Don’t forget to uninstall your detector from your application and test the new detector once it is correctly installed.
You can also stop the beeping for 10 hours by pressing the button on the detector.