ok no problem i want to charge a single type but with different voltagesThere are dedicated IC's to control the charge of batteries. Some are limited to a single battery chemistry (which dictates the charging strategy) but I've seen some that can be programmed for different battery chemistries. If you haven't seen it yet, I suggest a visit to the Battery University.
Detecting voltage is a poor strategy unless you are charging lead-acid.
If you want a do-it-yourself solution, you should limit yourself to a single battery type. Otherwise it will be very complex.
thank uTake a look here and see if anything sounds good.
by Jake Hertz
by Jake Hertz
by Jake Hertz