This study presents the development of an algorithm that detects potential front bumper collisions caused by road inclinations and provides early warnings to drivers. The system uses a Time-of-Flight (ToF) infrared distance sensor and an obstacle detection sensor, both implemented on an Arduino-based platform. By continuously monitoring the road ahead, the algorithm measures and analyzes the slope angle to identify potential hazards. This solution offers a cost-effective and efficient alternative to traditional warning systems, notifying drivers in advance of dangerous road conditions and helping to prevent vehicle damage caused by sudden changes in road gradient.