# Voltage Regulation - Help Checking I Have my Facts Straight

Status
Not open for further replies.

#### lthompson

##### New Member
Hi,

I wrote a blog post about voltage regulation a while back while I was learning about how to make a power supply for a microcontroller that wouldn't get affected by other components in the circuit drawing on the same supply:
pure robot.com: Voltage Regulation

I'm still pretty green and would really appreciate any feedback about whether I made any mistakes in my math or understanding of the electronics involved.

This is my first post Luke

#### ke5frf

##### New Member
From what I can tell, your blog was well written.

My suggestion from briefly going over it would be to explain why the 100 ohm resistor values were chosen, how that value was calculated to be suitable.

It is kind of backwards engineering to put together the circuit and then figure out how much current is passing through it, generally speaking one should already have that predetermined according to the diode specs, choose the appropriate resistor value to achieve it, then confirm it once the circuit is operational.

I understand the object of your tutorial was the regulator but it might be worthwhile to add an extra paragraph explaining this. #### audioguru

##### Well-Known Member
Nobody makes a blue LED that has a forward voltage of only 0.54V. It is probably 3V or more.

#### ke5frf

##### New Member
Nobody makes a blue LED that has a forward voltage of only 0.54V. It is probably 3V or more.

Hmmm, looking closer at his photographs and the meter indications, I think he has Vf confused with Vs-Vf

#### lthompson

##### New Member
So...

Excuse the running commentary.. I was reading and learning to try to figure it out.. At the bottom is what I think might be the actual solution:

So if:
Vs = source voltage
Vf = forward voltage

would the correct way to describe this in the image caption of the blue LED be?:
"The blue LED has a forward voltage of 2.76Vf from 3.3Vs (0.54 Vs-Vf):"

Is the voltage drop only related to the LED or does the resistor also cause a voltage drop? My understanding was that the resistor just limits the current without changing the voltage.

How would you restate the current calculations? Like this?:

"Blue LED
- Forward voltage = 2.76 volts
- Resistor value = 100 ohms
-> Current, according to Ohm's law, 2.76 / 100 = 0.0276 amps (or 27.6mA)"

https://forums.gideontech.com/index.php?topic=31862.0;wap2

And I think I may have the calculations wrong still, but I'm not sure how to change it.

From reading that article, I might work it out like this?:
If the LED has a forward voltage of 2.76Vf @ 20 milliamps and my source voltage is 3.3Vs, then the current calculation would be 3.3-2.76 = 0.54V and I'd need to use ohms law R=I*V to calculate the resistor required where I=20mA and V=0.54V so I'd need a 0.0108 ohm resistor...
Something's not right here.

Then I found this site:
LED Resistor Calculator

Attached are the results of their calculator. 27 ohms.

The calculation they use on their site is:
(Vs - Vf) / (mA / 1000)
so (3.3-2.76) / (20 / 1000)
so 0.54 / 0.002 = 27 ohms

So would the correct way to calculate the current and resistance be?:
"Blue LED
- Source voltage Vs = 3.3 volts
- Forward voltage Vf = 2.76 volts
- Desired current = 20mA (0.02A)
- Calculated resistance required:
-> Vs-Vf = 0.54V
-> Ohm's law is R = V / I
-> R = 0.54 / 0.02
-> R = 27 ohms
- nearest available resistor: 33 ohms
- Calculated actual current (I):
-> Ohm's law is I = V / R
-> I = 0.54 / 33
-> I = 16.36mA
- actual resistor used: 100 ohms
- Calculated actual current (I):
-> Ohm's law is I = V / Ra
-> I = 0.54 / 100
-> I = 5.4mA"

#### Attachments

• calculator.png
28.2 KB · Views: 301

#### lthompson

##### New Member
Thanks very much for the feedback. Any chance you could check out my working out:

...I found this site:
LED Resistor Calculator... the results of their calculator was 27 ohms.

The calculation they use on their site is:
(Vs - Vf) / (mA / 1000)
so (3.3-2.76) / (20 / 1000)
so 0.54 / 0.002 = 27 ohms

So would the correct way to calculate the current and resistance be?:
"Blue LED
- Source voltage Vs = 3.3 volts
- Forward voltage Vf = 2.76 volts
- Desired current = 20mA (0.02A)
- Calculated resistance required:
-> Vs-Vf = 0.54V
-> Ohm's law is R = V / I
-> R = 0.54 / 0.02
-> R = 27 ohms
- nearest available resistor: 33 ohms
- Calculated actual current (I):
-> Ohm's law is I = V / R
-> I = 0.54 / 33
-> I = 16.36mA
- actual resistor used: 100 ohms
- Calculated actual current (I):
-> Ohm's law is I = V / Ra
-> I = 0.54 / 100
-> I = 5.4mA"

#### lthompson

##### New Member
Thanks very much to 3v0:

(06:13:59) lthompson: Hi, I'm trying to find some resolution to a thread started a few days ago. Has anyone got time to take a peek at this forum entry:
electro-tech-online.com::voltage​-regulation-help-checking-i-have-​my-facts-straight.html#post809634
(06:23:47) 3v0: hi
(06:24:26) lthompson: (apologies if that's not the right thing to ask)
(06:24:53) lthompson:
(06:26:04) ElectroBot: Mike2545 logs into the Chat.
(06:26:57) 3v0: you are talking about current limit resistors for LED here
(06:27:15) 3v0: not much to that
(06:27:25) 3v0: so what is the current question ?
(06:27:47) ElectroBot: Mike2545 logs out of the Chat.
(06:27:47) lthompson: yes - it should be simple but I am a newb. I wanted to check whether I got the calculation of the current flowing in the circuit correct
(06:28:03) lthompson: (at the end of the linked forum post)
(06:28:30) lthompson: sure
(06:28:43) 3v0: you need to know a few thing to start
(06:28:50) lthompson: ok
(06:28:54) 3v0: Vs or the voltage of the source
(06:29:09) 3v0: Vf which is the forward voltage drop of the LED
(06:29:21) lthompson: ok
(06:29:44) 3v0: and "I" which is the current you want to send through the led
(06:29:49) lthompson: I got a bit confused about forward voltage / forward voltage drop
(06:29:55) 3v0: these are all from datasheets
(06:30:13) lthompson: are they two different things or is there just a forward voltage drop?
(06:30:16) 3v0: to light an LED we must send the voltage through it in a forward direction
(06:30:25) lthompson: right
(06:30:34) lthompson: cause it's a diode
(06:30:35) 3v0: reverse voltage is about using the LED to block current
(06:30:40) 3v0: we are not doing that
(06:30:45) lthompson: ok
(06:30:55) 3v0: because we are sending currrent in the forward direction
(06:31:02) lthompson: yes
(06:31:36) 3v0: to get everything to work out we need the voltage drop of the resistor and Vf to add up to Vs
(06:31:44) 3v0: ok ?
(06:32:07) lthompson: how do you know the voltage drop of the resistor?
(06:32:31) lthompson: (say for a 100 ohm resistor)?
(06:32:47) 3v0: because if Vs = Vf + Vresistor
(06:32:59) 3v0: then Vresistor = Vs - Vf
(06:33:02) 3v0: understand ?
(06:33:21) lthompson: so say I have a Vs of 3.3V
(06:33:32) lthompson: and my LED has a voltage drop of 2.6V
(06:33:41) 3v0: keep going
(06:34:04) lthompson: then the voltage drop of the resistor would be the difference, i.e. 0.7
(06:34:09) 3v0: yes
(06:34:18) lthompson: cool
(06:34:28) 3v0: and knowing that you can figure the resistor value with ohms law so do it
(06:35:01) lthompson: would the resistor value be related to the voltage across the resistor then?
(06:35:11) lthompson: (0.7V)?
(06:35:27) 3v0: we want the ohms of the resistor
(06:35:37) 3v0: how do we figure that ?
(06:35:46) lthompson: yes
(06:36:17) 3v0: what is a formula for ohms law ?
(06:36:38) lthompson: R = V/I
(06:36:45) 3v0: right
(06:36:55) lthompson: so my V would be 0.7?
(06:36:57) 3v0: what is V for the resistor
(06:36:58) 3v0: yes
(06:37:19) lthompson: ok, and I want to limit the current to the LED to 20mA as per it's data sheet
(06:37:30) lthompson: so R = 0.7/.02?
(06:37:36) 3v0: yes
(06:38:05) lthompson: that only gives a value of 3.5 ohms - could that be right?
(06:38:24) 3v0: yes
(06:38:45) lthompson: do they make a resistor that small?
(06:39:18) 3v0: I do not know if I would use 3.3V to source a LED with a Vf 2.6
(06:39:34) 3v0: yes they do
(06:39:52) 3v0: the closest would be 3.6 Ohms
(06:40:16) 3v0: work it with a 5V Vf and you will get a larger resistor value
(06:40:23) lthompson: I tried out the values of the LED on this calculator:

(06:40:49) lthompson: it comes up with 39 ohms instead of 3.5...
(06:41:04) lthompson: not sure but I think i might have messed up the numbers
(06:41:35) 3v0: It says R should be 39
(06:41:43) lthompson: yes
(06:42:08) lthompson: with a source Vs of 3.3, forward voltage of 2.6 and I of 20mA
(06:42:22) lthompson: maybe I should have put 0.7 in the forward voltage?
(06:42:42) lthompson: no but it says 'diode forward voltage'
(06:42:50) ElectroBot: birdman0_o logs into the Chat.
(06:42:57) 3v0: LED is a dioed
(06:43:09) 3v0: It just happens to give light
(06:43:27) lthompson: right, and this LED has a forward voltage of 2.6V
(06:43:33) birdman0_o: Its planned
(06:45:04) 3v0: It looks like it should be 36R but we got a decimal place wrong
(06:45:46) lthompson: ok - so what would the equation be? R = ? / ?
(06:45:55) 3v0: 3.3 - 2.6 .7
(06:46:04) 3v0: ah V=IR
(06:46:14) 3v0: R = I/V
(06:46:20) birdman0_o: nope
(06:46:24) 3v0: yup
(06:46:29) 3v0: R = V/I
(06:46:30) birdman0_o: R = V/I
(06:46:33) birdman0_o:
(06:46:44) lthompson:
(06:46:45) 3v0: .7/.02 still wrong
(06:46:51) 3v0: or is it
(06:47:07) 3v0: 7 / .2 is 35
(06:47:12) 3v0: yup that is it
(06:47:25) lthompson: so how do you get to 7?
(06:47:26) 3v0: do you see what the problem was ?
(06:47:34) lthompson: no
(06:47:48) 3v0: .7/.02 is the same as 7/.2
(06:48:05) lthompson: huh?
(06:48:09) 3v0: and the same as 70/2
(06:48:20) 3v0: mult the top and the bottom by ten
(06:48:22) lthompson: oh yes
(06:48:26) 3v0: has no effect on the number
(06:48:47) 3v0: I get mixed up and must always start from V=IR
(06:48:57) lthompson: oh yes - i got the calculation wrong - it turns out right
(06:49:11) lthompson: me too
(06:49:23) birdman0_o:
(06:49:25) 3v0: The I can see it should be I=V/R
(06:49:41) 3v0: I expect if I used it more often it would stick
(06:49:48) lthompson:
(06:50:45) lthompson: i think I've got it - thanks so much for taking the time to explain. it means a lot!
(06:51:16) birdman0_o: He is a good guy
(06:51:25) 3v0: there is an old trick where you put
V
---
I R
(06:51:53) 3v0: cover any letter and you can see the formula for the other two
(06:52:12) lthompson: cool. i'll remember that
(06:52:31) lthompson: the kids are in the background demanding breakfast - i'd better go
(06:52:38) lthompson: thanks again
(06:52:46) 3v0: no problem

#### lthompson

##### New Member
Thanks

Thanks to everyone for your help. I hope I have now understood the terminology and rules for calculating the current flowing in my circuit. I updated the post:
pure robot.com: Voltage Regulation

Let me know if I got it wrong (again ).
Cheers,
Luke

#### audioguru

##### Well-Known Member
Nobody makes an LED with a forward voltage drop of 2.76V. They make LEDs with a range of voltages so you don't know what is the forward voltage of your LED unless you measure it. It might not light with only 3.3V. The range might be from 2.5V to 3.5V. If it is actually only 2.5V and you use a supply of 3.3V and a 27 ohm current-limiting resistor then the current is (3.3V - 2.5V)/27 ohms= 29.6mA and the LED might burn out.

#### lthompson

##### New Member
Ahhh....

So basically I've still got it wrong because the blue LED probably has a different forward voltage to what I measured, and I'm supplying too little voltage to drive this circuit.

What I'd need to do, is start again say with 5V, or 9V source, and build a new circuit.

To test the forward voltage:
1) take the supply voltage source, measure it with a multimeter. say it measures 8.5V
2) take the LED, attach the positive lead to the positive of the supply voltage source and one to a probe of the multimeter and the other multimeter probe to the negative of the supply voltage source. the measurement will show the source voltage less the voltage drop of the LED. say it read 5.2V.
3) subtract measurement 2) from measurement 1), leaving the correct voltage drop of the LED. this would give say 3.3V.

Then to calculate the resistor required for 1 LED:
1) say the LED can operate at 20mA, to calculate the current limiting resistor required you would:
a) Calculate the voltage drop of the resistor in the circuit by subtracting the forward voltage drop of the LED Vf from the supply voltage Vs. Say 8.5Vs - 3.3Vf = 5.2Vresistor.
b) Knowing the current required and the voltage across the resistor, you can then use Ohm's law to derive the resistor value. R = V/I. So R=5.2/(20mA/1000). So R=5.2/0.02. So R=260 ohms.

Is that right?

I think I need to split up my blog post into two - one about v regs and another about LEDs and current limiting resistors (using a higher voltage source!).

Also, what if you have three LEDs in parallel with different forward voltage drops? How would you calculate the resistors required then? (say with a red, orange and green traffic light that would light up one LED at a time)

#### lthompson

##### New Member
Re-posted blog

I re-posted the blog on v regs taking everyone's comments into account.

Let me know if I screwed it up once more :
pure robot.com: Voltage Regulation

#### audioguru

##### Well-Known Member
To test the forward voltage:
1) take the supply voltage source, measure it with a multimeter. say it measures 8.5V
2) take the LED, attach the positive lead to the positive of the supply voltage source and one to a probe of the multimeter and the other multimeter probe to the negative of the supply voltage source. the measurement will show the source voltage less the voltage drop of the LED.
No.
A multimeter voltmeter is 20M ohms and the current in the LED will be extremely small and no where near when it is lighted.
Use a 9V battery and connect a 330 ohm resistor in series with the LED.
The LED will light and measure the voltage across the LED, then measure the voltage across the 330 ohm resistor.
If the battery is actually 8.5V and you measure 2.8V across the LED and 5.7V across the resistor then the current is 17.3mA. If the voltage across the LED is 1.8V (a red LED) then the current is 20.3mA. If the voltage across the LED is 3.5V (a white LED) then the current is 15.2mA.

#### lthompson

##### New Member

alright, here's what I've done:
1) Measure the voltage output from my 9V battery (after a bit of wear and tear) source = 7.82Vs
2) Built myself a 330 ohm resistor out of three 100 ohms and two 16 ohms in series 3) Plugged in an LED in series with the 330 ohm resistor
4) Measured the voltage across the 330 ohm resistor = 5.09Vresistor
5) Measured the voltage across the LED = 2.3Vled
(see attached pictures of each step and the measurements)

So to calculate the current in the circuit I'd use:
I = Vresistor / R
so I = 5.09 / 330
so I = 0.0154A
so I = 15.4mA
?

If I've got this far OK, would you give me some hints about how to work out the current in a circuit with three different LED colours all lit up at once? Say a red, green and orange LED? Also, how would it work if you had a program run through the traffic light sequence - lighting up each LED in turn to simulate a real traffic light - would the other LEDs affect the brightness of each other as they turned on or off?

#### ke5frf

##### New Member
This would be a parallel arrangement, the three LEDs and their respective current limiting resistors.
Your circuit would look something like:

______________________________________ 9 volt rail
| | |
| | |
| | |
\/ \/ \/
-- -- --
| | |
R R R
| | |
_______________________________________ Ground rail

V is forward biased diode, R is resistor

(I hope it lines up when I post it)

Each series branch (LED and associated resistor) has its own independant voltage drops. The supply voltage will be presented equally to all branches. Treat each branch as you would only one. Measure the drops on each LED and resistor in parallel or as you did before, and the same values will be measured. The current through each LED/Resistor pair will also be calculated as the same.

The only difference now is that the current through the entire circuit, ie the three branches together, will be the sum total of all currents. Like opening three water spigots, the sum total of water flow will be the total flow through all three spigots.

IMPORTANT: The operation of these three branches, the voltage and current measurements, all hold true AS LONG AS the voltage source has the current capacity to supply all three LEDs. A 9 volt battery, fully charged, will have no problems.

The traffic light question. If you had the LEDs in parallel, with a triple throw switch from the power rail switching them independantly, the LEDs in one branch or path will not effect the others, as they are in effect being independantly switched and the other branches are OPEN CIRCUITS.

#### ke5frf

##### New Member
OK, it didn't line up. Consider the three vertical columns of characters as spaced out along the rails.

#### audioguru

##### Well-Known Member
This is 2009.
ASCII made schematics 18 years ago.

The 9V battery (7.39V) is dead and should be replaced.

#### ke5frf

##### New Member
To think of this another way, consider the homes in your neighborhood to all be powered in parallel off of the same power distribution source. Each home has the same voltage at the wall outlets and each appliance operates independantly in parallel within your home from the breaker or fuse box. There is no disruption in any branch by the usage of another. All homes have equal power, all appliances operate to specification, all lights burn brightly. Turning off lights at your residence has no effect on your neighbors, and turning off lights in your living room has no effect on the lights in your bedroom. The only exception would be when an appliance is operating which exceeds the current capacity of the circuit, for instance when an AC unit compressor or fan motor becomes rotor locked and the circuit shorts, then the current capacity of that circuit is exceeded because the voltage has dropped, robbing from the other circuits in your home and dimming the lights, and if the condition is severe enough, dragging down the neighbors supply as well. This is what happens in your LED circuit if the battery is insufficient for your load.

#### ke5frf

##### New Member
This is 2009.
ASCII made schematics 18 years ago.

The 9V battery (7.39V) is dead and should be replaced.

Whatever. That was a quick and dirty visual aid. I'm not interested in uploading a file tonight.
Yes his battery is low. He doesn't care about the battery. He is interested in learning the math and theory.

I'm trying to help.

Send him some new batteries and we'll all be happy ##### Banned
For ascii schematics use code tags and change the font to fixedsys, they preserve spacing.

Code:
-        At
--      least
---    I'm
----  pretty
-----sure.

#### ke5frf

##### New Member
OK, may as well fix it then.

______________________________________ 9 volt rail
|.............................|............................|
|.............................|............................|
|.............................|............................|
\/............................\/...........................\/
--...........................--...........................--
|.............................|............................|
R.............................R............................R
|.............................|............................|
_______________________________________ Ground rail

Well, according to the preview it didn't preserve the spacing, oh well. I cleaned it up with some periods as spacers.

Not perfect, but better. Should convey the idea.

Status
Not open for further replies.

Replies
16
Views
2K
Replies
3
Views
4K
Replies
5
Views
2K
Replies
43
Views
4K
Replies
3
Views
2K 