This is the issue I had. Unfortunately it turned out to be a bad charging port. That is why I upgraded to the Galaxy6. To bad it was a very nice phone with some great features....
It may be that your USB port is either broken or is full of crud. Very carefully, with a fine needle and a magnifying glass, try and clean out your USB port. An air duster is even better. At the same time, check to see if you have any bent or missing pins. Another thing to check is your battery. See if it fits snugly in the housing. A strip of sellotape on the bottom of the battery can fix it if it is loose. If you place the battery flat on a table, are you able to spin it. If so, this would indicate a swollen battery that needs to be replaced. See if you can borrow another S5 battery to test in your phone whilst charging. If that will not charge, it would indicate a damaged port.