Weird hardware fault

I’ve narrowed down what the problem is with my (otherwise fully functional) iBook. It basically won’t recognise the charger until the battery is totally drained. This would be quite annoying if it was still my main laptop, but as I replaced it with a shiny Sony Vaio at Christmas then it’s actually not a massive problem and just means I run it off the battery until it dies and then recharge it. The battery itself seems fine (it gives me about 3 hours of use on average), so it should theoretically have a little life left in it yet.