• A mechanical switch generates an on/off signal or signals as a result of somemechanical input causing the switch to open or close.• Such a switch might be used to indicate the presence of a workpiece on amachining table, the workpiece pressing against the switch and so closing it.• The absence of the workpiece is indicated by the switch being open and itspresence by it being closed.• Switches are available with normally open (NO) or normally closed(NC) contacts or can be configured as either by choice of the relevantcontacts.• An NO switch has its contacts open in the absence of a mechanicalinput and the mechanical input is used to close the switch.• An NC switch has its contacts closed in the absence of a mechanicalinput and the mechanical input is used to open the switch.• Mechanical switches are specified in terms of number of poles, that is,the number of separate circuits that can be completed by the sameswitching action, and number of throws, that is, the number ofindividual contacts for each pole.• A problem with mechanical switches is that when a switch isclosed or opened, bounce can occur and the contacts do notmake or open cleanly. Because they involve an elasticmember, they bounce back and forth like an oscillatingspring.• This “bounce” may produce amplitudes that change logiclevels over perhaps 20 ms, and so a single switch changemay give rise to a number of signals rather than just therequired single one.• There are a number of ways of eliminating these spurioussignals. One way is to include in the software program adelay of approximately 20 ms after the first detected signaltransition before any further signals are read.