Optical sensors, switching sensors