Signal form selection and failure protection of proximity switch