Several solutions have been proposed in the literature to address the Unmanned Aerial Vehicles (UAVs) collision avoidance problem. Most of these solutions consider that the ground controller system (GCS) determines the path of a UAV before starting a particular mission at hand. Furthermore, these solutions expect the occurrence of collisions based only on the GPS localization of UAVs as well as via object-detecting sensors placed on board UAVs. The sensors' sensitivity to environmental disturbances and the UAVs' influence on their accuracy impact negatively the efficiency of these solutions. In this vein, this paper proposes a new energy and delay-aware physical collision avoidance solution for UAVs. The solution is dubbed EDC-UAV. The primary goal of EDC-UAV is to build inflight safe UAVs trajectories while minimizing the energy consumption and response time. We assume that each UAV is equipped with a global positioning system (GPS) sensor to identify its position. Moreover, we take into account the margin error of the GPS to provide the position of a given UAV. The location of each UAV is gathered by a cluster head, which is the UAV that has either the highest autonomy or the greatest computational capacity. The cluster head runs the EDC-UAV algorithm to control the rest of the UAVs, thus guaranteeing a collision-free mission and minimizing the energy consumption to achieve different purposes. The proper operation of our solution is validated through simulations. The obtained results demonstrate the efficiency of EDC-UAV in achieving its design goals.