Narrative:

Upon departing to the southeast; I began to smell something in the cockpit. It was a very faint smell; and my student began to smell it as well. I looked down at our electrical panel and saw smoke beginning to come out. I immediately turned off all of the light switches and began a turn back towards [our departure airport] while advising ATC of the turn around. Upon turning off the electrical switches; the smoke stopped almost immediately; so I decided to leave the rest of our electrical equipment on and come back for a landing. The fire crew noted that there was no hot spot within the aircraft and that we turned off the switches in time to avoid any electrical fire.

Google
 

Original NASA ASRS Text

Title: C172 Instructor reported smoke in the cockpit that stopped after he turned off the light switches.

Narrative: Upon departing to the southeast; I began to smell something in the cockpit. It was a very faint smell; and my student began to smell it as well. I looked down at our electrical panel and saw smoke beginning to come out. I immediately turned off all of the light switches and began a turn back towards [our departure airport] while advising ATC of the turn around. Upon turning off the electrical switches; the smoke stopped almost immediately; so I decided to leave the rest of our electrical equipment on and come back for a landing. The fire crew noted that there was no hot spot within the aircraft and that we turned off the switches in time to avoid any electrical fire.

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.