Heidelberg is a beautiful city in the south of Germany.
When you are leaving Heidelberg, you might probably want to go to the A5. There is a feeder road to the A5, starting right in the town center, which makes it some kind of 'town exit' - Many cars leaving the city for the motorway will pass by. To get there from the train station, just walk into Gneisenaustr. in west direction for like 200m.
Follow Ringstraße in direction to Speyer. After crossing the rail-tracks and walking through a bridge you'll see a petrol station where you can talk to drivers directly, furthermore there is plenty of space for cars to stop. Note that all the cars go south here! You can also ask people just to drop you off at Raststätte Hardtwald West, 5 km south on the motorway.
Raststätte "Hardtwald" is a good place for north and south. Some 200 meters north of the place there's a tunnel under the highway, making it possible to change to the other side. You can reach the petrol station by public transport: Take a "S-Bahn" (suburban train, blackrideable) to St. Ilgen/Sandhausen and from there Bus 725 to "Lebenshilfe", the second leg can also be done by foot (exactly 2.9km from the S-Bahn stop to Hardtwald) and you'll pass a REWE with diveable dumpsters. From the "Lebenshilfe" stop it's five to ten minutes if you don't turn into the nature protection area on the left.