My tip is that the town you mean is probably Hei
delberg and not Heiselberg.
Otherwise buy your tickets in advance with Deutsche Bahn, check the train schedules and get yourself familiar with the ticket options. For example there is regional day ticket for Baden-Würrtemberg.
The regional day ticket for Baden-Württemberg is valid from 09:00 to 03:00 on the following day, all day on weekends and public holidays, on all local and regional trains, on transport association services and on almost all bus routes in Baden-Württemberg.
Price in 2nd class: EUR 23 plus EUR 5 per extra passenger (max. 4).
Original name of the offer: Baden-Württemberg-Ticket
Regional Day Ticket Link
With this ticket you can only use local and regional trains. The ticket is not valid on IC and ICE trains. When you look up for connections make sure you mark the box "local transport only"
Here is the link to the website
Deutsche Bahn