It depends on the species. Most use them for chemical sensing, "smell". For example in the Luna moth, antennae are sexually dimorphic -- the male's are larger to detect the female's pheromones. But Manduca sexta also uses them as a kind of inertial guidance system to help stabilize its flight.
I think they are also used for sensing vibrations, "hearing", but I couldn't find a source for that.
https://en.wikipedia.org/wiki/Antenna_(biology)#Functions
@sciencebase
@Pat @sciencebase Thanks. Love the image of flying with them acting as gyros. Have you seen them on suspension bridge ropes?