Much better, thanks. > It's Hobby. Its a 4 Series battery , each one is 1.2v, NiCd , =A0AA 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. For now it's just a simple board that detects the > voltage of the battery. =A0It's just one and it's just to learning. And f= uture > adding to Br-Gogo. The Brazil version of Gogo Board. > > About the Current drain, I think that sensor don't will consume too much. > Like a led (0.02 - 0.03A) or something like that. > For now it's a simple board that detects the voltage of the battery. Very quickly at this stage. Datasheet here (always useful to provide a reference) http://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf 18f4550 ADC has reference of either Vdd or external pins with user referenc= e on. If you regulate Vdd you could use it aqs the ADC reference. If you use battery as Vdd then you cannot measure battery voltage with ADC directly as it will always have the same value as Vref. If you use an external reference (eg TL431) you can use ADC to measure batt= ery. 4 x NimH or NiCd have Vmax of about 5.2V and Vmin is a bit uncertain but say 3.2V for very flat (=3D discharged) , 3.6 V for as low as you'd sensibly go, 4V for more sensible. Getting 20% left point is troublesome using voltage alone. For light loads they are around 1.2V/cell for most of life. For heavier loads (approaching 1C (say 0.3C up?) miore like 1.1V for most of life. Temperature and state of cell (cycles used, brand,etc) influence this somewhat. At a first guess I'd select say 1.05V/cell as low point or 4.2V for 4 cells. This is a 4.2 - 5V OR 2 - 5.5 V part depending on which version clock speed you choose. If you use a 3V3 Vdd then you can regulate the supply and use that as reference if desired. For maximum flexibility (with some disadvantages) you can use battery as Vdd and a reference on reference pins. Note that Vdd max operating is 5.5 V or =3D 5.5/4 =3D 1.375 V/cell. This is below what you will see on a NimH or NiCd cell BUT well below the maximum you get from eg Alkaline batteries. If you use Vdd =3D battery and somebody inserts Alkaline batteries you will get up to about 6.5 V on Vdd. This is a higher specd IC than some with Vdd abs max =3D 7.5V so it would probably survive BUT would probably misoperate - with the prospect of being destroyed dfepending on other factors. Use of an LDO for Vdd would remove this risk. Note that when measuring battery with an ADC you will need to scale down the voltage to meet the ADC Vin requirement. Russell -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist