diff --git a/electronics/wheatstone_bridge.py b/electronics/wheatstone_bridge.py index 3529a09339c4..edf0a34887c6 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: - - --------------- - |Rx=(R2/R1)*R3| - --------------- + Wheatstone Bridge is an electrical circuit used to accurately measure + an unknown resistance by balancing two legs of a bridge circuit. + + 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) @@ -31,8 +40,7 @@ def wheatstone_solver( if resistance_1 <= 0 or resistance_2 <= 0 or resistance_3 <= 0: raise ValueError("All resistance values must be positive") - else: - return float((resistance_2 / resistance_1) * resistance_3) + return float((resistance_2 / resistance_1) * resistance_3) if __name__ == "__main__":