How to find Resistor value form voltage drop?

Thread Starter

moneshrathod

Joined Dec 19, 2023
13
How can I find resistor values form voltage drop across the resistor I needed?
5V DC supply will get convenient into 2.3 V and goes GPIO of Controller and LED is connected to indicate the supply is on
I want find value of resistor if the voltage drop is 1.9V and 0.7V for R1 and IMG20240820072900.jpgR2
 

dendad

Joined Feb 20, 2016
4,636
You need to measure the current. Without 2 of the 3 values, the other cannot be found. Volts (E), Current (I) and resistance (R).
Then R=E/I
Look up Ohms law.
1724121667467.png
Some folk use "V" instead of "E", and "P" in place of "W".
By the way, your voltages in the diagram don't add up. Do you want 3.1V to the port pin?
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,086
The 2.3 V voltage value does not make sense in your schematic. Separate from that, here is how to calculate the resistor values.

To start, you select the LED current. For a typical small LED, this is usually around 10 mA to 20 mA, although some high-brightness LEDs need only 2mA to 5 mA.

Once you select the current, and you already have determined the desired voltage drops, use Ohm's Law to calculate the resistances.

Usually, the first-pass calculation will yield resistor values that are not standard ones you can buy. For example, if you choose an LED current of 10 mA, then the two resistors calculate out to be 1900 ohms and 700 ohms; neither of these are "normal" parts.

The next step is to start substituting the nearest standard values, calculate the current, use that new current to calculate the individual voltage drops, and see how far the desired output voltage shifts. It can take two or three rounds of this calculating to come up with the best fit resistor values.

Another approach is to change the LED current so that at least one of the resistors is a standard value. For example, if you increase the 700 ohm resistor to 750, and keep the 0.7 V drop across it, you can use Ohm's Law to calculate the resulting current. Use that current and the 1.9 V drop across the other resistor to recalculate it. Again, this can take several rounds to optimize.

There probably is no perfect resistor combination. You probably will have to accept that the output voltage will not be exactly what you want. That's OK, because all MCU input pins have a range of acceptable voltages; there is no one perfect value. As long as your output voltage is near the middle of the range, it should work fine.

Don't get frustrated - everybody has gone through this.

ak
 

MrChips

Joined Oct 2, 2009
34,698
Your numbers don’t add up.

If you want 2.3 V going to the GPIO, then there is 2.7 V across the upper resistor and about 1.6 V across the lower resistor and about 0.7 V across the diode.
 

dendad

Joined Feb 20, 2016
4,636
Try the following.
Assume 10mA. That will be plenty.
So, work the resistance required for 0.7V for the lower resistor. Or, you could just use a diode as that has a 0.7V drop across it. The diode may be a better way to go. That way you just need to work out one resistor. Also, it will clamp the input voltage.
Then, the top resistor is supply volts - 2.7V divided by the 10mA current.
 
Top