A surgical apparatus comprises a body assembly, an ultrasonic transducer, a shaft assembly, a motor, and a locking feature. The ultrasonic transducer is operable to convert electrical power into ultrasonic vibrations. The shaft assembly comprises a waveguide operable to transmit ultrasonic vibrations. The motor is operable to rotate the ultrasonic transducer to thereby selectively couple the ultrasonic transducer with the waveguide. The locking feature is configured to selectively prevent rotation of at least a portion of the shaft assembly relative to the body assembly. The locking feature and the motor may be activated automatically in response to an operator positioning a proximal portion of the shaft assembly in a distal portion of the body assembly. The surgical apparatus may include a feature configured to alert a user when the waveguide has been adequately secured to the ultrasonic transducer.