Narrative:

Departed ZZZ on an IFR flight plan; destination ZZZ1. Opened flight plan and was cleared to 7;000 ft direct ZZZ1 and was attempting to squawk a code. The transponder was not showing a return and was confirmed by ATC. I turned on cabin heat and all radios went dead. After picking up my flashlight and trying to correct the problem and investigate; I made the decision to return to base. After putting in a 7600 code on the transponder (hoping it could be seen); I did a 180 degree turn and headed back in the general direction of ZZZ. It was just breaking daylight and I could still see the rotating beacon at the airport. I made a typical VFR descent while being aware of the 2 airports now off my right wing. Someone had turned on the runway lights at ZZZ so the landing area was clearly visible. Gear and flaps were deployed normally and I landed.

Google
 

Original NASA ASRS Text

Title: An IFR PA-27 pilot lost electrical power during climb out and could not talk with ATC or squawk transponder codes. The pilot returned to land at his departure airport NORDO.

Narrative: Departed ZZZ on an IFR flight plan; destination ZZZ1. Opened flight plan and was cleared to 7;000 FT direct ZZZ1 and was attempting to squawk a code. The transponder was not showing a return and was confirmed by ATC. I turned on cabin heat and all radios went dead. After picking up my flashlight and trying to correct the problem and investigate; I made the decision to return to base. After putting in a 7600 code on the transponder (hoping it could be seen); I did a 180 degree turn and headed back in the general direction of ZZZ. It was just breaking daylight and I could still see the rotating beacon at the airport. I made a typical VFR descent while being aware of the 2 airports now off my right wing. Someone had turned on the runway lights at ZZZ so the landing area was clearly visible. Gear and flaps were deployed normally and I landed.

Data retrieved from NASA's ASRS site as of April 2012 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.