Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: More of an electronics question about voltage references

  1. #1
    Senior Member
    Join Date
    Sep 2014
    Posts
    112

    More of an electronics question about voltage references

    I'm trying to use multiple ADS1115 chips to read potentiometers at differential mode, to get the full 16-bit range. To achieve this I'm using the LM4040 voltage reference, passing a 4.096V to the pots (and ground to the other end), and 2.048V to the ADS1115 chips. I'm having a hard time calculating the resistors I need for the LM4040. I would like to have a variable number of pots with one LM4040, from 1 to 30 pots in total. I have already posted this question in Adafruit's forum, but it's now closed. The thread is here.
    From the information I was given in this thread, I concluded that for 10K pots with a 4.096V reference, and a 5V supply, I need 68 Ohm resistors. I think I got this right by applying the following calculations:
    Code:
    5V - 4.096V = 0.904V
    0.904V / 14mA (maximum current to flow through the LM4040) = 65 Ohm (choosing the next value from the E12 series, which is 68)
    0.904V / 68 Ohm = 13.3mA
    13.3mA - 1mA (so that the LM4040 always has at least 1mA flowing through it) = 12.3mA
    12.3mA / 409.6uA (if this is the correct value of current across a 10K pot with a 4.096V ref) = 30
    If this is right, then what I can't get right is the resistor used for the 2.048V reference wired to the ADS1115 chips. Following the thread of the link above, from what I understand that should be 220 Ohms, but that doesn't work. As I add more pots to the circuit, the maximum value these pots output gets lower.
    Here's the circuit I use for the two LM4040 references:
    Click image for larger version. 

Name:	lm4040_schematic.png 
Views:	11 
Size:	7.9 KB 
ID:	27312
    Can anyone help with the resistor values I have to use?

  2. #2
    Senior Member
    Join Date
    Jun 2017
    Posts
    249
    I'm not exactly sure what you are doing with the 2.048V source, but your calculations with respect to the 4.096V source look correct. I note that your choice of 68 ohms puts the current through the 4040 at at the very top end of the allowable 45uA to range, so you might consider increasing that value a bit, in case your '5V' supply produces more than 5V. It would only take 1.02V across a 68-ohm resistor to hit the 15mA limit, or (1.02 - 0.904 =0.116V). So if your 5V supply is in fact a 5.116V supply, you're right at the max.

    What is the 2.048V reference doing again? If you can provide a more complete schematic, that might help.

    Frank

  3. #3
    Senior Member
    Join Date
    Sep 2014
    Posts
    112
    Quote Originally Posted by paynterf View Post
    I'm not exactly sure what you are doing with the 2.048V source, but your calculations with respect to the 4.096V source look correct. I note that your choice of 68 ohms puts the current through the 4040 at at the very top end of the allowable 45uA to range, so you might consider increasing that value a bit, in case your '5V' supply produces more than 5V. It would only take 1.02V across a 68-ohm resistor to hit the 15mA limit, or (1.02 - 0.904 =0.116V). So if your 5V supply is in fact a 5.116V supply, you're right at the max.

    What is the 2.048V reference doing again? If you can provide a more complete schematic, that might help.

    Frank
    Sorry for not providing a fuller schematic. Here it is. The 2.048V ref is wired to the ADS1115 chips, so its differential mode is usable. The thing is I don't know how many ADS1115 chips I want to have. It should be between 1 and 15, for a total of 30 pots.
    Click image for larger version. 

Name:	lm4040_ads1115_schem.png 
Views:	26 
Size:	7.5 KB 
ID:	27319

  4. #4
    Senior Member
    Join Date
    Jun 2017
    Posts
    249
    OK, so the 4.096 side of the dual-reference module goes to the top side of all X pots, correct? And the 2.048V side of the dual-ref module goes to the 'low' side of each differential channel ADC inputs, with the 'high' side of the ADC channels going to the wipers of the two pots connected to that ADC, correct?

    So the 2.048V output from the voltage ref should not have any significant load, as it is only tied to ADC inputs, which presumably are very high impedance. Thus the 220-ohm calculation for that output should be fine, although a little on the low side (you could probably double or triple this value with no adverse effect).

    The 4.096 side will see the parallel combination of all X 10K pots. This load current must be supplied through the 68-ohm resistor tied to +5V, plus the operating current for the voltage reference. If X is 10, then the pot load is about 4 mA. If the voltage ref operating current is 1mA, then the max resistance of the series resistor (in K-ohms) is (5-4.096)/5 = 180 ohms, so your 68-ohm value should be OK even up to 30 pots.

    Your setup seems correct to me, so if you are getting reduced max values as you add pots, then something else is wrong, and I suspect that 'something else' is your 5V power supply. I recommend you add pots until you see a significant drop in the max output reported by the ADC, and then physically measure the voltage at the top end of the pots with a decent multimeter. If you don't have a multimeter, then this would be a great time to invest in one, as you really shouldn't be doing this kind of development without one.

    Hope this helps,

    Frank

  5. #5
    Junior Member
    Join Date
    May 2021
    Posts
    12
    Maybe I am missing a point here, but why do you use a voltage divider on the anode of the shunt reference?
    As far as I remember there should be resistor in series with the anode, where you also get the desired voltage.
    The resistor should be chosen to supply the required current to both the load (ADC in your case) and the shunt, and should be big enough to limit the current through the shunt.

  6. #6
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,748
    I'd favour using ratiometric ADC for reading pots, eliminating the need for any voltage precision, only short-term stability of the supply
    is needed for this (ie good decoupling). This method can also be supply-agnostic should your ADC happen to work with either 3.3V or 5.0V.

    Note that many ADC's require very low dynamic impedance on their reference inputs, to prevent it bouncing around during a conversion, so
    usually this pin needs substantial electrolytic and ceramic decoupling for top performance (the datasheet will probably have some guidance
    here).

    BTW I couldn't help noticing the unusual precision you are using. 16 bits is well beyond what is needed for any normal potentiometer.
    For single turn pots 10 bits is more than adequate, for 10-turn 14 bits gives a resolution of 1/5th of a degree - that seems beyond what is
    needed too, 12 bits may be perfectly adequate. Or is this some esoteric device rather than a control knob?

  7. #7
    Senior Member
    Join Date
    Sep 2014
    Posts
    112
    @Mav well, these 10K resistors to ground are copied from Adafruit's schematic from their LM4040 breakout. Maybe they're there because the breakout provides both 4.096 and 2.048 references, and it's not known in advance if both will be used? Kind of a pull-down resistor? No idea really. Anyway, I removed it.
    @paynterf thanks for all the tips. I actually measured the voltage coming out of the LM4040, and it's pretty far from what it should be. The 4.096 output gives around 4.3V, and the 2.048 output gives around 2.25. I guess these differences are causing a lot of trouble, right? Can it be that the chips I'm using are bad? I'm actually using Adafruit's breakout and I've broken the trace between each LM4040 and their resistors, so I can replace them with values other than 750 Ohm. I'm using this breakout because it was hard to find the LM4040 refs I need in the local electronics stores.
    @MarkT I agree that 16-bit is a bit of an overkill, but lets say that for the project I'm trying to develop, it's demanded. Also, I've no idea what a ratiometric ADC is...

  8. #8
    Senior Member
    Join Date
    Jun 2017
    Posts
    249

    Talking

    Quote Originally Posted by alexandros View Post
    @Mav well, these 10K resistors to ground are copied from Adafruit's schematic from their LM4040 breakout. Maybe they're there because the breakout provides both 4.096 and 2.048 references, and it's not known in advance if both will be used? Kind of a pull-down resistor? No idea really. Anyway, I removed it.
    @paynterf thanks for all the tips. I actually measured the voltage coming out of the LM4040, and it's pretty far from what it should be. The 4.096 output gives around 4.3V, and the 2.048 output gives around 2.25. I guess these differences are causing a lot of trouble, right? Can it be that the chips I'm using are bad? I'm actually using Adafruit's breakout and I've broken the trace between each LM4040 and their resistors, so I can replace them with values other than 750 Ohm. I'm using this breakout because it was hard to find the LM4040 refs I need in the local electronics stores.
    @MarkT I agree that 16-bit is a bit of an overkill, but lets say that for the project I'm trying to develop, it's demanded. Also, I've no idea what a ratiometric ADC is...
    OK, so you are making progress! Over my 50+ year electronics career, I have found that I generally have to make all possible mistakes before arriving at a good design, so you are making progress!

    My going in assumption when dealing with hybrid software/hardware systems is, "the hardware never fails - it's always the software". This isn't always the case, but I've made a lot of money betting on it

    Fix the voltage reference problem first, as it will corrupt anything you do downstream. You should consider the possibility that your multimeter is off by around 0.25V (if it were, then your voltages would actually be within 50mV of the correct value). If you have another LM4040 breakout, measure it without any modifications, and with a supply resistor that is guaranteed to placed the supply current in the proper range of ~1-15mA. I suspect you'll see the same offset, as the LM4040 breakout is, almost by definition, more accurate than most multimeters. To accurately measure the 4.0.48V output, you need a voltmeter with +/1 0.0005V accuracy, and even that is pushing it a bit.

    If you conclude that it is your meter at fault, and the offset is the same for both reference voltages, then simply take that into account with subsequent measurements. Since the precision reference is being used to measure the voltage at the 10K pot wiper, it won't be affected by multimeter inaccuracies, and the ADC output value will be correct, assuming you have done the software conversion properly (you did check this, right?). In this case "keep calm and party on" . If not, then fix the next problem in line.

    While I agree that trying to measure a 10K pot wiper voltage to 16 bits is probably WAY overkill, I also encourage you to keep going with your current setup, assuming your goal is more knowledge and ability rather than a specific project. I call this "Investing in yourself" and it is the very best investment anyone can make!

    Oh, and one last thing. As you might have discovered already, the 'real' inet (as opposed to all the social media crap) is a wonderful resource for those of us with inquiring minds. If you have a problem that you can't seem to handle, it is almost certain that X others have had the same problem and posted about it somewhere on the inet. Conversely (and this is important) if you can't find anything on the inet about your particular problem, then it is quite likely that the problem exists somewhere between your ears



    Hope this helps,

    Frank

  9. #9
    Quote Originally Posted by alexandros View Post
    Also, I've no idea what a ratiometric ADC is...
    If you use the same voltage source to provide the ADC reference and the supply to the sensor (whose output is proportional to that supply), the absolute value of that supply drops out. The ADC output then depends only on the sensor and not the supply voltage. Assuming a reasonably stable supply.

    Wait, broken the trace? Why not simply remove/replace the resistors?

  10. #10
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,748
    Quote Originally Posted by alexandros View Post
    Also, I've no idea what a ratiometric ADC is...
    Ratiometric w.r.t. the supply voltage is what I really meant - ie you use the supply as a reference and the returned
    ADC count represents the ratio between input pin voltage and supply voltage - for reading a resistive divider this is
    all that's needed, and shouldn't matter if the supply voltage varies (ie battery power). Some sensors that output
    an analog voltage are ratiometric output which relaxes any need for voltage references - the ACS711/712 current
    sensors are like this if I remember rightly, and Ive seen a few pressure sensors like this - the output varies from 10% to
    90% of supply, rather than being an absolute voltage.

Posting Permissions

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