Q:

Trying to detect if a battery is charged

So I am doing a project as part of which I have rechargeable 5V battery and a charging source. I want to detect if the battery is charged and if it is then all the current should flow to a dummy load but if it isn't then all the current should flow to the battery. I many people I have asked said I should use a voltage comparator however I don't quite understand how.
Can you explain/ provide an example diagram of how everything should be connected or if there are other methods which can be used?

A:

This is worryingly like a "design this for me" question. Assuming it is not and you know what your are doing, I shall attempt to assist.
So you say the battery is a 5V battery. Without knowing its charge level vs voltage graph, there's not much I can say about how to read the charge state other than: the voltage will vary with charge. If you measure this voltage you will be able to tell the charge state of the battery. This is assuming that you are drawing only a low current from the battery, as internal resistance will reduce the voltage of the battery at higher current draw.
You can measure the voltage with an op-amp, the output of which can either got into a comparator (for a "dumb" on-off reading) or into an analogue to digital converter and micro-controller of some sort which can then do some intelligent control. Assuming you go for a micro-controller for the more intelligent and versitile option, you can then turn on/off transistors  with it, if doing it the method with discreet components, then you'll need to wire in logic as required to shunt the current around.
As for getting your charge source, I'm assuming you have a dedicated module already set up for this, or at least know how to design one yourself, as charging batteries can be tricky. Without knowing the specifics of your application and battery pack, there's not much assistance I can give.

