Automated metal detector connected in Arduino to measure all pieces and sort the accepted or rejected piece