Metal detectors are an electronic device used to detect the presence of metal objects, such as the one used as…