This paper proposed a new magnetic field detection algorithm to detect metal pieces in food
producing processes. This algorithm can detect mixed metal pieces by sensing magnetic field. Some metal
pieces are passed through an over-current circuit to magnetize them. The magnetic field sensor can detect
the change in the magnetic field on theconveyor belt caused by the flow of the metal pieces in the food
product. However, such a method detects the output of signals that change their amplitude and phase
according to the movement of the conveyor belt with the food product, in which the equilibrium of the
positive signal that is created in the receiver coil loses its balance due to the magnetized material. This
includes not only the signal elements resulting from the effect of the alternating magnetic fields of the
mixed metals, but also the signal elements resulting from the effect of the alternating magnetic fields of the
examined object itself.