R3 / R4 do what?

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
CodingBadly
 
Posts: 4
Joined: Fri Jun 15, 2012 4:38 am

R3 / R4 do what?

Post by CodingBadly »

In these circuits...

http://www.adafruit.com/products/2200#technical-details-anchor

...what is the purpose of R3 / R4.


All the LM4040 reference circuits I can find are sans the second resistor. For example...
http://www.ti.com/general/docs/datasheetdiagram.tsp?genericPartNumber=LM4040-N&diagramId=25110

I found one other circuit with the second resistor but have not found any explanation for it.

User avatar
Franklin97355
 
Posts: 23940
Joined: Mon Apr 21, 2008 2:33 pm

Re: R3 / R4 do what?

Post by Franklin97355 »

They create a voltage divider so the diode does not have to do all the work. I'm not an engineer so this is just an opinion.

User avatar
CodingBadly
 
Posts: 4
Joined: Fri Jun 15, 2012 4:38 am

Re: R3 / R4 do what?

Post by CodingBadly »

Thank you for the reply.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: R3 / R4 do what?

Post by adafruit_support_mike »

The 10k resistor give the LM4040 voltage regulator a consistent load.

The LM4040 belongs to the category of shunt regulators. An ideal shunt regulator looks like a current source with zero impedance at the specified voltage, sitting in parallel with the load.

Thing is, there's no such thing as a perfect shunt. Any real device has a certain amount of resistance, and the LM4040's datasheet lists a "dynamic reverse impedance" of 0.8 to 1.1 ohms. That resistance sits in parallel with whatever load you connect to the LM4040's output, so the resistance of the load has some effect on the regulated voltage.

The effect is small, but it does exist, and even small effects matter when you're talking about a precision voltage reference.

You generally use a precision voltage reference with an ADC, an op-amp buffer, or something else that has an input impedance of several megohms. The 10k load built onto the breakout is so much lower that it dominates any pulling effect the load has on the regulator.

User avatar
CodingBadly
 
Posts: 4
Joined: Fri Jun 15, 2012 4:38 am

Re: R3 / R4 do what?

Post by CodingBadly »

Thank you for the reply.

I'm going to echo what you wrote. If I make a mistake, please correct me: The 10k resistor provides a small current flow from the regulator, as opposed to the nearly zero current flow if it was connected to a high impedance load, which makes the regulator perform better.

If the regulator is used as the reference for an AVR ADC, which uses about 120uA from the regulator, is the 10k necessary / important?

In any case, now that I have one I can honestly say that it was very easy to get it working and it is working phenomenally well. Thank you for another fine product!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: R3 / R4 do what?

Post by adafruit_support_mike »

You're close, but it's more a question of how much the current changes than a specific amount of current.

If you know you'll have the ADC reference's 32k input resistance as your load, and that load will never change, you can design for it. We couldn't make that assumption when designing the breakout though.

For the breakout, we designed it around a load whose current is relatively large compared to the loads you'll connect to it. By itself, the 4.096v reference's 10k resistor draws 409.6uA. If you connect an Arduino ADC's reference voltage pin to the regulator, it will draw another 128uA, for a total change of about 25%. The proportional change is small enough that it won't have much effect on the regulator's output.

User avatar
digitalone
 
Posts: 14
Joined: Sun Jan 04, 2015 2:02 pm

Re: R3 / R4 do what?

Post by digitalone »

I want to use the ATmega ADC to measure a TMP36. For that I want to use the 2.048V on AREF.

My circuit is connected to the 5V output of a step-up/step-down regulator which is powered upstream by 4 AA batteries.

To increase battery life it seems like I would want to limit the load related to the LM4040 to just the 32K ohm AREF resistance + the minimum current required to make the LM4040 operate which you have listed at about 60uA.

To do that, it seems like I should totally remove the R3 (10K ohm) and replace the R1 (750 ohm) with an approx. 23.8K ohm resistor.

Do I have this correct, or is there something I am missing here?

Thanks.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: R3 / R4 do what?

Post by adafruit_support_mike »

The minimum operating current for the LM4040 is 60-65uA, but working at that level puts it on the edge of instability. That defeats the purpose of using a precision reference, so 100-120uA would be a more practical minimum.

Setting the current at 128uA gives the LM4040 an equivalent resistance of 16k, which is a convenient number for calculation. Putting that in parallel with a 10k load resistor and a 32k load from the ADC produces a parallel resistance of about 5.16k, for a total of about 400uA at 2.048v.

The resistance that would produce (5v-2.048v) at 400uA would be around 7.4k. Dropping to 6.8k would take the current up to about 434uA, so a 6.8k resistor on the high side would be acceptable.

If you remove the 10k resistor it will save you about 200uA, and would allow you to replace the 750 ohm resistor with a 12k for a total draw of about 250uA.

Dropping a 3mA load to ~450uA might be worth doing. Dropping another 200uA is debatable.

Generally speaking, a change that saves 10% of your total load is worth doing, and one that saves 1% is an optimization you can pull if you really need it. Below 1%, you're either doing precision work or putting spoilers on a bulldozer to reduce the aerodynamic drag.

By that measure, saving 2.5mA is worthwhile for a system whose total load is 25mA, and worth considering for a 250mA system. Saving 200uA is worthwhile for a system whose total load is 2mA, and worth considering for a 20mA system.

User avatar
gadams999
 
Posts: 4
Joined: Sat Mar 09, 2013 9:21 am

Re: R3 / R4 do what?

Post by gadams999 »

Mike,

Thanks for the discussion. I'm still trying to get my head around how to calculate the LM4040 as an Arduino reference source, so this conversation has been helpful.

When you say:
Setting the current at 128uA gives the LM4040 an equivalent resistance of 16k, which is a convenient number for calculation. Putting that in parallel with a 10k load resistor and a 32k load from the ADC produces a parallel resistance of about 5.16k, for a total of about 400uA at 2.048v.
How are you calculating the equivalent resistance of the LM4040? I understand how to determine Rs based on the Arduino load of 128uA and a load for the LM4040 (say > 120uA and < 1mA), but I want to ensure I account for the 32K on the AREF pin in any total current calcs.

Also, semi-off topic, but would the LM4040 (4.096 Vr) be able to accommodate the short circuit of the AVCC voltage coming back when switching from EXTERNAL to INTERNAL? My thought is if I put a suitable resistor, say 1K low tolerance, between the Vr wire and the AREF pin that would provide enough to reduce the total current from both the external voltage source + AVCC?

Full disclosure: I don't have this particular Adafruit module but continue to order through the site and hopefully increasing my knowledge!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: R3 / R4 do what?

Post by adafruit_support_mike »

gadams999 wrote:How are you calculating the equivalent resistance of the LM4040?
Basic Ohm's Law.. 2.048v / 128uA = 16kohm.

The rules for describing circuits are arranged so that kind of approxomation is legit. As long as you hold the voltage at 2.048v and the current at 128uA, the equations don't care whether you have a complicated circuit like the LM4040 or a 16k resistor. Lumping it all up as 'equivalent resistance' makes it easier to predict what will happen if you put some other circuit's equivalent resistance in parallel with the LM4040 and its 10k dummy load.
gadams999 wrote:Also, semi-off topic, but would the LM4040 (4.096 Vr) be able to accommodate the short circuit of the AVCC voltage coming back when switching from EXTERNAL to INTERNAL?
That would be trouble.. the AREF pin is connected directly to the ADC inside the microcontroller, so if you switch to INTERNAL you'll put the LM4040 in parallel with the 1.1v internal bandgap reference.

You definitely don't want to connect the LM4040 straight to the AREF pin, and putting a resistor between the two is a tradeoff between two undesirable options:

- The lower the resistance is, the more current will flow from the 4.096v or 2.048v node to the trying-to-be-1.1v node inside the bandgap reference. The bandgap reference isn't designed to absorb that kind of current, so it will probably throw the internal reference way off.

- The higher the resistance is, the less you have to worry about excess current swamping the bandgap reference, but the more you have to worry about creating a voltage divider between the isolation resistor and the chip's 32k equivalent resistance when you want to use the external reference.

To put numbers on that unhappy situation, a 1k resistor would dump about 3mA into the bandgap when you want to use the internal reference, and you'd get a voltage drop of 62mV when trying to use the external reference. Add the +/-5% tolerance for a low-cost resistor and the value at AREF would be somewhere between 3.978v and 3.966v.. assuming exactly 32k of equivalent resistance from the ADC.

You'd be better off putting a P-mosfet between the LM4040 and the AREF pin and controlling its gate with another Arduino pin.

When you want to use the internal bandgap reference, send the mosfet's gate voltage to 5v. The mosfet's channel resistance will be around 10M, so the internal bandgap will only have to absorb a few hundred nanoamps from the LM4040, and that's within its abilities.

When you want to use the external reference, pull the mosfet's gate voltage to 0v. If you use a small power mosfet like the NTR4171P, its channel resistance will drop to about 90mohm, and you'll only lose about 12uV across it.

A better choice would be to say, "I have a precision external reference.. why do I need the internal bandgap anyway?"

User avatar
gadams999
 
Posts: 4
Joined: Sat Mar 09, 2013 9:21 am

Re: R3 / R4 do what?

Post by gadams999 »

adafruit_support_mike wrote:
Basic Ohm's Law.. 2.048v / 128uA = 16kohm.
Ugh. I was trying to figure the resistance based on the LM4040's draw plus the AREF pin. I'll get this EE stuff sooner or later.

Appreciate the information on the rest of the response. I was only thinking about if the Arduino was in DEFAULT mode (5V) feeding back to the LM4040 but didn't consider the other possible settings. For some reason I though that when AREF was switched from EXTERNAL to one of the other modes the AREF pin was decoupled. I'll have to learn to read the microcontroller schematics better.

Although I've been involved with computers my entire life, I haven't built the knowledge on what's considered "best practices" for protection like I would in the software development world.

My objective was to put in a circuit that would protect from accidentally loading the wrong code that used INTERNAL or DEFAULT while having a reference voltage attached to the AREF pin. That path did provide me with some more fundamentals, but I guess that at some point I should just put in controls at some other point in the design and development process to account for how my circuits are built vs. what sketch to load or run. I can do that with grouping sketches or adding comments to the top of the code calling out any "gotcha's" with pin configs.

Since this will be a very simple battery discharger project, I'll make sure I call analogRefernece(EXTERNAL) in setup() before making and analogRead()'s from the pins I'm reading from.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: R3 / R4 do what?

Post by adafruit_support_mike »

gadams999 wrote:Ugh. I was trying to figure the resistance based on the LM4040's draw plus the AREF pin. I'll get this EE stuff sooner or later.
The math circuit designers use everyday takes some getting used to.

It isn't the infinite-precision stuff you spent 12-16 years learning in school. Most of it is order-of-magnitude calculations where anything below 1% rounds down to "I don't care", and can generally be done in your head while riding a skateboard. Massive simplification and approximation are the rules of the game.

It takes some experience to learn where you can get away with hand-waving the calculations, but for 99% of circuit analysis any circuit can be reduced to a resistor (and maybe a capacitor) over a narrow range of currents and voltages.

We can get away with that because the numbers in electronics span an incredible range.. the resistor values in common use range from ohms to megohms (six orders of magnitude) and capacitors range from picofarads to millifarads (nine orders of magnitude). Any signal we don't like can generally be swamped out by another that's a hundred times stronger.

The hard math comes out when you run into a case where you can't ignore the noise without losing most of the signal too.
gadams999 wrote:For some reason I though that when AREF was switched from EXTERNAL to one of the other modes the AREF pin was decoupled. I'll have to learn to read the microcontroller schematics better.
Don't beat yourself up over it.. that detail is on page 256 of a 448-page document.

I was able to find it because I've been skimming parts of that datasheet every other day for the past couple of years. Sooner or later things start to look familiar.
gadams999 wrote:Although I've been involved with computers my entire life, I haven't built the knowledge on what's considered "best practices" for protection like I would in the software development world.
The basic principles are the same.. build the part that works if everything goes as expected, then build five times as much to deal with the times when things don't go as expected. ;-)

User avatar
Koepel
 
Posts: 1
Joined: Sat May 09, 2015 9:11 pm

Re: R3 / R4 do what?

Post by Koepel »

The resistors R3 and R4 are not a load for the LM4040. They create a voltage divider with R1 and R2.
The voltage divider lowers the voltage for the LM4040, which increases the inaccuracy due to voltage changes of Vin (5V).

Only R1 and R2 are needed, with perhaps small capacitors to GND to lower the noise.
When the current of the LM4040 is calculated, the 32k internal resistor of AREF should taken into account. The internal 32k is not just the input impedance, but the AREF input acts like a resistor of 32k from AREF to GND (for an ATmega328P).

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”