Narrative:

On takeoff I had inadvertently left [the] com select switch on the radio with ground selected. When tower cleared me for takeoff I heard it over the ground radio. This caused me to not be able to communicate with tower or departure. If the tower told me to switch to departure; I did not hear it and during climbout. I switched anyway. We experienced a near miss of 200 feet with an aircraft crossing our departure on an assigned heading of 110. After leveling off at 2;000 feet as assigned; I was unable to hear ATC; and they were extremely busy. As we were in a single engine aircraft with passengers for me to continue on the assigned heading was placing me in an unsafe condition of being low over the ocean well beyond gliding distance to the shore. I elected to turn north. After a brief period of time I was able to remedy the radio selection problem and contacted ATC center. I advised them that I had turned north and began to turn back to the assigned heading. I was then given further clearance to proceed to the VOR. At this time I was asked if I had been on an IFR clearance with an assigned heading and was given a phone number to call for possible pilot deviation. My actions were for passenger and aircraft safety. The weather was clear.

Google
 

Original NASA ASRS Text

Title: The pilot of an M20 had incorrectly set up his communication radio switches and could not communicate with ATC after takeoff. He experienced a near miss before rectifying his communication problem.

Narrative: On takeoff I had inadvertently left [the] Com Select switch on the radio with Ground selected. When Tower cleared me for takeoff I heard it over the Ground radio. This caused me to not be able to communicate with Tower or Departure. If the Tower told me to switch to Departure; I did not hear it and during climbout. I switched anyway. We experienced a near miss of 200 feet with an aircraft crossing our departure on an assigned heading of 110. After leveling off at 2;000 feet as assigned; I was unable to hear ATC; and they were extremely busy. As we were in a single engine aircraft with passengers for me to continue on the assigned heading was placing me in an unsafe condition of being low over the ocean well beyond gliding distance to the shore. I elected to turn north. After a brief period of time I was able to remedy the radio selection problem and contacted ATC Center. I advised them that I had turned north and began to turn back to the assigned heading. I was then given further clearance to proceed to the VOR. At this time I was asked if I had been on an IFR clearance with an assigned heading and was given a phone number to call for possible pilot deviation. My actions were for passenger and aircraft safety. The weather was clear.

Data retrieved from NASA's ASRS site as of July 2013 and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.