On Wed, 10 Jun 1998, Chaipi Wijnbergen wrote: > Hello PicList members, > > I need to build a device that would be able to measure an analog signal that > range from -10V to +10V. > > Can anyone please suggest a circuit that will enable a PIC 16C77 to sample > this voltage ? > > Thanks Chaipi Chaipi, I think that this could be best done by having + and - 5 V supplies running a rail-to-rail op-amp in unity gain inverting voltage adder configuration. The input signal would go thru a divide by four attenuator and into the adder. There would also be a 2.5 V signal feeding the other input to the adder. A +/- 10V signal, divided by four and added to 2.5, yields 0 to 5V, which could be fed to the pic. The signal reaching the pic would be inverted, so the software would have to invert it back. THe whole circuit would involve only 10 parts. Hre is a lame ascii art drawing of the circuit: X-------+ | +-------------------10k---------------+ 15k | | +---10k-------+-----[op amp inv input | 5k | output----+-2.2k---+-PIC | | | GND | +-[op amp non inv input - | | ^ 5v | 5k | | | | GND 10k | GND +-----10k--+ 10k | GND Note the protection diode on the pic input. THis is to supplement the PIC internal diode if the op amp should output below 0 V. If the voltages very close (within 60mv or so) to +10 and -10v matter, run the op amp off +/- 5.5V supplies. Otherwise, you can run it off +/- 5v. You might also want to use a potentiometer for the 2.5V voltage divider, since you can compensate for slight errors in the circuit by adjusting it. Good luck, Sean > > > \\\|/// > \\ ~ ~ // > ( @ @ ) > ----------------------------oOOo-(_)-oOOo----------------------------------- > ! ! > ! Chaipi Wijnbergen ! > ! Electronics/Computer Eng. M.Sc. Tel : +972-8-9343079 ! > ! Optical Imaging Laboratory Fax : +972-8-9344129 ! > ! Brain Research Center Email: chaipi@tohu0.weizmann.ac.il ! > ! Weizmann Institute of Science WWW : http://www.weizmann.ac.il/~chaipi ! > ! Rehovot 76100 ISRAEL ! > ! ! > ------------------------------------Oooo.----------------------------------- > .oooO ( ) > ( ) ) / > \ ( (_/ > \_) >