Dan Michaels wrote: > > Roman Black wrote: > >Hi Dan, > > > > I have a battery voltage sensor using one PIC pin > >that doesn't need the ADC feature, so it can be used on > >any cheaper PIC that only has digital inputs. It does > >require that the PIC is run from a regulator and the battery > >voltage changes but the PIC Vdd does not. It uses about 30uA > >so is useful for some circuits. > >It uses two resistors and one small ceramic cap. > >-Roman > > > > Of course, mine is soooo much slicker, cause I do use an > A/D channel <-- choice of control freaks everywhere. > > So when you gonna show your ckt, anyways, Roman? [use large > Rs, pull down pin, switch pin to input, count seconds for pin > to exceed Vin(threshold)]. > > - danM Actually Dan, your circuit is better than mine! I used a resistor divider from battery to PIC pin to GND, with the cap on the ground side. I pulled the pin high and count cycles for it to get down to low level. Bottom R is much less ohms of course. Your idea just needs one R from battery + to the pin, with the cap to gnd. Then pull the pin low and count for it to get high again. With a 560k resistor and the pin held high by software, your circuit would use much less power too. Good way to measure a battery voltage with just a digital pin (not ADC). Pretty cool! -Roman -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body