Narrative:

I set magnetic heading on ramp and not on runway. 40 mins after being airborne I realized that compass was very different from magnetic heading indicator. I realized I was going in opposite direction of correct heading. Unaware of my location, I flew until I had visual of airport, but too many aircraft were around the area so then I realized this had to be class B. I toggled through frequency until I heard radio communications. Was unable to establish communication with one of nearby airport. Circled around small airport at approximately 3000 ft until I encountered light gun signals, landed at willow run airport. I filed a flight plan to go back to pontiac. I landed and called proper auths. In the future I'll follow the run-up procedure more closely. I've learned that it's not a good idea to set heading with compass until I'm on the runway.

Google
 

Original NASA ASRS Text

Title: C152 STUDENT PLT GOT LOST AND ENTERED DTW CLASS B AND YIP CLASS D WITHOUT CLRNC.

Narrative: I SET MAGNETIC HEADING ON RAMP AND NOT ON RWY. 40 MINS AFTER BEING AIRBORNE I REALIZED THAT COMPASS WAS VERY DIFFERENT FROM MAGNETIC HEADING INDICATOR. I REALIZED I WAS GOING IN OPPOSITE DIRECTION OF CORRECT HEADING. UNAWARE OF MY LOCATION, I FLEW UNTIL I HAD VISUAL OF ARPT, BUT TOO MANY ACFT WERE AROUND THE AREA SO THEN I REALIZED THIS HAD TO BE CLASS B. I TOGGLED THROUGH FREQ UNTIL I HEARD RADIO COMS. WAS UNABLE TO ESTABLISH COM WITH ONE OF NEARBY ARPT. CIRCLED AROUND SMALL ARPT AT APPROX 3000 FT UNTIL I ENCOUNTERED LIGHT GUN SIGNALS, LANDED AT WILLOW RUN ARPT. I FILED A FLT PLAN TO GO BACK TO PONTIAC. I LANDED AND CALLED PROPER AUTHS. IN THE FUTURE I'LL FOLLOW THE RUN-UP PROC MORE CLOSELY. I'VE LEARNED THAT IT'S NOT A GOOD IDEA TO SET HEADING WITH COMPASS UNTIL I'M ON THE RWY.

Data retrieved from NASA's ASRS site as of July 2007 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.