The main problem of line follower robot is how to make the mobile robot follows a desired path (which is a line drawn on the floor) smoothly and accurately in shortest time. In this paper, the design and implementation of a complex line follower mission is presented by using Matlab Simulink toolbox. The motion of mobile robot on the complex path is simulated by using the Robot Simulator which is programed in Matlab to design and test the performance of the proposed line follower algorithm and the designed PID controller. Due to the complexity of selection the parameters of PID controller, the Particle Swarm Optimization (PSO) algorithm are used to select and tune the parameters of designed PID controller. Five Infrared Ray (IR) sensors are used to collect the information about the location of mobile robot with respect to the desired path (black line). Depending on the collected information, the steering angle of the mobile robot will be controlled to maintain the robot on the desired path by controlling the speed of actuators (two DC motors). The obtained simulation results show that, the motion of mobile robot is still stable even the complex maneuver is performed. The hardware design of the robot system is perform by using the Arduino Mobile Robot (AMR). The Simulink Support Package for Arduino and control system toolbox are used to program the AMR. The practical results show that the performances of real mobile robot are exactly the same of the performances of simulated mobile robot.