Abstract-Control system Teaching in new era is quite challenging, because many control concepts are formulated in the form of mathematics. In this paper, LEGO Mindstorms NXT connected with MATLAB/Simulink is introduced to assist the control system teaching. Lego Mindstorms NXT builds a mobile robot which includes two servomotors and one infrared light sensor. PID controller is designed in MATLAB/Simulink to achieve the line tracking of the mobile robot. Using the Ziegler-Nichols method, three key coefficients (proportional, integral and derivative) are tuned to get optimal control. The performance of PID controller has been validated by a series of experiments at different designed trajectories. Using the proposed method, the students can analyze and test the PID controller conveniently. These methods can also be extended to other similar courses.Index Terms-LEGO Mindstorms NXT, line tracking, MATLAB/SIMULINK, PID control.