Measuring negative voltages


Closed Thread
Results 1 to 15 of 15
  1. #1
    Join Date
    May 2006
    Posts
    13

    Default Measuring negative voltages

    Hi every one:
    Does any one have any ideas as to how I can measure negative voltages accurately using the pic's internal ADC or an external ADC. The voltage would be between -2 to 12 V.
    thanx
    sam

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Raise it

    One idea might be to use an op-amp, like LMC662, and raise the negative voltage with the offset fed into the op-amp. But since the span is |-2-12|=14 volts you will need a divider too. So I would use a divide first to down scale the voltage range with a 2 resistor divider and obtain maximum 3 volts when the input will reach 12. That is because the op-amp would have an offset of 2 volts,so the output would be raise to 5Volts.

    The divider should be a divide by 4, like 3K from input to common node and 1K down to earth.

    The common node is going to feed the +input of the op-amp and the - input of the op-amp would get -2 offset voltage (with a low Z source). The output should be connected to the -input (follower). Now the power supply should be +/- 5 volt at least (sorry...).

    Ioannis

  3. #3
    Join Date
    May 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Talking

    thanx for the idea but is there any way you can give me a diagram.
    thanx
    sam

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    What part you don't understand?

    I do not ussually draw schematics on screen...

    Ioannis

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default OP based rectifer and amplifier/attenuator.

    Hi Sam,
    Attached is a schematic of an inputstage I've designed and used succesfully with the internal ADC. It's an OP-based rectifier with adjustable gain.

    Apply your -12V signal to the input and adjust P1 untill you get your desired output (+5V or +4.096 or whatever). (Do this before you connect the output to the ADC)

    The sign output will be high or low dependig on if the input voltage is positive or negative and you can use a digital input to read the sign and 'add' one bit of resoultion to the ADC resulting in +/- 10bit. Since your voltage is always negative you can leave that part out if you don't need it.

    There's one drawback though. You need to feed the OP-amp with +/-15V.

    Hope it helps.

    /Henrik Olsson.
    Attached Images Attached Images  

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    On the schetch of Henrik please consider the voltage drop on the output resistor of 1K that is going to be in series with the ADC input resistor of your PIC (about 10K). That will give a ratio of about 1/10th.

    Ioannis

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Valid concern.....

    Ioannis, Sam,
    Valid concern that MAY need attention!

    If the voltage drop over the output resistor does present a problem it can easily be adjusted for by changing the gain of the amplifier/attenuator with P1.

    BUT.....

    The datasheet for the 16F877 (which is the PIC I used and I suspect others are similar), table 15-12 says that the recommended impedance of the voltage *source* is max 10k. So the 1k shouldn't make that large impact on the result. I couldn't find any info on the actual input impedance of the ADC. Where did you find that?

    Further on, I belive that if the input impedance was 10k the ratio would be ~9/10 with a 1k source impedance.

    Thanks!
    /Henrik Olsson.

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Well, actually the input resistance of the ADC will change relative to the Vcc. For 5 volts would be 7K according to the diagram in Fig.11-2 of 16F877 DS and ading the interconnect resistance of 1K, makes for a total 8K. So this is a factor to concern when sampling the input. So, I would suggest to skip the maths and do a longer sampling just to be sure.

    Ioannis

  9. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Ioannis,
    You're right, ~7k @ 5V Vdd - I totally missed that graph!
    As you say, a longer sampling period may be needed. Trying will tell. Also, the PIC Mid Range Manual sugests a 0.1uF capacitor on the input if the signal isn't changing to quickly, may be worth a try if Sam decides to use the circuit.

    Thanks for the heads up on that graph!

    /Henrik Olsson.

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    You are welcome! That's the idea of the forum, help each other!

    Ioannis

  11. #11
    Join Date
    May 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Talking

    thank you all for all your responses. I think i have all the info that i need and now have to do some experiments.

    sam

  12. #12
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I measure negative voltages accurately without any external active components.

    All you have to do is connect a resistor from Vref to the A/D input pin, and another resistor from that A/D pin to the voltage to be measured.

    For example: To measure -12V, I use a National 4.096V reference on RA3 and a 2K resistor from that pin to the A/D input I want to use. From there, I use a 7.5K resistor to the voltage to be measured.

    The code then loops 19 times and adds the results of the conversions (for averaging). The result is then subtracted from 15360. The answer is in tens of millivolts.

    I have used this technique for years with good results.
    Charles Linquist

  13. #13
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Hi Charles. Yeap, this is the superposition theorem. I really forgot about it. Too many years ago...

    Clever though.

    Ioannis

  14. #14
    Join Date
    May 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Talking

    Hi Charles:
    That is exacly what i was looking for. do you have any formulas as to how to calculated different resistor values and to know how much offset you have and what not.
    thank you
    sam

  15. #15
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    You build a voltage divider from Vref. For example:

    If you are trying to measure a -5V (full-scale) voltage and you have a 5V reference:

    Build a voltage divider with a 4K resistor from Vref to the input of the A/D and another 4k from that pin to the voltage to be measured (the INPUT).

    If the INPUT voltage is at "0" volts, the A/D pin will be at 2.5V (or 512 counts if you are using a 10-bit A/D).

    At -5V input, the voltage at the A/D pin will be at "0" volts.

    So, to obtain a reading, run the converter and SUBTRACT the count from the "0" voltage input reading (512) and scale the result.

    If you still need more help, I can show you some more.
    Charles Linquist

Similar Threads

  1. Measuring p-p of a 1.5v to 12v ac signal?
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th October 2009, 16:22
  2. DS18S20 reading negative temperature
    By srob in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 28th December 2007, 21:21
  3. Reading (ADC) negative current
    By sougata in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st November 2006, 17:38
  4. Sort of OT, SMT cap...which side is negative
    By Christopher4187 in forum General
    Replies: 2
    Last Post: - 28th January 2006, 13:55
  5. Need Help in Measurement of Voltage
    By apache in forum General
    Replies: 5
    Last Post: - 5th June 2005, 15:39

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts