Surgical instruments and control systems therefor are disclosed. A surgical instrument can comprise: a power circuit comprising a power source and a switch, a microcontroller coupled to the power circuit, a handle comprising an attachment portion, and a control circuit in signal communication with the microcontroller. The attachment portion can comprise a first electrical contact in signal communication with the microcontroller. The control circuit can comprise a sensor configured to detect an attachment state of the attachment portion. The control circuit can communicate the detected attachment state to the microcontroller, and the microcontroller can ignore signals from the first electrical contact when the control circuit communicates a detached state. The attachment portion can comprise a second electrical contact coupled to a second power circuit, and the second power circuit can decouple the second electrical contact and the second power source when the sensor detects the detached state.