We propose a sensor based navigation algorithm for a mobile robot that assures a convergence property when the robot is navigated from a given start position to a goal position while avoiding moving and fixed obstacles. This algorithm guides the robot toward the goal by using its sensor information in an unknown environment. Conventional sensor based navigation algorithms such as Bug algorithm and Tangent Bug algorithm do not assure the convergence property to the goal position, and they may fail because of dead-locks in the presence of moving obstacles, because they work only for fixed obstacles in the unknown environment. In the real world, a robot should reach the goal avoiding fixed and moving obstacles. Typical examples of moving obstacles include human beings in a real world workspace. We propose a new algorithm to guide a mobile robot toward the goal position that treats the navigation problem for such workspace. The basic concept of this algorithm is based on detecting a loop in the robot's path that is characteristic for the avoidance of moving obstacle. Simulation examples of sensor based navigation in the presence of moving and fixed obstacles are shown to demonstrate effectiveness of the proposed algorithm.