A method of detecting detachment of an ostomy device from a patient includes providing, in the ostomy device, a first electrode separated from the patient by an adhesive that attaches the ostomy device to the patient, where a first capacitor is formed between the first electrode and the patient. The method includes applying a signal to an electrical circuit that includes the first capacitor, and detecting changes in a capacitance value of the first capacitor based on frequency responses of the electrical circuit to the signal. The method additionally includes activating an alarm based upon detecting the changes in the capacitance value of the first capacitor.