> 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 ? If the source of the -10 to +10 V has a sufficiently low impedance, the simplest way is with a resistor divider. First, realize that the input voltage changes over a range of 20V while the voltage to the PIC should change over a range of 5V. So no matter what else happens, the circuit needs to divide the input voltage by 4: In --R1-----PIC | R2 | GND R1 = (4-1)*R2 = 3*R2 Just to put some numbers on it, we'll make R2 1K and R1 3K. This is about right for the PIC inputs, which are recommended for a resistance of less than 10K. But this circuit isn't complete, since it will measure voltages of 0-20 V fine but we want -10 to + 10 V. One solution would be to connect the entire circuit "ground" to -10 V. This isn't very practical. Another would be to connect the bottom end of R2 to some constant voltage, call it Vx. But what voltage? Well, when the input is -10 V, we need the PIC pin to be at 0V. So 10V / 3K = Vx / 1K. Vx should be 3.33 V. Does this check out? With 0V Vin, Vpic should be 2.5V. We have 2.5V / 3K = (3.333V-2.5V) / 1K, which is true. Very likely, there isn't a handy source of +3.333V in the circuit. But there is lots of 5V. So we could use another resistor divider to derive 3.333V: 5V ---R3-*------R4---GND | 3.33V here^ For this to work, (5-3.333) / R3 = 3.333 / R4. That simplifies to R4 = 2 * R3. But to be able to connect R2 (from above) to the junction and still approximate a constant source of 3.33V, R3 and R4 must be very small compared to R2. This isn't practical, since it would cause a heavy current drain from the 5V supply. Thinking about it some more, R2 isn't necessary at all if the parallel combination of R3 and R4 is 1K. The combination of R3 and R4 and the 5V supply will act like R2 and a 3.333 V supply would have (This is one of a very few truly useful things I learned in college). I'll spare the details of my twisted algebra to find R3 and R4, but the solution is R3 = 1.5K and R4 = 3K. So the final network is: +5V | 1.5K | Vin --3K----*---- PIC | 3K | GND You can scale the resistances to any convenient value, consistent with the source and load impedances. Only the ratio of the values is important. Note that disconnecting the input will cause a reading of +3.33V, not 0V as you might expect. Remember the Vin end of R3 must be connected to a low impedance in order for it to work. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]