Narrative:

Forgot to reset transponder after an IFR flight while flying home VFR. Flew out from under stl class B with incorrect code. Was not on a flight plan or talking to ATC. Noticed on ads-B that I was either ghosting or getting very close to an airplane indicating a climb and heading the same direction and within 100 feet. I was climbing. Decided to descend and see if the image changed. It did. Never saw the airplane; but evidently came very close to it. I slightly changed course; as did the other plane; which appeared to stop climbing at 7;000 feet. I continued my climb to 11;500 without further incident. Unfortunately still squawking the code given earlier in the day; eventually changing code to 1200 about 3/4 the way home.

Google
 

Original NASA ASRS Text

Title: GA pilot reported a NMAC on climbout from STL class B while not communicating with ATC. He did not reset the transponder code to 1200 from a previous flight.

Narrative: Forgot to reset transponder after an IFR flight while flying home VFR. Flew out from under STL Class B with incorrect code. Was not on a flight plan or talking to ATC. Noticed on ADS-B that I was either ghosting or getting very close to an airplane indicating a climb and heading the same direction and within 100 feet. I was climbing. Decided to descend and see if the image changed. It did. Never saw the airplane; but evidently came very close to it. I slightly changed course; as did the other plane; which appeared to stop climbing at 7;000 feet. I continued my climb to 11;500 without further incident. Unfortunately still squawking the code given earlier in the day; eventually changing code to 1200 about 3/4 the way home.

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.