Say you have a resistive light sensor, whose resistance goes up as a function of light intensity. You want to calibrate it for indoor use so that it can tell when the lights are on or off.
You measure the light sensor’s resistance at 4 states:
This is resistance you measure at those four points:
light intensity to resistance |
You plan on using this sensor ($R_2$) in the following voltage divider:
Circuit Schematic |
But what value should you select for the biasing resistor, $R_1$? The issue of matching resistance is important, because if you select the wrong resistor, your signal output will be lower. What if you pick the halfway point, $36.5 \Omega$?
R1 vs DV |
So it seems like we can do better. What’s the correct value to select?
We can write the equation for $\Delta V$, which represents the difference in the circuit’s output between the dark state and the light state:
$$\Delta V=V_{light}-V_{dark}$$
where the current across the voltage divider depends on the resistance of sensor $R_2$ in its light and dark state:
$$i_{dark}=\frac{V_{dd}}{R_1+R_{2(dark)}}$$ $$i_{light}=\frac{V_{dd}}{R_1+R_{2(light)}}$$
The voltage out (across $R_1$) in the light and dark case can be written as:
$$V_{dark}=R_1 i_{dark}$$ $$V_{light}=R_1 i_{light}$$
or, when expanded,
$$V_{dark}=\frac{R_1 V_{dd}}{R_1+R_{2(dark)}}$$ $$V_{light}=\frac{R_1 V_{dd}}{R_1+R_{2(light)}}$$
$\Delta V$ can finally be expanded as:
$$\Delta V=\frac{R_1 V_{dd}}{R_1+R_{2(light)}}-\frac{R_1 V_{dd}}{R_1+R_{2(dark)}}$$
How do we maximize our signal, $\Delta V$? Take the derivative with respect to $R_1$.
$$\frac{\delta \Delta V}{\delta r_1} = \frac{R_{1} V_{dd}}{\left(R_{1} + R_{2(dark)}\right)^{2}} - \frac{R_{1} V_{dd}}{\left(R_{1} + R_{2(light)}\right)^{2}} - \frac{V_{dd}}{R_{1} + R_{2(dark)}} + \frac{V_{dd}}{R_{1} + R_{2(light)}}$$
Simplifying,
$$\frac{\delta \Delta V}{\delta r_1} = \frac{R_{2(light)} V_{dd}}{\left(R_{1} + R_{2(light)}\right)^{2}}- \frac{R_{2(dark)} V_{dd}}{\left(R_{1} + R_{2(dark)}\right)^{2}} $$
Setting this equation to zero allows us to find the maximum value for $R_1$
$$\frac{R_{2(light)} V_{dd}}{\left(R_{1} + R_{2(light)}\right)^{2}} = \frac{R_{2(dark)} V_{dd}}{\left(R_{1} + R_{2(dark)}\right)^{2}}$$
Solving for $R_1$, we get
$$R_1 = \sqrt{R_{2(dark)}R_{2(light)}}$$
Substituting in our example values above, we get
$$R_1=24k \Omega$$
Which matches the peak in our graph.
TL/DR: Use $R_1 = \sqrt{R_{2(dark)}R_{2(light)}}$ to size your biasing resistor in order to maximize your signal in a voltage divider