Error; low cost dc voltmeter +-20V

Discussion in 'Embedded Systems and Microcontrollers' started by Vindhyachal Takniki, Dec 1, 2014.

  1. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    349
    6
    1. I have to make a low cost dc voltmeter with range +-20V
    2. I am using the circuit as attached.
    3. problem is if I applu any voltage across j1 two terminals, I get correct voltage J2 terminal.
    If I apply 10V at j1, then voltage divider across 90K & 10K forms 1V across 10K.
    & net voltage at J2 is 2.5V+1V = 3.5V.

    4. But as soon as i connect microcontroller the voltage starts varying randomly, no particular value.
    I have configured pin properly as adc.
    5. If I apply direct voltage at pin say 1V, I am able to measure it properly.

    6. What could be error.
     
    • ckt.pdf
      File size:
      9.3 KB
      Views:
      28
  2. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    You didn't say which uC you were using but a few general thoughts:

    For many PICs, you have to keep the input impedence <2.5K (depends on the chip) to satisfy ADC acquisition requirements. The PIC databooks have info on this.
    Consider averaging or a low-pass digital filter on the ADC output. Most uC ADCs use successive approximation which is fast enough to convert noise on the inputs.
    You also have to have a stable voltage reference. For PICs, the reference can be derived from Vdd or a separate reference. For a voltmeter, I would use a separate, precision reference.
    Don't forget the obvious stuff such as keeping the input voltage in range with a common ground to Vref-.

    Have fun.
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    This scheme is dependent on the +/-20 input being completely isolated from the 5V supply. I suspect this is not the case because you see a "correct" value without the MCU.

    I see one way to connect the dividers, toss out R5, connect R4 to ground and read across R4. I can't draw this up right now, perhaps later tonight if I have time.

    The equivalent resistance of your divider is 9.5K, which may be on the high end for an A2D.

    Edit: Make that 10.5K if you insist on using R5.
     
    Last edited: Dec 1, 2014
    JohnInTX likes this.
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    Perhaps use a simpler input network?
    20V_meter_input.gif
     
    ErnieM likes this.
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    BINGO. As long as a 10K resistance on the unknown is acceptable that works great. It has a low resistance to the A2D, 900 ohms I believe.

    I'd still bump the resistors up by a power of ten or two, then add a unity gain buffer (rail to rail single supply op amp) to drive the input, just to lessen the loading of the "voltmeter." That may be beyond the scope of this exercize.
     
  6. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    349
    6
    solved, MCU pin was damaged.
     
  7. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    349
    6
    To protect pin from crossing voltage limit I have added two diodes.
    Instead of +-20v in this circuit it has CT whose output max is 1.5V ac.
     
    • ckt.pdf
      File size:
      8.6 KB
      Views:
      22
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Is there a question here?

    The attached circuit looks fine.
     
Loading...