different voltaje a/d sensors


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You should be able to do it with three Resistors and two additional PIC pins...

    R1 connects between Vdd and VRef+.

    R2 connects between VRef+ and Digital PICpinX.

    R3 connects between VRef+ and Digital PICpinY.

    For additional stability, I would connect a 100nF Capacitor between VRef+ and 0v.

    Vref- connects to 0v.

    PICpinX and PICpinY are any available PIC pins that you have spare, that have full I/O capability and when in INPUT mode DO NOT have an internal Weak Pull-Up enabled.

    When requiring 5v on Vref+, set PICpinX and PICpinY to INPUT. A Vref+ of 5v is provided via R1. R2 and R3 are effectively not in circuit.

    When requiring 3.3v on Vref+, set PICpinX to OUTPUT LOW and PICpinY to INPUT. Vref+ is the product of Resistor divider chain R1 and R2. R3 is effectively not in circuit.

    When requiring 3.0v on Vref, set PICpinX to INPUT and PICpinY to OUTPUT LOW. Vref+ is the product of Resistor divider chain R1 and R3. R2 is effectively not in circuit.

    Resistors should be 1% or better. For absolute precision, make R2 and R3 hi-stab multi-turn pots and calibrate for 3.3v and 3.0v with their respecive PICpinX or PICpinY pulled OUTPUT LOW.

    In software, remember when switching between different VRef's, allow a short settling time before performing a new ADC measurement.

    Simple... cheap...

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    Simple... cheap...
    That is slick !!!
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    You should be able to do it with three Resistors and two additional PIC pins...
    I considered that but the OP seemed to be asking how to promote the 3.0V and 3.3V sensors so they are, in effect, 5V sensors. I don't think anything other than amplifying the signals accomplishes that.

    By changing ADCON1 on the fly (between AVdd & Vref+) you can simplify it further. Or, it can be simplified by using 3.3V for the thermistor circuit.

    However, it does assume that the OUTPUT LOW voltage is 0V which may not be the case. It may be as high as 0.6V @ 4.5Vdd.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Actually you don't need to assume 0v. It can be 1v for all the divider Resistors care... choose the values for R2/R3 that will give you 3.3v/3.0v when that pin is LOW, if you assume 0.6v then you will be pretty close with a paper exercise. If it's a one-off build (or a product where a high degree of accuracy is required), the using Hi-Stab multi-turn pots and manually calibrating as I suggested is the way to go...

    Either way, it's just another suggestion thrown into the melting pot of ideas... another could be using an LM317 and using the PIC to switch-in different Resistor values for different voltages (depending on the current draw, that option could also power your Sensor as well as Vref+)... one could carry on throwing ideas around all night long...

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Mel is Right ( as always !!! )

    For a project I am developping these days ... I use a DAC to feed the Vref + of the ADC ( external ...) and GND or a fraction of Vref+ as Vref - ...

    Note Vref+ is to change with atmospheric conditions ( NO, I didn't tell it's a barometer, ... nooooo ... )

    just to artificially enhance the ADC resolution ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    Actually you don't need to assume 0v.
    Yeah - I realized that just after posting.

  7. #7
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    I'm really amazed on how much options have appeared for the same operation thx all, and I have really learned from all of you, but...
    ...In my specific application, I must choose the closest possible to realtime AD option, and Melanies is a really great solution but it requires switching and waiting for a settling time for a succesfull digitalization.

    My application is an IMU, which means sampling 8 A/D as fastest as possible, then applying kalman, then PID, while doing PWM, interrupt bidirectional communications, logic & communication to other PIC's. Probably I'm abusing my poor PIC, and from all tasks, analog conversion should be the priority as the rest of the processess are based on my movement sensors, to stabilize movement.

    Is Amplifying all analog signals to 5v the best choice?
    Is OpAmp the best choice to amplify them?

    Really thx babies & guys.-

    PD: I changed from PIC18F4431 to PIC18F4553, for faster speed (12 MIPS [48 MHz/4]), more A/D inputs (13 pins) and better A/D resolution (12 bit)
    Last edited by RodSTAR; - 21st October 2009 at 14:45. Reason: MCU Update
    "Beethoven had his critics too, see if you can name 3 of them"

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by RodSTAR View Post
    best choice?
    That's too subjective a criteria.

    You can maximize resolution by choosing Vref+ that is(are) slightly higher than the highest expected voltage(s) from your sensor(s). This would be an extension of Melanie's approach. For example, if the gyro never outputs more than 3V you could use 3V for Vref and power the thermistor circuit with 3V also. There's no additional switching.

    The op amp solution is straightforward, time-honored and easy to understand. It can also maximize resolution and operates in realtime (essentially) so there are no additional delays.

    Both increase noise sensitivity.

    You really need to be clear about what you want. If you want maximum sensitivity, 5V/4096=1.22mV per unit while 3V/4096=0.73mV per unit so the op amp gives you a little more sensitivity. The difference is proportionally greater with 10-bit ADC.
    Last edited by dhouston; - 21st October 2009 at 15:11.

  10. #10
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Well, ultimately the question is "Can I afford to lose 1 Bit of resolution in exchange for speed"?

    If the answer is YES, then your worstcase scenario with a 10-Bit ADC is...

    5v Sensor = 1023 Bits FSD
    3.3v Sensor = 675 Bits FSD
    3.0v Sensor = 613 Bits FSD.

    ... and you don't have to do anything.

    If you can't live with that, then it looks like OP-AMPs could be your choice. That's a lot of extra components for one extra measly bit of accuracy...

    But you could of course run your PIC at 3.0v (the voltage of your lowest Sensor) and simply use divider Resistors for your 3.3 and 5.0v Sensor inputs.

  11. #11
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Smile

    Considering melanie's and dhouston, last suggestions, I think the simplest, cheapest, noise cleanest, circuit simplest and MIPS faster option is to just connect sensors directly to my MCU/PIC/CPU.. specifically considering this case in which my PIC has a 12 bit resolution A/D (4 times the resolution than 10 bit). I'm happy with the idea, will test it and I'll let you know how how it works! and I think I'll can live with it

    __
    PD: Just away from this, appart I will play with OpAmps, just to know how these toys work.

    RodSTAR
    "Beethoven had his critics too, see if you can name 3 of them"

  12. #12
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Mel

    I think the main Problem in those Autopilots is the "Heading lock" feature ... One must ALSO measure very small Gyro variations for the Vehicle ( let's say UAV ... 10$ !!! ) to keep the perfect straight line.

    so, a maximum resolution must be kept for heading precision while the full signal range has to be measured for High "G" movements controlling ... and avoiding " non linear " ( ROFL ) - or unwanted - moves.

    Thermistor is just here for best temp compensation of Gyro and Accelmeter ...

    May be 8 Bits PICs, and generally Pīcs are not the best components for this kind of Games ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. 12f675 A/d Miseries
    By MARAD75 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 16th December 2008, 02:16
  2. 12F675 A/D and GPIO sleep interrupt
    By macinug in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th September 2008, 14:39
  3. Need advice on A/D
    By james in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th August 2007, 19:30
  4. A/D converter fails?
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th February 2006, 18:57
  5. 18F2525 A/D, Comparator and Vref modules
    By fbraun in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th May 2005, 23:17

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