# Ohms calculation question

So when I figure a volt say 5, and current like arduino .020, I get 250 as the resistance. Is that 250 the resistor I need? In other words what does the resistor limit? Volts? So if I want a component to stay under 5 volts, when working with 0.20 milliamps, I need a 250 ohm resistor? Correct? Or is 250 the resistance between the volts and .02 ma?

Let me restate it this way, if my uno works at 5v, and my component is say 7v, how to compute a resistor to use?

You'd need a magical resistor to get 7v from a 5v output...

cjdelphi:
You'd need a magical resistor to get 7v from a 5v output...

You do get those though, they're called batteries.

Bstanko6:
So when I figure a volt say 5, and current like arduino .020, I get 250 as the resistance. Is that 250 the resistor I need? In other words what does the resistor limit? Volts? So if I want a component to stay under 5 volts, when working with 0.20 milliamps, I need a 250 ohm resistor? Correct? Or is 250 the resistance between the volts and .02 ma?

Let me restate it this way, if my uno works at 5v, and my component is say 7v, how to compute a resistor to use?

if you just put a 250 Ohm resistor between an arduino output and GND, the current through the resistor will be about 20mA (a little less actually, because the output voltage is a little less than 5V) , but that won't be very useful if you want to drive a component that needs 20mA to work, you also need to know the voltage across this component. For example, let's assume the voltage across a red LED is 1,2V . If you want to source it with 20mA , the resistor value will be R = (Uoutput-Uled)/I = (5-1,2)/0.02 = 190 Ohm
There will be 1,2V across the led, and 3,8V across the resistor.
AFAIK, 190 Ohm is not a normalized 5% resistor value, you'll get a 200 Ohm (or a 220 Ohm) , the current will be 19mA (or 17mA), which is more than enough for the led, and better for the arduino There are a lot of components, before you drive one from arduino, you must know its characteristics (resistance, current needed, voltage etc ...) and stay below the absolute maximal ratings of the atmega328 outputs

if your component needs 7V to work, then, you cannot drive it from an arduino and a resistor, you'll need a transistor or a mosfet ....

Bstanko6:
In other words what does the resistor limit? Volts?

Voltage is Pressure.
Current is Flow.
Resistor is Resistance.

These are all very different aspects of electricity whose behaviors are defined by Ohm's Law.

When current flows through a resistor, the resistor provides resistance against the current flow. Ohm's law says that when you multiple resistance times current, you calculate the voltage drop. So that means if 20mA is flowing through a 250ohm resistor, it will drop 5V across it.

Voltage is measured as a difference between two points. So if you measure the voltage across a resistor, you see its voltage drop.

In a circuit voltage drops across components add up. All of the current that leaves the source has to to also enter the source.

Bstanko6:
So if I want a component to stay under 5 volts, when working with 0.20 milliamps

This very much depends on the component. Diodes or LEDs (light emitting diodes) are not linear devices. The need for a resistor is because the LED drops a certain amount of voltage and then, effectively, turns into a short circuit. The resistor is there to limit the current when that happens. In that case, you subtract the voltage the LED will drop (which is defined by its color) from the source voltage. The remaining amount is used to calculate the current limiting resistor.

For example if it is a red LED, the forward voltage is around 1.6V. So you take 1.6V from 5V to get a remaining voltage drop of 3.4V. If you want 20mA to flow through that LED, you calculate 3.4V / 20mA = 170Ohm.

Note that many people pick the maximum rated current for a LED. There's nothing that says you have to use the maximum current. In fact, allowing the maximum (or more) current through the LED will shorten its life.

On the other hand if you have a 3.3V device (like a sensor or IC), you can't simply use a resistor to drop 5V down to 3.3V, unless that device draws a constant amount of current. Any change in current will change the voltage drop across the resistor. In that case you need a voltage regulator.

Bstanko6:
Let me restate it this way, if my uno works at 5v, and my component is say 7v, how to compute a resistor to use?

That question doesn't make sense. Resistors drop voltage, not amplify it.

if your component needs 7V to work, then, you cannot drive it from an arduino and a resistor, you'll need a transistor or a mosfet ....

But just to clarify, you'll still need to provide that 7v from somewhere; where the Arduino might come in would be to act as the control, to switch the transistor on (or off) to let that 7v through (or not) to the component.

yes, you must provide the 7V from an external power source (GND connected to Arduino GND)

the arduino output will switch on or off the transistor

just google with "transistor+switch+arduino", you'll find several examples

so let me get this right, If i work with a component that needs only say 1 volt, but i work with something that is 24 volts to be outrageous... i need a resister to protect the component from the other 23 volts? does that sound about right? I know the scenario is crazy, i just need to know what i am trying to use a rsistor for.

Bstanko6:
so let me get this right, If i work with a component that needs only say 1 volt, but i work with something that is 24 volts to be outrageous... i need a resister to protect the component from the other 23 volts? does that sound about right?

No, a resistor is to limit current.

Voltage and Current are different, as I explained already.

If you need to change voltage for "a component" you probably need a voltage regulator.

James, here is my last question.

I have a dc Jack at 12v. The milliamps is 100. If I plugged in an led, I would need a resistor to bring the current down to the LEDs level? What about the volts?

Bstanko6:
I have a dc Jack at 12v. The milliamps is 100. If I plugged in an led, I would need a resistor to bring the current down to the LEDs level? What about the volts?

Please watch this video which explains voltage, current, and power: Brief Intro to Voltage, Current, and Power | AddOhms #4 - YouTube

Now, back to your question. The DC Jack on an Arduino is also connected to the "Vin" pin of the Arduino. So when you calculate the current limiting resistor, you need to start with deciding which voltage source on the Arduino board you are going to use Vin (12volts in this case), 5V or 3.3V.

Your comment "the milliamps is 100" doesn't really fit. A power source has a maximum current is can provide, but devices only draw what they draw. So if you select/calculate a current limiting resistor to provide 20mA to the LED then it will only draw 20mA from that 100mA supply. On the other hand, if you don't use a current limiting resistor, then the LED will try to draw almost the full 100mA and (assuming it is a typical LED) be drawing 5x its rated current....

Dude!

LEDs unlike old style incan bulbs require "limiting" inside a light bulb we have a wire, think of the wire as a resistor, that determines the brightness.

Take a big pipe of water, feed that pipe directly to a medium sized pipe then again to a smaller pipe.

If you supply a small amount of water / charge, it will flow through all the sections of the pipe, increase the current with the same voltage, we will have too much water flowing through the smaller pipes, the pressure from start to finish depends on the smallest pipe.

So think of a resistor as the "pipe size" by increasing , decreasing it you can control the amount of current

Now with ohms law you can work out the size of the pipe.

Think about current the amount of water flowing.
Think about voltage in terms of how fast the water flows.

Eg we have 1 litre of water.

100ml per hour for 10 hours.
1000ml for 1 hour.

Only electrons are much more easy to manipulate, so by using a resistor to create a small pipe, you control the amount of energy flowing to your led..

So can I plug a 12v / 100ma dc into arduino?

Bstanko6:
So can I plug a 12v / 100ma dc into arduino?

Yes into the Barrel Jack or the Vin pin.

Keep in mind that the board, by itself, draws 30-50mA. So that doesn't leave much for the rest of your project.