From 5fccff81bfe3ffbf22ac6cfde006688b333ccf35 Mon Sep 17 00:00:00 2001 From: Kashvi Bhatia <992501030086@mail.jiit.ac.in> Date: Thu, 17 Sep 2026 02:20:30 +0530 Subject: [PATCH] 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 --- electronics/wheatstone_bridge.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/electronics/wheatstone_bridge.py b/electronics/wheatstone_bridge.py index 9c665ac7e..edf0a3488 100644 --- a/electronics/wheatstone_bridge.py +++ b/electronics/wheatstone_bridge.py @@ -6,13 +6,22 @@ def wheatstone_solver( resistance_1: float, resistance_2: float, resistance_3: float ) -> float: """ - This function can calculate the unknown resistance in an wheatstone network, - given that the three other resistances in the network are known. - The formula to calculate the same is: + Wheatstone Bridge is an electrical circuit used to accurately measure + an unknown resistance by balancing two legs of a bridge circuit. - --------------- - |Rx=(R2/R1)*R3| - --------------- + The bridge is said to be balanced when no current flows + through the galvanometer connected between the midpoints + of the two voltage dividers. + Balance condition: + R1 / R2 = R3 / R4 + + Applications: + - Measurement of unknown resistance + - Strain gauge circuits + - Sensor calibration + This function can calculate the unknown resistance in a Wheatstone + network, given that the three other resistances + in the network are known. Usage examples: >>> wheatstone_solver(resistance_1=2, resistance_2=4, resistance_3=5)