A metal detector is an instrument which detects metals. A metal detector is mostly used for security purposes but nowadays…