Shop OBEX P1 Docs P2 Docs Learn Events
Conditioning lines for ADC reference voltage? — Parallax Forums

Conditioning lines for ADC reference voltage?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2013-04-06 23:09 in General Discussion
Ok originally I had planned to set my vRef pins using a DAC and opamp buffer if needed, but I ran out of PCB space, so I decided to just use my 5v line for the vRef. I currently have an AVR with ADC, and an MCP3208 connected to a propeller. I have already wired everything up except the MCP3208's vRef Line. The AVR will be using it's AVCC line as the voltage reference.

Earlier I hooked a scope up to the AVRs Agrnd and AVCC pins, then set it at 100ms and 100mv AC to check out the ripple. As expected I get about 4.65mv of ripple voltage, which I am ok with. Here is how I have set it up, The 5v and G for analog are isolate throughout the whole circuit, they only meet with the digital lines at the board input. Next I have a 22uf tant, 10uf ceramic, 2.2uf aluminium, .1uf ceramic .22uf ceramic, and .01uf ceramic, as decoupling caps on the line (these gave me the best results on the scope). I also have a 10uh inductor and .1uf cap, filtering the AVRs AVCC/AREF line, as specified in the data sheet. The reason I started adding all these caps was I made the AVR flash an LED, and depending on how much current the LED drew every flash would cause my analog reference to swing from 4.6mv ripple up to a 15mv ripple. I have gotten that down to a max of about 7mv when the LED flashes. Next I need to run the 5v line down to the mcp3208's vRef pin, what I was wondering is if there is any need to add the .1uf cap and 10uh inductor on it's vRef line, to create the same filter, the data sheet says nothing about this but kind of assumes you are using a precision voltage reference and buffer?

Lastly, what's done is done is done, i'm not going to go ripping things up but I am wondering if there is a way to totally eliminate ripple of the reference lines, obviously supplying vRef with a precision reference, a dac, or just a separate analog voltage rail would do this, but i'm more wondering how one could share the standard VCC for the board with the analog references as I have and get better results.

Comments

  • kwinnkwinn Posts: 8,697
    edited 2013-04-05 20:52
    A resistor or inductor (inductor is better) between the +5V and the REF pin, and a 0.1uF capacitor between REF and ground should get rid of most of the ripple.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-04-05 20:58
    Also I am one of those people who builds the hardware first and then gets in to the code after it's done, I have done some simple ADC stuff before but Im not clear about a lot of things. A 12 bit accuracy at 5v is steps of 1.29mv iirc? This means when my reference slips 8mv my reading will be about 6 units off in either direction correct? But what does this mean as far as accuracy when converted to a floating point? At most I want to read out two decimal places, i.e 9.34v.... If im six units off does this mean that my reading could be 9.28v to 9.40? Also is each individual division of 1.29mv what is considered an LSB?
  • frank freedmanfrank freedman Posts: 1,983
    edited 2013-04-05 21:39
    @rw, expand your horizons. Author Bonnie Baker for lots of good articles analog conditioning and adc, subscribe to some of the free magazines like EDN and other pubs and product publications. Just saw last month an article detailing the hazards of hanging caps on the output of some reference devices.
  • kwinnkwinn Posts: 8,697
    edited 2013-04-06 22:28
    @rw, A 12 bit number has a range of 0 to 4095 or 4096 discrete steps. The voltage per bit for a 12 bit ADC would be Vref / 4096, which would be 5 / 4096 = 1.2207 mV per bit for a 5V Vref.

    I'm not sure what you mean by being 6 units off but if you used 5.0V as the Vref in your calculations and the actual Vref was 4.9V your calculated voltage would be high by about 2%. With a 4.9V Vref the voltage per bit would be 4.9 / 4096 = 1.196289 mV per bit.

    If your input voltage was 4.0V, the Vref was 4.9V and your calculations assumed a 5.0V Vref the adc output would be 4.0 / .001196289 = 3344. The calculated output voltage would be 3344 x .0012207 = 4.082 V
  • jmgjmg Posts: 15,173
    edited 2013-04-06 23:09
    ... A 12 bit accuracy at 5v is steps of 1.29mv iirc? This means when my reference slips 8mv my reading will be about 6 units off in either direction correct? But what does this mean as far as accuracy when converted to a floating point? At most I want to read out two decimal places, i.e 9.34v.... If im six units off does this mean that my reading could be 9.28v to 9.40?

    No, those 6 LSB units belong to the original 12bit number, not your BCD readout.
    You first need to scale your 12b to that BCD space

    eg - you might have 15V Full scale for, a meter of 9.340v, 15V is 15/2^12 => 3.66 mV per LSB
    If you get 6 LSB variance in your ref, you have 22mV change in your 9.34V


    Only if your 9.34V meter has a full scale of 40.96V, will the Binary LSB variance map 1:1 to a BCD meter 10mV digit variance.
Sign In or Register to comment.