Robotics technology has developed rapidly and applied to various fields of work that cannot be done by humans. Many forms and types of robots used include the hexapod robot. The purpose of this research is to regulate the direction of the hexapod robot’s motion and be able to avoid obstacles to maintain the stability of its motion using a PID control system. In establishing a good control system, various types of sensors are used, those are ultrasonic and inertial measurement unit sensors. The shape of the hexapod robot is made to be integrated with the robot's legs. Each leg of the robot consists of 3 joints, joined by a servo motor. There are 18 servo motors. Eight ultrasonic sensors are used to detect surrounding objects, run well, and ability to avoid obstacles. The main orientation of the hexapod robot motion is to move forward, but if there are obstacles, it will find a solution to turn using ultrasonic sensors. An inertial measurement unit sensor is used to maintain the robot’s body’s stability.