A device having detachable bodies, wherein the device comprises: a first body, wherein a Hall effect sensor and a first attraction magnet pair are secured to the first body; and a second body, wherein an induced magnet and a second attraction magnet pair are secured to the second body, wherein the first body is attracted to the second body by using the first attraction magnet pair and the second attraction magnet pair; the first attraction magnet pair comprises a third attraction magnet and a fourth attraction magnet close to the third attraction magnet; magnetic poles of the third attraction magnet and the fourth attraction magnet are opposite; a north pole-south pole axis of the third attraction magnet is roughly parallel to a north pole-south pole axis of the fourth attraction magnet; and a magnetic pole of one end of each of the third attraction magnet and the fourth attraction magnet faces an attraction surface of the first body; the second attraction magnet pair comprises a fifth attraction magnet and a sixth attraction magnet; the fifth attraction magnet and the sixth attraction magnet are respectively attracted to the third attraction magnet and the fourth attraction magnet; directions of magnetic poles of the fifth attraction magnet and the sixth attraction magnet are opposite; a north pole-south pole axis of the fifth attraction magnet is roughly parallel to a north pole-south pole axis of the sixth attraction magnet; and a magnetic pole of one end of each of the fifth attraction magnet and the sixth attraction magnet faces an attraction surface of the second body; and in a state in which the first body is attracted to the second body, the Hall effect sensor is disposed in a range of a magnetic field produced by the induced magnet, and the Hall effect sensor is adapted to sense the magnetic field of the induced magnet and is adapted to send an indication signal, wherein a magnetic induction line receiving surface of the Hall effect sensor is roughly parallel to the attraction surface of the first body, and a direction of a north pole-south pole axis of the induced magnet is roughly perpendicular to the attraction surface of the second body or wherein a magnetic induction line receiving surface of the Hall effect sensor is roughly perpendicular to the attraction surface of the first body, and a direction of a north pole-south pole axis of the induced magnet is roughly parallel to the attraction surface of the second body. a first body, wherein a Hall effect sensor and a first attraction magnet pair are secured to the first body; and a second body, wherein an induced magnet and a second attraction magnet pair are secured to the second body, wherein the first body is attracted to the second body by using the first attraction magnet pair and the second attraction magnet pair; the first attraction magnet pair comprises a third attraction magnet and a fourth attraction magnet close to the third attraction magnet; magnetic poles of the third attraction magnet and the fourth attraction magnet are opposite; a north pole-south pole axis of the third attraction magnet is roughly parallel to a north pole-south pole axis of the fourth attraction magnet; and a magnetic pole of one end of each of the third attraction magnet and the fourth attraction magnet faces an attraction surface of the first body; the second attraction magnet pair comprises a fifth attraction magnet and a sixth attraction magnet; the fifth attraction magnet and the sixth attraction magnet are respectively attracted to the third attraction magnet and the fourth attraction magnet; directions of magnetic poles of the fifth attraction magnet and the sixth attraction magnet are opposite; a north pole-south pole axis of the fifth attraction magnet is roughly parallel to a north pole-south pole axis of the sixth attraction magnet; and a magnetic pole of one end of each of the fifth attraction magnet and the sixth attraction magnet faces an attraction surface of the second body; and in a state in which the first body is attracted to the second body, the Hall effect sensor is disposed in a range of a magnetic field produced by the induced magnet, and the Hall effect sensor is adapted to sense the magnetic field of the induced magnet and is adapted to send an indication signal, wherein a magnetic induction line receiving surface of the Hall effect sensor is roughly parallel to the attraction surface of the first body, and a direction of a north pole-south pole axis of the induced magnet is roughly perpendicular to the attraction surface of the second body or wherein a magnetic induction line receiving surface of the Hall effect sensor is roughly perpendicular to the attraction surface of the first body, and a direction of a north pole-south pole axis of the induced magnet is roughly parallel to the attraction surface of the second body.