This paper deals with sensor-based motion planning method for a robot arm manipulator operating among unknown obstacles of arbitrary shape. It can be applied to online collision avoidance with no prior knowledge of the obstacles. Infrared sensors are used to build a description of the robot's surroundings. This approach is based on the configuration space but the construction of the C-obstacle surface is avoided. The point automation is confined on some planes with square grids in the C-space. A path-searching algorithm based on square grids is used to guide the automation maneuvering around the C-obstacles on the selected planes. To avoid the construction of the C-obstacle surface, the robot geometry model is expanded, and the static collision detection method is used. Hence, the computation time is reduced and the algorithm can work in real time. The effectiveness of the proposed method is verified by a series of experiments.