Glad you were able to find a solution to this problem. The outer ear is mainly composed of cartilage. Pain can occur if it's irritated. I believe this is called auricular chondritis. Like other areas of the body that have cartilage, it can become irritated for a variety of reasons. It sounds as if pressure from your pillow was the culprit.