Limiting value of resistors in DC circuit - Page 1
Forum section: electronics / projects

author: Connoiseur
author_rank: Regular Contributor
timestamp: March 01, 2016, 06:23:20 am
content: Hello all!I had been recently working on a few projects that use voltage dividers in dc circuit. While it is very easy to define the least resistance that one can use (limited by load on a device or by the power rating of the resistor itself). However I'm utterly confused by the upper limit that can be chosen. I understand that a very high resistance will have stability issues due to noise or capacitance in the succeeding devices or PCB.Is there any rule/guideline for limiting value NOT directly based on the circuit parameters but external to the circuit.I may be wrong, but one such problem that I'm facing right now is choosing the value of R4,R5 in the circuit. I've designed it to monitor the voltage of a 12V battery using MCU, so it translates 10.5V-14.4V to 0V-5V (yeah not exactly 0 but close; since not rail to rail).The instrumentation amplifier has a gain of ~2.87 and powered by the same battery. I can use R4=1k, R5=810 or any multiple thereof and still get the same result. The high input impedance of the instrumentation amplifier is hardly any load.The value of this divider should not depend on the gain or exact value of resistors used in the amplifier, right?Am I missing something here?Any help is highly appreciated.

author: Rerouter
author_rank: Super Contributor
timestamp: March 01, 2016, 06:51:51 am
content: In this case, it comes down to your zeners leakage, to define what resistors you use, for your upper limit on the resistor only divider, it would be the bias current on the op amp inputs, as that will alter the voltage, equally if its say to be mounted in an engine bay, you would want lower values to swamp out the injected noise,

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 01, 2016, 07:18:41 am
content: External limitations: undefined! The divider could be fully shielded, so that no external signals are allowed to influence it.If it's on a PCB (no ground plane) where fingers and wires could come near (but not touching), I probably wouldn't want to go much above 10k or 100k. Not that it matters much at this bandwidth (I presume you'll only be needing to sample this at like, ~Hz). The coupling mechanism is capacitive, so the bandwidth is critical to this figure!Internal limitations: many!First of all, bandwidth. I've said it before and I'll say it again: never use more bandwidth than you have to! At both analog and digital stages. If you'll be checking battery voltage once every second, for example, then a sample rate of 3-10 times that (digitally filtered down to a cutoff frequency of 1-3x the check rate), and analog bandwidth of 1-5 times, will be desirable. This keeps noise, aliasing, errors and all that stuff down.If you have a poorer analog filter, you can sample and digitally filter more aggressively (say analog bandwidth is 10x, sample rate 64x and filter to 1/64th the sample rate). The downside is more processing, and supply current (undesirable for low power stuff?), but this does save a few cents on analog filtering (merely a simple RC will suffice, no need for active op-amp filters). Or vice versa: if you have a very nice, say, 7th order LC filter, you might only use a simple 1-2-1 digital filter, or a small sliding average, or even nothing at all. (Which isn't too uncommon for radio circuits, as RF inductors and capacitors aren't expensive.)As for noise and error within your circuit, the biggest culprits will be:- Noise on the supply itself. The 12V battery might be very quiet (batteries are actually quite low noise sources, on their own), but if you have switched loads, SMPS, charger, digital logic, etc., those will all return noise to the supply.- Noise from the reference. In this case, including the sloppiness of the reference itself: a 4.7V zener isn't a good reference -- check out the V(I) curve. It will vary as supply varies, thus introducing a systematic error you probably weren't expecting.You should have an accurate bandgap voltage reference in your circuit, both for supplying any offsets your input conditioning might need (like the 4.7V reference in this circuit), and for supplying the ADC's VREF pin (which is the scale along which all voltages are measured -- needless to say, if you have all the circuit offsets proportional to VREF, you don't have to worry about calibrating them independently, a boon to accuracy!).For general purposes, a TL431 and LM324s are fine. For precision battery monitoring, you might want an LM4041 or something like that instead. Better than 0.2% accuracy probably isn't a big deal (that's good enough for most 10 bit ADCs, and still good enough for 12 bit ADCs, with a calibration step). Of course, to get this accuracy, you'll need a precision amp, like an AD8675 let's say; LM324 definitely won't work, even with calibration.- Noise from the resistors. Usually a small priority, but resistors of very large value exhibit uV+ of noise. Combined with your op-amp's input bias current (~nA), which itself is noisy, you can get perhaps single mV of noise/drift/error.- Needless to say, LM324 is a pretty crappy amp, with a guaranteed few-mV input offset (you have three in the circuit, and each error stacks!), but also some other traps. Its noise is still pretty high anyway (~40nV/rtHz), and it's sensitive to RF -- high frequencies get rectified by the internal B-E diode junctions, turning them into offset voltages. If you have switching noise in the circuit, and it's not filtered before the LM324 (at the input or power pins!), then it may wind up as DC offset that varies with load and stuff, an offset which can't be filtered afterwards. (A 1MHz lowpass filter, in front of the circuit, is much better than one after!)- The double-awfulness is that, input bias current causes a voltage error on your circuit's resistances; you can match the resistances, but the currents won't quite match, introducing an error. The LM324 actually has a reasonable noise figure for fairly high source resistances (~500kohms), but such values are impractically high for dealing with the input bias. So you want to use smaller values (<= 100k?), but now the amp's voltage noise is dominant. So it's not very nice to use an amp like this.Still, all of the concerns with noise are practically eliminated if filtering is used -- noise is a density function, so if you're running wide-open at whatever the op-amp bandwidth provides (~100kHz, maybe?), expect fractional mV of noise. Filter that down to, say, 1Hz, and you've got, well, "nV/1Hz" worth of noise, period!And like I said, bandwidth matters, every step of the way. The input might be filtered down to ~MHz or ~kHz, to keep it clean for the op-amp. The output might be filtered to ~Hz, for noise and stability. Then the digital samples might be filtered the same again, to redouble the analog filter's purpose, and account for ADC noise.And, of course, you can always go further, like: try to avoid using type 2 ceramic capacitors (X5R, Y5P, Z5U..) in the filtering parts, because they are microphonic and pick up ~mV worth of voltage noise from mech/acoustic vibration. Type 1 (C0G, SL..) and film types are fine. (This would be a good example of a noise source that's best filtered digitally -- the analog filter will work just fine, for what it is, but it'll pick up a little noise of a modest range: only the muffled thumping that the PCB picks up as, well, like a microphone. It's well within the capability of an ADC to sample and filter that down.)Tim

author: Connoiseur
author_rank: Regular Contributor
timestamp: March 01, 2016, 08:54:23 am
content: Thank you very much guys.Thanks T3sl4co1l for pointing out the issues. I'm just a freshman so I'm not very well versed with the real world challenges.I'm not building a precision battery monitor, I just wanted to build a state of charge indicator (~5% accuracy on state of charge is OK for me) based on battery voltage (under load, of course).So, can I use the internal 2.56V voltage reference of my microcontroller (Atmega8) from AREF pin (by setting REFS1 and REFS0) instead of the zener? I presume I don't need a buffer, but even if I need I've one opamp left in the LM324 for this purpose. I think this should give me better results than the circuit I proposed earlier.

author: Zero999
author_rank: Super Contributor
timestamp: March 01, 2016, 09:38:16 am
content: A battery has a very low impedance so an instrumentation amplifier is probably not needed.It can be done using a much simpler circuit, see link below for a guide on how to design it:http://www.ti.com/lit/an/sloa097/sloa097.pdf

author: Fungus
author_rank: Super Contributor
timestamp: March 01, 2016, 09:56:49 am
content: To avoid noise you should connect a small ceramic capacitor* from the center of your voltage divider to ground. Make the piece of wire between the capacitor and the voltage divider as short as possible.(*ceramic = low leakage, low ESR)The question then becomes, "how fast does my signal change"?This is a lot easier to quantify:If it's very slow then you can use larger value resistors to save power (50k-100k).If it's a faster-changing signal then you need lower value resistors (and maybe a smaller value capacitor).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 01, 2016, 11:32:09 am
content: Yes, using AREF is good.As I recall, the AREF is still pretty horrible, like 10% horrible, not even the mere 5% you want. If I'm recognizing the MCU datasheet I think I'm seeing. But check the datasheet on that in any case. Remember, if there aren't any min/max parameters in a table somewhere, it's nothing you can count on. Internal analog bits range from dubious to downright malfunctional (so it should be unsurprising why external ADCs and DACs and such remain very popular).And as mentioned, don't need the instrumentation amp -- you can hack off the entire left side of the amp, and tweak all the remaining resistor values to get the correct gain and offset. No need for geometric balance in the resistors, your voltage gain and range aren't geometrically defined anyway.Tim

author: Connoiseur
author_rank: Regular Contributor
timestamp: March 01, 2016, 12:34:11 pm
content: Quote from: Hero999 on March 01, 2016, 09:38:16 amThat's a very elegant solution. Thanks for sharing the link. I'll use it.As Tim said, the internal voltage reference is kinda horrible, I'll use a proper voltage reference both for the "slope mapping" circuit and the ADC. I guess Texas instruments TL431 should do (I have a couple of it lying around).Thanks everyone for helping me out.