The movement of the 5 DOF robotic arm was controlled through the geometric approach in inverse kinematics analysis HSV color space, a series of filters (M edian, Bilateral, and Gaussian), and the drawcontour method to discover objects' colors, shapes, and centroid were implemented. The shapes and colors of the objects in different lighting conditions ranging from 5 to 7000 lux with an accuracy of 93.83% were discovered.The main contribution of this paper is to develop an innovative algorithm to accurately detect and identify the shape and color of objects under various light intensities and find their location to be manipulated by a pick-and-place robotic arm. Workpieces of various shapes and colors are dispersed on the robot's work plane and manipulated according to its specifications. The proposed algorithm utilizes the HSV color model to distinguish between different object colors and shapes. The S channel is used to detect the shapes of objects. After that, a series of filters (M edian, Bilateral, and Gaussian) are applied to reduce the noise of the segmented image to make the process of discovering the shap e and coordinates of the objects successful. The draw-contour method is used to discover the object's shapes. After the shape of the object is discovered, the centroid coordinates are calculated. After extensive testing on 354 images that are captured in various lighting conditions in the range of (5-7000 lux), the overall system performance of 93.83% is achieved, and the average execution time is 2.21s. Finally, we had a dependable flexible automatic pick and place system that could correctly detect and identify the objects based on their features.