A weapon comprising metallic parts (15,25) and a cartridge-in-chamber detection system that comprises at least one electrical contact that is connected to a microprocessor by means of a sensor circuit and a moveable conductive element which is movable by a cartridge in the chamber of the weapon and which is in electrical contact with the metallic parts (15,25), characterized in that the cartridge-in chamber detection system is configured such that: a) the at least one electrical contact is in electrical contact with the moveable conductive element when a cartridge is not in the chamber, such that the moveable conductive element, the at least one electrical contact and the metallic parts (15, 25) are electrically connected, and the at least one electrical contact is not in electrical contact with the moveable conductive element when a cartridge is in the chamber such that the at least one electrical contact is not electrically connected to at least the metallic parts (15,25) and the movable conductive element, and wherein the microprocessor, by means of the sensor circuit, is configured to detect the capacitive variation between the situation in which the at least one electrical contact is electrically connected to at least the metallic parts (15, 25) and the moveable conductive element, and the situation in which the at least one electrical contact is not electrically connected to at least the metallic parts (15, 25) and the moveable conductive element, thereby allowing the absence or presence, respectively, of the cartridge in the chamber to be determined, or b) the at least one electrical contact is not in electrical contact with the moveable conductive element when a cartridge is not in the chamber, such that the moveable conductive element, the at least one electrical contact and the metallic parts (15,25) are electrically disconnected, and the at least one electrical contact is in electrical contact with the moveable conductive element when a cartridge is in the chamber such that the at least one electrical contact is electrically connected to at least the metallic parts (15,25) and the movable conductive element, and wherein the microprocessor, by means of the sensor circuit, is configured to detect the capacitive variation between the situation in which the at least one electrical contact is electrically connected to at least the metallic parts (15,25) and the moveable conductive element, and the situation in which the at least one electrical contact is not electrically connected to at least the metallic parts (15,25) and the moveable conductive element, thereby allowing the presence or absence, respectively, of the cartridge in the chamber to be determined. a) the at least one electrical contact is in electrical contact with the moveable conductive element when a cartridge is not in the chamber, such that the moveable conductive element, the at least one electrical contact and the metallic parts (15, 25) are electrically connected, and the at least one electrical contact is not in electrical contact with the moveable conductive element when a cartridge is in the chamber such that the at least one electrical contact is not electrically connected to at least the metallic parts (15,25) and the movable conductive element, and wherein the microprocessor, by means of the sensor circuit, is configured to detect the capacitive variation between the situation in which the at least one electrical contact is electrically connected to at least the metallic parts (15, 25) and the moveable conductive element, and the situation in which the at least one electrical contact is not electrically connected to at least the metallic parts (15, 25) and the moveable conductive element, thereby allowing the absence or presence, respectively, of the cartridge in the chamber to be determined, or b) the at least one electrical contact is not in electrical contact with the moveable conductive element when a cartridge is not in the chamber, such that the moveable conductive element, the at least one electrical contact and the metallic parts (15,25) are electrically disconnected, and the at least one electrical contact is in electrical contact with the moveable conductive element when a cartridge is in the chamber such that the at least one electrical contact is electrically connected to at least the metallic parts (15,25) and the movable conductive element, and wherein the microprocessor, by means of the sensor circuit, is configured to detect the capacitive variation between the situation in which the at least one electrical contact is electrically connected to at least the metallic parts (15,25) and the moveable conductive element, and the situation in which the at least one electrical contact is not electrically connected to at least the metallic parts (15,25) and the moveable conductive element, thereby allowing the presence or absence, respectively, of the cartridge in the chamber to be determined.