Narrative:

I was flying from ZZZ to ZZZ1 for pattern work; and on final for the first touch and go the pfd indicated it was running on battery and the alternator field circuit breaker was popped. I reset the circuit breaker; broke out of the pattern and started heading back to ZZZ as a precaution. The alternator field circuit breaker would not stay engaged more than 1-2 minutes; where I would reset it again.I was talking to ATC approach the whole time for flight following and gave them a heads up on the situation of a possible impending electrical failure; and they in turn gave ZZZ tower a heads up on the situation. Getting closer to ZZZ I turned off all unnecessary lights and the number 2 radio just to conserve power. Once I contacted ZZZ tower they cleared me for a right downwind for xx. Right as I was coming up on the north/east shore of the reservoir there was a 'pop'; and a large puff of acrid electrical smelling smoke with sparks emanating from behind/below the panel on my side of the aircraft.I immediately [advised ATC about] smoke in the cockpit and told them I needed the runway right now and I was headed for runway yy. They cleared traffic away and me to land; and which point I radioed that I was turning off the electrical/master. I was alternating looking down at the panel/my feet for any more sparks/smoke and ahead of me to setup for landing. I opened the window for some fresh air and was able to land safely and then with the aircraft on the ground and under control I pulled the mixture and fuel control valve off. I coasted off to the ramp and evacuated the aircraft and the fire equipment soon came. The fire department confirmed there was no active fire with a thermal camera and left quickly for another call.I believe constantly resetting the popped circuit breaker might have been a contributing factor to the smoke/sparks. We have been having trouble with the alternator field circuit breaker for a while and mechanics would check it out but the root cause was not found so the issue would recur. Because of this and the seemingly innocuous nature of the continued situation it had become a standard process almost to reset it every time it pops; which is something that I will not do in the future more than once.

Google
 

Original NASA ASRS Text

Title: C172 pilot reported smoke and sparks in the cabin following the repeated resetting of the Alternator Field circuit breaker.

Narrative: I was flying from ZZZ to ZZZ1 for pattern work; and on final for the first touch and go the PFD indicated it was running on battery and the Alternator Field circuit breaker was popped. I reset the circuit breaker; broke out of the pattern and started heading back to ZZZ as a precaution. The Alternator Field circuit breaker would not stay engaged more than 1-2 minutes; where I would reset it again.I was talking to ATC Approach the whole time for flight following and gave them a heads up on the situation of a possible impending electrical failure; and they in turn gave ZZZ Tower a heads up on the situation. Getting closer to ZZZ I turned off all unnecessary lights and the Number 2 radio just to conserve power. Once I contacted ZZZ Tower they cleared me for a right downwind for XX. Right as I was coming up on the north/east shore of the reservoir there was a 'pop'; and a large puff of acrid electrical smelling smoke with sparks emanating from behind/below the panel on my side of the aircraft.I immediately [advised ATC about] smoke in the cockpit and told them I needed the runway right now and I was headed for Runway YY. They cleared traffic away and me to land; and which point I radioed that I was turning off the electrical/master. I was alternating looking down at the panel/my feet for any more sparks/smoke and ahead of me to setup for landing. I opened the window for some fresh air and was able to land safely and then with the aircraft on the ground and under control I pulled the mixture and fuel control valve off. I coasted off to the ramp and evacuated the aircraft and the fire equipment soon came. The fire department confirmed there was no active fire with a thermal camera and left quickly for another call.I believe constantly resetting the popped circuit breaker might have been a contributing factor to the smoke/sparks. We have been having trouble with the Alternator Field circuit breaker for a while and mechanics would check it out but the root cause was not found so the issue would recur. Because of this and the seemingly innocuous nature of the continued situation it had become a standard process almost to reset it every time it pops; which is something that I will not do in the future more than once.

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.