A microprocessor-based protective relay is developed for the overspeed protection of a medium-capacity turbine in a turbo-alternator set. A pair of phototransistors with an amplifier circuit are only used in the hardware circuitry for sensing the fault, while an 8-b microprocessor is used for determining whether a fault condition exists and actuating a tripping relay. An alarm actuator and electromechanical tripping relay are incorporated for providing a fault indication at and above a specified speed (120% of the rated speed) and as a terminal tripping device at and above a further higher speed (140% of the rated speed), respectively, to shut down the turbine.