Ohm’s law is a mainstay in calculations related to circuits. It doesn’t matter whether the circuit is simple or complex, nor does it matter whether the device is small and battery powered, or large and part of the national power grid. Engineers and technicians often end up using Ohm’s law equations to understand what is happening—or what is supposed to happen—in the circuit.
The Ohm’s law equations relate voltage, current and resistance. It’s really just a single equation that can be rearranged one of three ways depending on what unknown you need to solve for:
In this activity, you will:
In this activity, you won't:
One application of Ohm’s law is calculating current through a resistor from measured voltage. That way, you won’t have to worry about changing the circuit to measure current. Just probe a resistor's leads for the voltage across it, and then use I = V / R to calculate the current through it.
Take a look at the resistor probed in the circuit below. From previous activities, you know the resistance is 220 Ω and the voltage is 1.20 V.
Instead of connecting the circuit to an ammeter, you can just use I = V / R to calculate the current through the circuit since you know that the resistance is 220 Ω and the voltage is 1.20 V. Here’s the calculation:
I = V / R
= 1.20 V / 220 Ω
= 0.0054545... A
≈ 5.46 mA
You can also use Ohm’s law to calculate the smallest resistor to safely use with an LED circuit. Why do that? To get maximum brightness! The LEDs in your kit are rated for up to 20 mA.
Here is a micro:bit current calculator that you can run to check the current a resistor conducts based on its resistance value and the voltage measured at its leads.
# calculate_i_from_v_and_r from microbit import * while True: text = input("Enter volts: ") V = float(text) text = input("Enter ohms: ") R = float(text) I = V / R print("I = ", I, "A") print()
The script starts inside the while True loop, prompting you with "Enter volts: ". The characters you type are stored in the text variable. Then V = float(text) converts the characters you have typed from text into a floating point value and stores the result in a variable named V. It repeats those steps for loading the ohms value you enter into the variable R.
while True: text = input("Enter volts: ") V = float(text) text = input("Enter ohms: ") R = float(text)
Since V and R are known, the I = V / R form of the Ohm’s Law equation calculates the current value I.
I = V / R
After printing "I = ", the value of I, and the “A” unit, the script prints an empty line. After that, the while True loop repeats so that you can calculate another current value.
print("I = ", I, "A") print()
Try modifying your script to calculate volts from amps and ohms.
The various forms of the Ohm’s Law equations are used in many ways. In this section, you will see:
Although there are numerous memory tricks for remembering the versions that solve for I and R, you can also just remember V = I x R and then divide by both sides to isolate either I or R. In other words, if you’re solving for I, divide R into both sides of V = I x R, and the result is I = V / R. Or, if you’re solving for R, divide both sides by I for R = V / I.
(View full size: ol-solve-for-i-or-r.mp4 [2])
Ohm’s Law: “The current through a conductor between two points is directly proportional to the voltage across the two points.”
That translates directly to I = V / R, where (1 / R) is the “directly proportional” constant you can multiply by the voltage to calculate current. Ohm’s law uses the term “two points” to make it more general. Sure, a point at each lead of a resistor is two points, but it can also apply to points on long wires. A long wire, like a power line, has a very small resistance per length. The longer the wire, the greater the resistance.
Earlier, you experimented with changing resistors to make the light dimmer or brighter. The smaller resistors allow more current to flow through the circuit, making the light brighter. One of the goals in a prototype or project, might be to make the light as bright as it can be. This can be done checking the current limitations, then selecting a resistor that will make the circuit conduct the most current within those limitations.
According to the Edge Connector & micro:bit pinout, the V2 module’s 3.3 V supply can source up to 270 mA of current. But, the LED’s maximum current is 20 mA, so that is the limiting factor. So, if you were designing a device and needed the brightest light possible, here is how you would use Ohm’s law to calculate the smallest resistor you can safely use (without damaging the LED by exceeding its current specification).
LEDs have a property called forward voltage, and it changes a little with current, but not much. So let’s assume the voltage drop across it at 20 mA will still be about 2.1 V, like we tested in Measure Voltage. That means, the voltage across the resistor will still be about 1.2 V because they still have to add up to 3.3 V. Again, that’s because Kirchhoff's voltage law (KVL) says that the voltages across the components have to add up to the voltage of the supply.
R = V / I
= 1.2 V / 0.020 A
= 60 Ω
Important: Only use a resistor that small in an LED circuit if you are drawing power from the 3.3 V and GND rails on your breadboard. A micro:bit I/O pin cannot even supply 5 mA to an LED circuit with a 220 Ω without its voltage sagging.These are rough estimates, and in product designs, derating is often applied to ensure none of the parts ever fail by being too close to their specification maximums or minimums. For example, you might end up repeating the resistor calculations using 15 mA to be on the safe side.
Since the unit for voltage is V, the unit for current is A, and the unit for resistance is Ω, Ohm’s law also tells us how V, A, and Ω relate:
1 A = 1 V / Ω
1 V = 1 A x Ω
1 Ω = 1 V / A
In this activity you:
Modify calculate_i_from_v_and_r.hex so that it displays the result in milliamps.
Solution: The result of I needs to be multiplied by 1000 before it is displayed, and the A unit needs to be updated to mA. Retest the numbers in the activity, and verify that the results are 5.4545… mA and 1.2 mA.
# calculate_i_in_ma_from_v_and_r from microbit import * while True: text = input("Enter volts: ") V = float(text) text = input("Enter ohms: ") R = float(text) I = V / R I = I * 1000 # <-- Add print("I = ", I, "mA") # <-- Modify print()
Links
[1] https://python.microbit.org
[2] https://learn.parallax.com/sites/default/files/content/Python/Elec/ol-solve-for-i-or-r.mp4