Narrative:

I was flying VFR in VMC conditions with a safety pilot in the right seat. I was flying at 3;000ft under an overlying class bravo airspace shelf at 5;000ft. In my mind I had intended to stay at 3;000ft for the relatively short flight but had never verbalized it to the safety pilot. The safety pilot prompted me to start a climb to a higher altitude. I went ahead and initiated the unplanned climb in a now overlying 6;000ft class bravo shelf and started a turn to the south/southwest at the safety pilot's suggestion as well. Shortly thereafter; I identified a lower class bravo shelf of 3;600 ft between us and our direction of flight. I initiated an immediate descent and began a 180 degree turn to remain within the overlying 6;000ft class bravo shelf. As soon as I initiated the descent I heard a very loud bang come from the engine. I had never heard anything like the loud bang before. I identified an uncontrolled airport to the west of my position and what I thought was within potential gliding distance. I stopped my initial turn and continued my descent heading towards the uncontrolled airport. As I descended; the engine made continuous banging noises; but the noises were quieter than the initial loud bang. I was concerned the engine was going to quit functioning and continued my descent to the uncontrolled airport where I made a precautionary landing. The uncontrolled airport was underneath the 3;600ft class bravo shelf. In the future it will be important to assure I discuss plans; routes; altitudes; etc. With the safety pilot before the flight as well as requesting VFR flight following near bravo airspace.

Google
 

Original NASA ASRS Text

Title: C172 pilot and safety pilot reported diverting to a nearby alternate airport when the engine began to backfire.

Narrative: I was flying VFR in VMC conditions with a safety pilot in the right seat. I was flying at 3;000ft under an overlying Class Bravo airspace shelf at 5;000ft. In my mind I had intended to stay at 3;000ft for the relatively short flight but had never verbalized it to the safety pilot. The safety pilot prompted me to start a climb to a higher altitude. I went ahead and initiated the unplanned climb in a now overlying 6;000ft Class Bravo shelf and started a turn to the South/Southwest at the safety pilot's suggestion as well. Shortly thereafter; I identified a lower Class Bravo shelf of 3;600 ft between us and our direction of flight. I initiated an immediate descent and began a 180 degree turn to remain within the overlying 6;000ft Class Bravo shelf. As soon as I initiated the descent I heard a very loud bang come from the engine. I had never heard anything like the loud bang before. I identified an uncontrolled airport to the west of my position and what I thought was within potential gliding distance. I stopped my initial turn and continued my descent heading towards the uncontrolled airport. As I descended; the engine made continuous banging noises; but the noises were quieter than the initial loud bang. I was concerned the engine was going to quit functioning and continued my descent to the uncontrolled airport where I made a precautionary landing. The uncontrolled airport was underneath the 3;600ft Class Bravo shelf. In the future it will be important to assure I discuss plans; routes; altitudes; etc. with the safety pilot before the flight as well as requesting VFR flight following near Bravo airspace.

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