Lesson 8 of 15
Wheatstone Bridge
The Wheatstone Bridge
A Wheatstone bridge is a classic circuit for measuring unknown resistances with high precision. It consists of four resistors arranged in a diamond:
+Vs
/ \
[R1] [R2]
| |
(A) (B) ← Vout = VA - VB
| |
[R3] [R4]
\ /
GND
The output voltage:
Vout = Vs · [R3/(R1+R3) − R4/(R2+R4)]
Balanced vs. Unbalanced
The bridge is balanced (Vout = 0) when:
R1/R3 = R2/R4 (or equivalently: R1·R4 = R2·R3)
In practice: fix R1, R2, R3 to known values, then adjust R4 until Vout = 0. At balance, R4 = R3·R2/R1.
Why It's Powerful
At balance, the measurement is independent of Vs — supply fluctuations don't affect the result. This makes it far more accurate than a simple voltage divider measurement.
Applications
- Strain gauges (measuring force/deformation)
- Precision thermometers (RTDs)
- Pressure sensors
- Any resistive sensor needing high precision
Examples
| Vs | R1 | R2 | R3 | R4 | Vout |
|---|---|---|---|---|---|
| 10V | 10Ω | 10Ω | 10Ω | 10Ω | 0V (balanced) |
| 12V | 2Ω | 6Ω | 6Ω | 2Ω | 6V |
| 12V | 3Ω | 3Ω | 3Ω | 6Ω | -2V |
Your Task
Implement double wheatstone_bridge(double vs, double r1, double r2, double r3, double r4) that returns Vout = VA − VB.
TCC compiler loading...
Loading...
Click "Run" to execute your code.