Narrative:

I am a student pilot taking [flying] lessons. I was on the final leg of my solo cross country flight and was given runway 15 to land. I was asked to enter traffic pattern right downwind and report mid-field. However; when I reached mid-field and was about to report my position; all communications went dead and shortly thereafter all avionics shut down.I was unable to communicate at all. All avionics including transponder went dead and I couldn't squawk 7600 for communications failure. I decided to move away from the airport and gain altitude and perhaps land at a non-towered airport and as I was taking that action; my fuel gauge had me at almost empty. This could have been part of the electrical issue (I had more than enough fuel for the entire flight) but not taking any chances; I circled the airport to visually check for any traffic and landed [on another runway]. After that I called the tower on my cell phone once I was clear of the runway. Under instructions from the tower; I was able to taxi to parking.at this point not sure what happened that caused the failure. Prior to take-off I checked the ammeter which indicated normal readings.

Google
 

Original NASA ASRS Text

Title: C172 student pilot reported a complete electrical system failure while entering the traffic pattern.

Narrative: I am a student pilot taking [flying] lessons. I was on the final leg of my solo cross country flight and was given runway 15 to land. I was asked to enter traffic pattern right downwind and report mid-field. However; when I reached mid-field and was about to report my position; all communications went dead and shortly thereafter all avionics shut down.I was unable to communicate at all. All avionics including transponder went dead and I couldn't squawk 7600 for communications failure. I decided to move away from the airport and gain altitude and perhaps land at a non-towered airport and as I was taking that action; my fuel gauge had me at almost empty. This could have been part of the electrical issue (I had more than enough fuel for the entire flight) but not taking any chances; I circled the airport to visually check for any traffic and landed [on another runway]. After that I called the tower on my cell phone once I was clear of the runway. Under instructions from the tower; I was able to taxi to parking.At this point not sure what happened that caused the failure. Prior to take-off I checked the ammeter which indicated normal readings.

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.