Research on robot path planning based on the PSO (Particle Swarm Optimization) method has been widely developed. PSO is one of optimization algorithm that aims to provide the best solution on the finding of shortest route by utilizing particle population movements. In this paper, we developed a line follower robot with obstacle avoidance based on PSO. The PSO is embedded into Arduino microcontroller to control the navigation as well as avoid the obstacles. The robot is programmed a start point on coordinate (1,1) and a destination point on coordinate (5,5). The robot performances to avoid the obstacles were tested by robot goes to destination point while obstacles were added to the route. The computation time and the shortest route distance of the robot to reach the destination point with and without obstacles have been compared.