Aiming at the problem of agricultural robots such as being difficult to adapt to the complex operating environment in field ,highter cost for promotion and application ,designed an automatic steering system based on the steering wheel angle-sensor and the steering motor ,formed a closed-loop control system by sensor and motor .Taking STM32F103 single chip microcomputer as the core of the control system, the PID control algorithm based on the model of steering deviation ,and analyzed and verified the effectiveness of the steering drive .The experimental results show that the maximum mean absolute error of the steering wheel angle is 0.60 degrees, and the angle of the target is obtained by 0.8-1.0s.