Nowadays, the current surge in diverse applications of robotic arms makes comprehending these concepts of paramount importance. Various studies have been conducted on the topic of robotic arms. However, little attention was paid to the coupling relationship between object tracking and kinematics. Therefore, this research paper delves into the intricacies of robotic arm dynamics, with a specific focus on the topics of Forward and Inverse Kinematics, alongside object tracking facilitated by color-based methodologies to deepen foundational insights into robotic arm functionality. Controlling the motion and movement of robotic arms is the initial step. Leveraging the capabilities of cutting-edge technologies such as OpenCV, Armpi, and Hiwonder, it becomes feasible to precisely rotate the servos to user-input degrees and accurately position the arm based on three-dimensional Cartesian coordinates. Additionally, cameras equipped in the system enable photographing and recognizing target objects. By analyzing various positions of the target object, the robotic arm can dynamically adjust multiple servos to maintain the object's relative position. This tracking mechanism relies on the Proportional-Integral-Derivative algorithm, incorporating a minimum valid area parameter to mitigate interferences. Harnessing these algorithms empowers the robotic arm to discern objects based on camera-detected colors, and is affected slightly by different angles or distances, meaning the system's error margin consistently resides within a favorable interval. The approach exhibits practical utility in daily life scenarios, such as drug classification and recognition.