Lucas Tanure wrote: > It's Hobby. Its a 4 Series battery , each one is 1.2v, NiCd , AA > Type, 2100MAh. Rechargeable > > I'm using a pic18f4550, with Ccs C Compiler. The cost of the system > its about a 30U$. If the battery get lower than 20% of the power the > pic will send a mensage to host. It sounds like you mean 20% of capacity, or energy left, not power. Please use the correct terms. If you really mean power, then point that out as it's quite unusual. NiCd batteries have useful end of charge voltages around 1.0V or even as low as 900mV depending on temperature, current drain, general health of the battery, and how much you're willing to abuse it. If you don't know any of these and just want a "mostly discharged" detection, use 1.0V. That's low enough so that not too much energy is left, but high enough that it shouldn't damage the battery and there is enough left to still run for little while and shut down the system cleanly. The 18F4550 is quite happy running from 3.3V. One possibility is to use a 3.3V LDO (like Microchip MCP1700 for example) to run the PIC, then a voltage divider to measure the battery. Since this is apparently just meant as a rough measure of "almost empty", you could try a PNP transistor around the LDO so that it is on when the battery is the B-E drop above the LDO. That will be around 600mV, to the battery pack threshold voltage will be 3.9V, which is around 970mV per cell. Good enough for a one off hobby "battery is low" detector. The advantage of the extra transistor is very low current drain for the battery detector, certainly a lot less than a straight voltage divider, keeping in mind the 18F wants to see a 10Kohm or less source driving its A/D input. There are lots of other ways too. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist