ADC problem


Closed Thread
Results 1 to 6 of 6

Thread: ADC problem

  1. #1
    Join Date
    Aug 2007
    Posts
    27

    Default ADC problem

    I would like to measure a voltage between VCC and Mosfet's drain. How can i succeed with a PIC? I couldn't know where i put the deviders and how i write the codes. I can use adc functions well.
    Last edited by showtime; - 27th November 2007 at 23:43.

  2. #2
    Join Date
    Aug 2007
    Posts
    27


    Did you find this post helpful? Yes | No

    Default

    This circuit can help.
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    I see two problems here -

    First, you can't measure voltages that have a reference more than about .5 V above or below GND. To solve that problem you can either:
    A. Build a one or two op-amp level shifter or
    B. If the 20 V is stable, then just measure the drain voltage with a GND referenced PIC
    and the voltage across the load will be (20V - Vdrain).

    The second problem is that you appear to be using PWM to drive the gate. The voltage
    across the load will be something like a square wave with a near 0 to 20V swing.

    Your A/D will need some heavy filtering to give a meaningful result. And of course, the input of the A/D will need some sort of voltage divider to make sure that it doesn't see a voltage higher than Vref.
    Charles Linquist

  4. #4
    Join Date
    Aug 2007
    Posts
    27


    Did you find this post helpful? Yes | No

    Default

    I couldn't understand that opamp level shifter circuit. Please give me an example

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


    Did you find this post helpful? Yes | No

    Default

    You need to set up the op-amps as a differential amplifier, and I don't have time to go into the full design right now. If you aren't already familiar with differential amplifiers, I think that my suggestion of measuring the drain voltage and subtracting it from 20 is the easiest approach for you. If the 20V isn't stable, you could even use a second channel of the A/D to measure that voltage exactly. Four resistors (for two voltage dividers), two capacitors (for filtering) and a little code and your are done. Everything would be ground-referenced.
    Charles Linquist

  6. #6
    Join Date
    Aug 2007
    Posts
    27


    Did you find this post helpful? Yes | No

    Default

    Thank you very much Charles Linquis. I will try to do this.

Similar Threads

  1. pic12f675 ADC problem
    By radu022003 in forum mel PIC BASIC
    Replies: 3
    Last Post: - 1st September 2009, 10:13
  2. PIC18F2423, ADC problem
    By mistergh in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th March 2009, 01:31
  3. Mutliple ADC problem with PIC16F877
    By andyto in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd October 2007, 17:47
  4. ADC problem with PIC16F917
    By eetech in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th March 2007, 21:22
  5. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16:46

Members who have read this thread : 0

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