I am frequently asked these questions and don't always know how to answer. Since I have never had any classes on butterfly biology, what little I know has been gleaned from various sources over the years, so this post is a compilation of what I know and have learned from researching these questions today. For example, I never thought much about whether a butterfly could hear sounds, I knew they could feel vibrations, but I just learned that some butterflies actually have "ears" on their wings! Who knew?
Adult butterflies have large compound eyes that provide them with an almost 360 degree range of vision. They see the full color range including ultraviolet light, and they see polarized light which allows them to orient in relation to the sun even in cloudy weather. Many flowers have patterns that are invisible to our unaided eye, but are visible under ultraviolet light. When these flowers are viewed under ultraviolet light, "nectar guides" appear, where the center of the flower is often colored completely different than the rest of the flower. This feature also guides bees and other nectar- and pollen-feeders. An example of this can be seen here and many other websites by doing a search for "ultraviolet flower patterns".
Caterpillars, on the other hand, have very limited vision that is mostly a detection of light and dark.
Sensory hairs all over caterpillars and adult butterflies provide its sense of touch. These hairs are mostly on the body and head of adults and larvae, but some are also located on an adult's antennae. Some larvae communicate to each other with clicking or drumming that produces vibrations that others feel.
Butterflies smell with their antennae, palps, and some other parts of their body covered with sensory hairs. They can detect pheromones and host plants sometimes over a mile away.
Butterflies have special receptors in their feet that allow them to taste host plants and flowers. Have you ever noticed a butterfly perched on a leaf or flower and seemingly pawing the air with their legs, repeatedly scraping the leaf surface? It's their version of licking food to see if tastes right! Females are known to detect appropriate host plants to lay their eggs on by "tasting" the plant with their feet.
I am just learning about how this works, so if anyone reading this has more information or corrections, please comment on this post to let me know. From what I've read, not all butterflies have "ears", but more are being discovered. The most well-known examples are the tropical Crackers (Hamadryas) and Longwings (Heliconius), but the Blue Morpho was discovered to have ears that detect low- and high-pitched sounds. The "ear" is a tiny membrane-covered sac at the base of the wing (like having an ear in your shoulder). Many night-flying moths are also known to be able to detect the acoustic pulses of bats, but I'm not going to go into that here, maybe for another post!