Thanks audioguru, and hero999.
I'm 'iffy' about using a switcher, as its wall plug powered, and with all the problems with switching circuits..(this is inside a box woth lots of RF stuff) I tihnk I'll stick to linear. But cheers anyway, that looks like a wicked circuit!
Ok, back to the drawing board. Bizarely, I tihnk Have a good plan for almost everything in the circuit...temp measurement, the PIC code (its in pseudo code at the mo) and voltage measurement using the ADC, as well, as the comparator creating a make-shift slope A/D as a more accurate measurement of batt voltage (initial tests show I may be able to detect 1mv drop, so a 10mV should be easy).
The 'problem' area, is always my weak point. The current source. Again, as I have mentioned, I can choose what 'wall plug' powers upply to use (unregulated, any voltage, I<500mA) and with 3 NiMH AA's, thats min 3.0v, max 4.5V. I sitll want to avoid the wonderful convenience of the LM317, purely because of the dropout voltage...at 500mA, I will certainly need a heatsink on it.
I cannot afford the space for a heatsink, so as hero99 suggested, either a switcher....or, what I'm really after is a MOSFET/transistor constant current source. Now, my analogue knowledge is crap, and I have been doing the research/maths to work out all the specifics.
What makes it 'slightly' harder is, I need 3 different current values from the source: 500mA (full charge, 30-40mA (trickle) and really low (essentailly 'Off' but <5mA is ok). So, after looking around, I was thinking something like this:
https://radiolocation.tripod.com/LEDdimmer/Schematic.jpg
https://radiolocation.tripod.com/LEDdimmer/LEDlampDimmer.html
The voltage divider (the pot) could be replaced with a couple of uC I/O's and resistors, for a simple but effective way to change the current. I have that part down. But I stil don't fully understand how to make this 'high-side' so that the batteries -V terminal is GND meaning the charger, battery and app circuit ALL share the same ground.
Why are PNP's used for high side, and NPN's used for low side? Is it purely because of the voltage required to turn on/off PNP's and NPN's? (or in this case, MOSFETS). I can't say they'll me much of a voltage drop across the C and E, so power disappation in the main transistor/mosfet should be tiny (ergo...NO heatsink). So, could I use an NPN transistor/N-channel MOSFET to source current, or must I abode by the norm and go PNP?
Of anyone can shed some light on this, I'd be grateful. I'm learning, but slowly. And right now, all I have is NPN's, and N-channel (logic level) mosfets.
All I really need is a simple constant current source, with little power disappation (no heatsink for 500mA) and the ability to change the current by the use of resistors tied to logic I/O's (or switching transistors).
Thankyou.
Blueteeth
ps. Just before I make an order, will I need PNP's? or P-channel MOSFET's?