According to one aspect of the present disclosure, a surgical instrument isdisclosed. Theinstrument includes a handle portion, a body portion extending distally fromthe handle portionand defining a first longitudinal axis and a loading unit. The loading unitincludes a toolassembly, the loading adapted to be coupled to the body portion. Theinstrument also includes asensor tube movably positioned within the body portion, the sensor tubeadapted to engage theloading unit and a load switch coupled to a microcontroller. The load switchis adapted to beactuated by the sensor tube when the sensor tube is engaged by the loadingunit being insertedinto the body portion.