Ants use a variety of means to sense danger. The approach depends on the species of ant. Some ants can see items that are nearby. Other ants don't have eyes, such as driver ants. These types of ants rely on have chemoreceptors on their antennas. If separated by their horde, they use these chemoreceptors to reconnect as they are more protected when a part of the group than when alone. Ants also have special hairs on their legs called satae. The satae vibrate upon movement. The ants use a method called triangulation in order to determine from which direction the movement is coming. Lastly, ants may use the sense of smell as a means of protection.
Good luck! I hope you find this information useful!