>
> Drew Vassallo wrote:
> >
> > >i have an unknown voltage that will vary from about 0 volts up to about 30,
> > >and i need to determine what that voltage
> > >is via a 16F877 pin.
> >
> > I don't know about the inputs of a 16F877, but I assume that 30V is a little
> > out of spec.
> >
> > >i know that i could just do a simple voltage divider, put that on a A/D pin
> > >and figure it up.
> > >what i'd like to do is find a way to get it without drawing current all the
> > >time.
> >
> > Then why not just put a transistor in to open the current path when not in
> > use? Turn it on, take your reading, turn it off.
>
> Do both together, turn the transistor on and power up
> your 2R divider (so about 30v==5v), then turn it off,
> and a small C on the bottom resistor will determine
> the time to discharge, and the PIC pin can measure the
> time to reach the 0.2v at the schmidt input low
> threshold, time will be relative to the amount of
> volts on the 2R divider at the start. This will
> work. It will have to measure from 30v to about
> 4.8v minimum, as the PIC schmidt pin needs to exceed
> 0.8v to give high level.
>
> It would take two pins and two transistors. ie,
> PIC pin drives npn, drives pnp to turn on 2R divider.
> And it is only good for 30v to 4.8v range.
>
> Now I challenge someone to do it with ONE PIC pin!!
> Or less/no transistors! Or better range!
>
> Requirements:
> 1. must measure up to 30v
> 2. must draw no current from measuring circuit
> when not needed.
>
> :o)
> -Roman
>
> --
>
http://www.piclist.com hint: PICList Posts must start with ONE topic:
> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads