# How can I isolate voltage dividers so they aren't interfered with by other parts of the circuit?

I have a small and very basic circuit that PWMs an RGB LED. It has a potentiometer to allow me to set brightness level for night time and a LDR that allows me to detect night time.

I took some measurements of the LDR under various lighting conditions so that I could select a reasonable resistor to put in series with the LDR as a voltage divider.

In practice, however, the readings were not what I expected. If I measure the resistance of the LDR with my multimeter, it's about 1/5th what I had measured when it was not in the circuit.

I selected a 51K Ohm resistor for the LDR divider circuit. My multimeter is also measuring that as 10K Ohm. The potentiometer I'm using for setting the brightness is 10K Ohm, but in circuit it measures as about 3K Ohm.

I'm assuming that these resistances are reduced because they're in parallel with each other, but I can't figure out how to isolate them so that I can get reliable readings for the micro-controller.

I'll do my best to mock up the circuit . . .

simulate this circuit – Schematic created using CircuitLab

Based on some of the comments, I decided I should isolate parts of the circuit to see if I could reproduce the measurements in the full circuit. I built this circuit in a breadboard and the measurements are the same as I mentioned above. That is to say, my expected resistances are reduced by about 66%.

simulate this circuit

• That's an effect of measuring the diodes internal to the µC which are protecting the input pins from over/undervoltage. Remove the µC and measure again. (It does not matter, though.) Commented Nov 12, 2018 at 0:58
• In general, you should not expect to be able to measure the resistance of an individual component with a multimeter when it is connected in-circuit. Commented Nov 12, 2018 at 1:00
• @Janka most resistance meters don't output a voltage high enough to switch on diodes, so I don't think this is the issue. Even if this was the case though, I would think the resistance he'd measure would be much lower than what he's seeing Commented Nov 12, 2018 at 1:00
• Just curious, but have you considered the idea of doing the analog stuff externally, including the hysteresis, and simply having a digital I/O signal for light/dark? See my answer for Choosing Voltage Divider Resistor For LDR.
– jonk
Commented Nov 12, 2018 at 1:46
• Are you trying to measure resistances with power applied to the circuit? If so, any readings you get will have little or no relation to the "real" resistance. An ohmmeter applies a voltage between its probes, and measures the resulting current (or applies a current, and measures the resulting voltage). If something else is also causing currents or voltages in the circuit, the ohmmeter reading is meaningless. In any case, the meter measures the apparent resistance between its probes - which will include anything connected in parallel with the component you wish to measure. Commented Nov 12, 2018 at 2:19

This is a bit of an X-Y problem. You cannot accurately measure the resistances involved in the voltage dividers when the circuit is not powered, because the constituent resistors wind up in parallel. For instance, when you attempt to measure the resistance across the LDR, you wind up measuring the resistance of this circuit:

simulate this circuit – Schematic created using CircuitLab

Which, if you do the math gives you:

$$\R_{measured} = \frac{1}{ \frac{1}{R_{LDR}} +\frac{1}{ R_{1} + R_{2}} }\$$

$$\R_{measured} = \frac{1}{ \frac{1}{82k} +\frac{1}{ 51k + 10k} } = 34.97k\Omega\$$

That said, this does not mean that the two dividers will interfere with each other in circuit. In that case, as long as the power supply is stable and has low impedance, the voltage across the whole divider can be considered fixed. The typical way that surrounding circuitry interferes with the output of a voltage divider is when enough current is drawn out of the voltage divider to create a meaningful error in the divider.

simulate this circuit

Ideally, the load current on the output of the voltage divider would be zero, and if the voltage divider were connected to the input of an op amp, that would be close enough to true. If, however, we draw a substantial amount of current $$\I\$$ out of the divider, then we get an error:

If $$\I\$$ is zero: $$\V_{out} = \frac{V}{R_{1}+R_{2}}\times R_{2}\$$

If $$\I\$$ is non-zero: $$\V_{out} = (\frac{V}{R_{1}+R_{2}}-I)\times R_{2}\$$

(note that the sign of $$\I\$$ depends on the direction of current flow, so the error could increase or decrease our actual reading)

This shows that the amount of current that flows out of the voltage divider $$\(I)\$$ needs to be substantially smaller than the current that flows through the divider $$\ (\frac{V}{R_{1}+R_{2}})\$$ to minimize this error.

Now, you haven't mentioned whether your ADC readings are coming out as you expect, but let's discuss the main potential source of error there anyway. To start with, lets look at what a typical ADC channel looks like, electrically. In this case, it's going to have a sampling capacitor that is temporarily connected to the input for some period of time before the ADC performs the conversion. Something like this:

simulate this circuit

For this reason, the sampling time on MCU ADCs is typically configurable, as the required sampling time will depend on the nature of the circuitry you're attempting to measure. If you have some really high impedance circuitry, you would probably want to use an op-amp buffer as another answer suggests. However, in your case, this is entirely unnecessary as long as your sampling time is set correctly.

• This is a solid answer. Commented Nov 12, 2018 at 11:31

The easiest way to do this is using an op-amp buffer circuit:

V_in is connected to the output of your voltage divider, and V_out connects to the rest of the circuit.

No current flows into the inputs of an op-amp (practically speaking, anyway), so this will not affect the behavior of the voltage divider. The output voltage of the op-amp will follow the input voltage exactly, since it is a x 1 amplifier. This is usually the easiest way to isolate your voltage divider from the rest of the circuit so that additional impedance doesn't affect the voltage divider output.

EDIT: You may need to use one of these as the supply to the voltage dividers for your particular setup. In that case connect V_in to your Vcc, and V_out to the "top" of the resistor divider.

• An excellent question by the way. Commented Nov 12, 2018 at 0:59
• This is definitely information worth knowing, but is not clearly related to the OP's present problems, which relate to using a multimeter to measure in circuit, nor to the actual function of the OP's circut, where the impedances are low enough that this technique is not necessary.
– ajb
Commented Nov 12, 2018 at 2:44
• @ajb The title of the question itself asks how to isolate the dividers so that they aren't interfered with by other parts of the circuit, which is the question that I answered. But either way I would expect this solution to help, though as was already mentioned in comments, the best way would be to pull the parts out of the circuit. Commented Nov 12, 2018 at 2:58
• @DerStrom8 An opamp buffer will essentially add nothing over OP's current circuit. Some of the interference comes through R2 and the rails, some of it through the ESD protection devices, which an opamp is as likely to have as a microcontroller. The circuit is effectively identical to the current one, since you still have the same things connected effectively in parallel to the DUT. Commented Nov 12, 2018 at 6:21
• @nitro2k01 I don't think you understand my answer. First of all, I doubt ESD protection devices are interfering in this case because, as I already said before, most resistance meters don't apply a voltage high enough to cause silicon to switch on. Therefore it can be treated as an open circuit, or at the very least a very high impedance. As for the op-amp buffers, you can use them to isolate each divider/resistance from the rails, which is what the OP was asking for. Commented Nov 12, 2018 at 11:30