Flight Crew Commercial; Flight Crew Flight Instructor; Flight Crew Instrument; Flight Crew Multiengine
Flight Crew Last 90 Days 400; Flight Crew Total 950; Flight Crew Type 350
Communication Breakdown; Time Pressure
Aircraft Equipment Problem Less Severe; Deviation / Discrepancy - Procedural FAR; Deviation / Discrepancy - Procedural Published Material / Policy; Inflight Event / Encounter Weather / Turbulence
Air Traffic Control Provided Assistance; Flight Crew Diverted; Flight Crew Landed in Emergency Condition
Aircraft; Weather
On the way from ZZZ; the airplane lost electrical power. Enroute; I decided to activate the autopilot after which the alt circuit breaker popped out and the avionics started flickering. I notified it to ATC immediately and decided to request clearance to proceed back to ZZZ. I chose to go to ZZZ since I am familiar of the airport and had we lost [communications] proceeded to the original destination; I wouldn't have been able to pick up weather on the way. The radios became intermittent and then I squawked the 7500 by mistake. I intended to squawk 7600; but somehow entered the wrong squawk code. ZZZ TRACON somehow notified us on our intermittent radio and we corrected the squawk code. On our clearance back to ZZZ; I told ZZZ TRACON that we will shoot the RNAV XX approach and then we lost all radios completely. We landed uneventfully by using the ForeFlight app on my iPad. That was the best option in my opinion since I didn't have any navigation source remaining.
C182 pilot reported losing electrical power and squawking wrong code of 7500.