According to one aspect of the present disclosure, a surgical instrument is disclosed. The instrument includes a handle portion, a body portion extending distally from the handle portion and defining a first longitudinal axis and a loading unit. The loading unit includes a tool assembly, the loading adapted to be coupled to the body portion. The instrument also includes a sensor tube movably positioned within the body portion, the sensor tube adapted to engage the loading unit and a load switch coupled to a microcontroller. The load switch is adapted to be actuated by the sensor tube when the sensor tube is engaged by the loading unit being inserted into the body portion.