generate pulse for metal detector