C152 pilot reported total loss of communications and elected to divert to a precautionary landing.
Synopsis
C152 pilot reported total loss of communications and elected to divert to a precautionary landing.
Narrative
I acknowledge my mistakes when I diverted my flight to ZZZ on DATE. First of all; my radios stopped working when I switched my frequency to ZZZ1 Approach at XXX.XX. I tried reaching them multiple times to see if they could still hear me. Unfortunately; I am not certain if my means to contact them and inform them about my situation worked. Thus; I was forced to notify them about my need to terminate the flight following and squawk VFR.Secondly; I looked up to the red voltage warning light to look for any signal; however; it was also not working. I was already at a lower altitude at that time; avoiding the ZZZ and class Charlie airspace. When I was already 3 miles east of ZZZ; I decided not to continue to ZZZ2 because the engine began to travel roughly and the fuel gauges were going back and forth to the red line. At that time; I thought I was running out of fuel because I remembered from my very first solo flight from time building I consumed 21.6 gallons out of 24.0 gallons which was a lot. So; I did not climb up to 1;499 feet anymore to wait for light signals. Nevertheless; I still tried my best to observe where the traffic was; and they were using Runway XX. However; I needed to land on Runway XY because I did not have enough space and altitude to make it on Runway XX. I then contacted the ZZZ immediately to let them know what has happened.Lastly; in order to look closely into what has caused the incident to occur; our school's mechanic inspected the airplane. They have confirmed that I experienced an alternator failure.
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.