Skip to content

Commit 5fccff8

Browse files
bhatiakashvi16pre-commit-ci[bot]cclauss
authored
Refine Wheatstone Bridge explanation (#14031)
* Refine Wheatstone Bridge explanation Updated docstring to provide a clearer explanation of the Wheatstone Bridge, its balance condition, and applications. * Update wheatstone_bridge.py * Correct docstring formatting in wheatstone_bridge.py Fix formatting in docstring for clarity. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix docstring capitalization and simplify return statement Corrected capitalization of 'Wheatstone' in the docstring and improved code structure by removing unnecessary else statement. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent 681929d commit 5fccff8

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

‎electronics/wheatstone_bridge.py‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@ 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+
Wheatstone Bridge is an electrical circuit used to accurately measure
10+
an unknown resistance by balancing two legs of a bridge circuit.
11+
12+
The bridge is said to be balanced when no current flows
13+
through the galvanometer connected between the midpoints
14+
of the two voltage dividers.
15+
Balance condition:
16+
R1 / R2 = R3 / R4
17+
18+
Applications:
19+
- Measurement of unknown resistance
20+
- Strain gauge circuits
21+
- Sensor calibration
22+
This function can calculate the unknown resistance in a Wheatstone
23+
network, given that the three other resistances
24+
in the network are known.
1625
1726
Usage examples:
1827
>>> wheatstone_solver(resistance_1=2, resistance_2=4, resistance_3=5)

0 commit comments

Comments
 (0)