Cessna 152
Flight Crew Private
Flight Crew Total 115.8
Communication Breakdown; Situational Awareness; Troubleshooting
Aircraft Equipment Problem Critical; Deviation / Discrepancy - Procedural Clearance; Deviation / Discrepancy - Procedural Published Material / Policy; Inflight Event / Encounter Fuel Issue
Flight Crew Landed As Precaution; Flight Crew Diverted; General Flight Cancelled / Delayed; General Maintenance Action
Human Factors; Aircraft
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.
C152 pilot reported total loss of communications and elected to divert to a precautionary landing.