Skip to content

Commit 42a054f

Browse files
committed
docs: Add circuit diagram and improve Wheatstone bridge documentation
1 parent 678dedb commit 42a054f

1 file changed

Lines changed: 26 additions & 7 deletions

File tree

electronics/wheatstone_bridge.py

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,32 @@ def wheatstone_solver(
66
resistance_1: float, resistance_2: float, resistance_3: float
77
) -> float:
88
"""
9-
This function can calculate the unknown resistance in an wheatstone network,
10-
given that the three other resistances in the network are known.
11-
The formula to calculate the same is:
12-
13-
---------------
14-
|Rx=(R2/R1)*R3|
15-
---------------
9+
Calculate the unknown resistance (Rx) in a Wheatstone bridge circuit.
10+
11+
A Wheatstone bridge is an electrical circuit used to precisely measure
12+
an unknown resistance. This function calculates Rx when the three other
13+
resistances in the bridge are known.
14+
15+
Circuit Diagram:
16+
17+
R1 R2
18+
+--/\/\/--+--/\/\/--+
19+
| | |
20+
Vin Vg Vout
21+
| | |
22+
+--/\/\/--+--/\/\/--+
23+
R3 Rx
24+
25+
This solver uses the balanced bridge formula:
26+
Rx = (R2/R1) × R3
27+
28+
Args:
29+
resistance_1 (R1): First known resistance
30+
resistance_2 (R2): Second known resistance
31+
resistance_3 (R3): Third known resistance
32+
33+
Returns:
34+
float: The calculated unknown resistance (Rx)
1635
1736
Usage examples:
1837
>>> wheatstone_solver(resistance_1=2, resistance_2=4, resistance_3=5)

0 commit comments

Comments
 (0)