Arduino Mega and sensor voltage

when the sensor is tripped or closed it creates a connection to the ground (NPN).