Abstract:The conventional mechanical transmissions can be retro fitted to carry out the gearshift automatically.Their shifts must be detected by the sensors and controlled by the actuators.The method in detecting the shift with non contacted photoelectricity elements is proposed.For 5 speed gearboxes,two photoelectricity elements are used to detect three gear selecting positions,the other are used to two detect three gear shifting positions.The appropriate arrangement of switch inputs can make the nine shifts of a 5 speed gearbox be detected by four photoelectricity elements.Therefore the necessary switch numbers decrease,the necessary hardware is more simple and the control software is easy.The principle of shift detection and the program flow chart of shift control are given.