Ohm's Law is a fundamental principle in electrical engineering that describes the relationship between voltage, current, and resistance in an electrical circuit. It was formulated by Georg Simon Ohm.
The Formula
The core formula for Ohm's Law is:
V = I * R
Where:
V represents Voltage, measured in Volts (V). Voltage is the electrical potential difference that drives current through a circuit.
I represents Current, measured in Amperes (A). Current is the flow of electric charge.
R represents Resistance, measured in Ohms (Ω). Resistance is the opposition to the flow of current.
Calculating Different Values
Using the basic formula, we can rearrange it to solve for any of the three variables if the other two are known:
To find Resistance (R): R = V / I
To find Current (I): I = V / R
To find Voltage (V): V = I * R
Use Cases
Ohm's Law is essential for:
Designing and troubleshooting electrical and electronic circuits.
Calculating power dissipation in components.
Determining the correct resistor values for specific applications, such as limiting current to LEDs.
Ensuring safety by understanding current flow.
Example Calculation
Suppose you have a circuit with a voltage of 12 Volts and a resistance of 4 Ohms.
Using Ohm's Law to find the current:
I = V / R
I = 12 V / 4 Ω
I = 3 Amperes (A)
If you knew the voltage (12V) and current (3A), you could calculate the resistance:
R = V / I
R = 12 V / 3 A
R = 4 Ohms (Ω)
function calculateOhm() {
var voltageInput = document.getElementById("voltage");
var currentInput = document.getElementById("current");
var resistanceInput = document.getElementById("resistance");
var resultDiv = document.getElementById("result");
var voltage = parseFloat(voltageInput.value);
var current = parseFloat(currentInput.value);
var resistance = parseFloat(resistanceInput.value);
var calculatedValue = null;
var unit = "";
var calculationDescription = "";
if (!isNaN(voltage) && !isNaN(current)) {
// Calculate Resistance
if (current === 0) {
resultDiv.innerHTML = "Error: Division by zero (current cannot be 0 for resistance calculation).";
return;
}
calculatedValue = voltage / current;
unit = "Ohms (Ω)";
calculationDescription = "Resistance = Voltage / Current";
resistanceInput.value = calculatedValue.toFixed(2);
currentInput.value = ""; // Clear other fields to indicate calculation direction
voltageInput.value = "";
} else if (!isNaN(voltage) && !isNaN(resistance)) {
// Calculate Current
if (resistance === 0) {
resultDiv.innerHTML = "Error: Division by zero (resistance cannot be 0 for current calculation).";
return;
}
calculatedValue = voltage / resistance;
unit = "Amperes (A)";
calculationDescription = "Current = Voltage / Resistance";
currentInput.value = calculatedValue.toFixed(2);
resistanceInput.value = "";
voltageInput.value = "";
} else if (!isNaN(current) && !isNaN(resistance)) {
// Calculate Voltage
calculatedValue = current * resistance;
unit = "Volts (V)";
calculationDescription = "Voltage = Current * Resistance";
voltageInput.value = calculatedValue.toFixed(2);
currentInput.value = "";
resistanceInput.value = "";
} else {
resultDiv.innerHTML = "Please enter exactly two values to calculate the third.";
return;
}
if (calculatedValue !== null) {
resultDiv.innerHTML = calculatedValue.toFixed(2) + " " + unit + "(" + calculationDescription + ")";
}
}