Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: LEDs and Current Limiting Resistors for Volcano Buttons--Topic Split From javeryh's Woodgrain Cabare  (Read 440 times)

0 Members and 1 Guest are viewing this topic.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8142
  • Last login:Today at 03:37:19 am
  • Designated spam hunter
EDIT: This thread was split off of javeryh's build thread at http://forum.arcadecontrols.com/index.php/topic,161994.msg1729710.html#msg1729710.

Each LED and resistor pair are only going to draw a total of about 20 mA so that's 100mW -- around 60mW for the resistor and around 40 mW for the LED.
(Watts = V * A ==> W = 5v * 20mA ==> 100mW)
Scott, I think in your calculations you either forgot to take into account the resistor & voltage drop, or forgot that current is constant through a given circuit. If the above works as expected with 150R as I suggest, then the total current draw for 2 LEDs should be about 40mA/80mW.
Your point is correct if you're talking about both legs of the 2 resistor + 2 LED parallel circuit.

I was describing one leg of the parallel circuit and pointing out that the (single) resistor and the (single) LED of that leg will only have about 20 mA flowing through them.  Any current flowing through the resistor will also flow through the LED.
- Adding a matching second resistor and LED in parallel with the first ones will not change the current flow through or voltage drops of the first ones, assuming that the power supply can handle the doubled current flow.

R1 + LED1 will draw about 20 mA through one leg of the parallel 5v circuit.
- R1 will dissipate around 60mW and LED1 will dissipate around 40mW -- around 100 mW for this leg.

R2 + LED2 will draw about 20 mA through the other leg of the parallel 5v circuit.
- R2 will dissipate around 60mW and LED2 will dissipate around 40mW -- around 100 mW for this leg.

Total current draw for the two parallel legs is about 40 mA.
- The entire circuit (2 resistors and 2 LEDs) will dissipate a grand total of around 200 mW -- around 120 mW for the resistors and around 80 mW for the LEDs.
--------
The reasons I suggested 220 ohm resistors are:

1. Yotsuya has successfully used them and recommends them. (see quote in reply #516 above)

2. LEDs run cooler and last longer at lower voltages.
- An LED rated for 2v will last longer if you run it at 1.8v.
- If you have to replace the LED, there's a good chance that the new one is going to be rated for 1.8v.
- As long as the voltage is high enough to reliably forward bias the LED and it lights bright enough for your taste, you're good to go.   ;D


Scott
« Last Edit: December 21, 2020, 04:52:18 am by PL1 »

Zebidee

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1390
  • Last login:Today at 08:49:42 am
Scott, I think you are forgetting that current through a circuit is constant at all parts, so the current through the LED is also the current through the resistor. For these purposes, each resistor and LED pair can be considered a separate (sub)circuit.

Ohm's law tells us that
Voltage = current x resistance
Power = voltage x current

So as you can see, power through this circuit will also be constant.

Here is a handy calculator I found with my Google-fu that you can use: https://ohmslawcalculator.com/led-resistor-calculator

The reasons you gave for suggesting a 220-ohm resistor are good, not disputing that at all. If that worked for Yotsuya for this specific arrangement then yay \o/, and I agree that it is better to run LEDs at a lower voltage (higher value resistor) if possible. That is why I tried 200R with a standard green LED recently, but hey it didn't work for me (well, worked briefly). Once I stepped the resistor down to 150R (recommended value from that calculator I linked above) all was good.

EDIT: All of that was a long way of saying maybe javeryh should consider ordering some 150R resistors as well, just in case
« Last Edit: December 20, 2020, 07:13:30 pm by Zebidee »
Check out my completed projects!


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8142
  • Last login:Today at 03:37:19 am
  • Designated spam hunter
Scott, I think you are forgetting that current through a circuit is constant at all parts, so the current through the LED is also the current through the resistor.
I'm not forgetting that.   :lol

Perhaps I didn't explain it clearly, but that is exactly what I meant by,
Any current flowing through the resistor will also flow through the LED.
The electrons flowing through the LED are the same ones flowing through the resistor that is on the same leg or sub-circuit.
- Half (20 mA) of the total current flow (40 mA) will go through the leg with R1 and LED1.
- Half (20 mA) of the total current flow (40 mA) will go through the leg with R2 and LED2.

For these purposes, each resistor and LED pair can be considered a separate (sub)circuit.
Yes.  "Leg" and "(sub)circuit" are different ways of describing the same thing -- the two equal sub-parts of this 2 resistor + 2 LED parallel circuit.
- The two 5v pins are at the same electrical potential (voltage) so the electrical calculations are the same as if the 5v lines to the resistors were connected to a single pin.



That is why I tried 200R with a standard green LED recently, but hey it didn't work for me (well, worked briefly).
Green LED.  That's why you had trouble with a 200 ohm resistor.

Green and blue LEDs drop more voltage (around 3v) than red ones. (around 1.9v)
- Different materials used for the LED's P/N junction forward bias at different voltages and emit different wavelengths of light.
- A 150 ohm current limiting resistor is perfect for your green LED button.   :cheers:


Scott

Zebidee

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1390
  • Last login:Today at 08:49:42 am
What I was saying there was that your calculations for power (watts) were wrong.

In total the both LEDs, or "leg" of the circuit to use your parlance, consume around 80mW = 2v * 40mA (P=V*I), not 100mW each like you said before.

So you don't need 1/2 watt rated resistors, ordinary 1/4 or even 1/8 watt rated resistors should be fine. But hey it doesn't hurt.

The electrons flowing through the LED are the same ones flowing through the resistor that is on the same leg or sub-circuit.
- Half (20 mA) of the total current flow (40 mA) will go through the leg with R1 and LED1.
- Half (20 mA) of the total current flow (40 mA) will go through the leg with R2 and LED2.

For these purposes, each resistor and LED pair can be considered a separate (sub)circuit.
Yes.  "Leg" and "(sub)circuit" are different ways of describing the same thing -- the two equal sub-parts of this 2 resistor + 2 LED parallel circuit.
- The two 5v pins are at the same electrical potential (voltage) so the electrical calculations are the same as if the 5v lines to the resistors were connected to a single pin.




This is all 100% correct


Green and blue LEDs drop more voltage (around 3v) than red ones. (around 1.9v)
- Different materials used for the LED's P/N junction forward bias at different voltages and emit different wavelengths of light.
- A 150 ohm current limiting resistor is perfect for your green LED button.   :cheers:
Scott

This is not quite correct. Now there are all kinds of LEDs to be exceptions to this, but in general your red/orange/green are all around the 1.8-2.2v range, but white and blue are the ones with the higher voltage drops up around 4.2v or so. Now I just wrote that off the top of my head, but you can easily google up some charts of typical forward voltage (voltage drop) and current values that will roughly align with that.

You can easily measure the voltage drop over the LED with a multimeter, and/or can use a battery to rig up a test circuit if needed

EDIT: just adding that in the case of my green LED, the forward voltage was 2.0v and it consumed 20mA, so it was a good example as it exactly matches the LEDs we were talking about (colour is not relevant). So if it was me, I'd grab both 150R and 220R resistors - they are very cheap.
« Last Edit: December 20, 2020, 09:48:22 pm by Zebidee »
Check out my completed projects!


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8142
  • Last login:Today at 03:37:19 am
  • Designated spam hunter
What I was saying there was that your calculations for power (watts) were wrong.

In total the both LEDs, or "leg" of the circuit to use your parlance, consume around 80mW = 2v * 40mA (P=V*I), not 100mW each like you said before.
You're misquoting my power calculations.   :soapbox:

1. This parallel circuit has two legs.

2. Each leg has a resistor and an LED.
- R1 and LED1 = leg1
- R2 and LED2 = leg2

3. Each leg has 20 mA of current flow.
- 20 mA flows through R1 and LED1.
- 20 mA flows through R2 and LED2.

4. The resistors are dropping about 3v and the LEDs are dropping about 2v.

5. There are four components that are dissipating power. (Volts * Amps = Watts)

  (leg1)
R1:    3v * 20 mA = 60 mW
LED1: 2v * 20 mA = 40 mW

  (leg2)
R2:    3v * 20 mA = 60 mW
LED2: 2v * 20 mA = 40 mW

6. Power totals for the legs:
- 60 mW is dissipating across R1 and 40 mW is dissipating across LED1 for a total of 100 mW dissipating across leg1.
- 60 mW is dissipating across R2 and 40 mW is dissipating across LED2 for a total of 100 mW dissipating across leg2.

7. Power totals by component type:
- The two resistors drop a total of 120 mW. (60 mW + 60 mW)
- The two LEDs drop a total of 80mW. (40 mW + 40 mW)

8. Power total for the whole circuit:
- 100mW (leg1 power) + 100 mW (leg2 power) = 200 mW (total power)

So you don't need 1/2 watt rated resistors, ordinary 1/4 or even 1/8 watt rated resistors should be fine. But hey it doesn't hurt.
Agreed.  Each resistor is dissipating 60 mW so the only reason to use 1/4 or 1/2 watt resistors is for the thicker leads -- pretty sure I mentioned that earlier in the thread.

I assume you mention this because of that note on Javeryh's diagram.
- He probably got the idea from smalltownguy's post here.

Green and blue LEDs drop more voltage (around 3v) than red ones. (around 1.9v)
- Different materials used for the LED's P/N junction forward bias at different voltages and emit different wavelengths of light.
- A 150 ohm current limiting resistor is perfect for your green LED button.   :cheers:

This is not quite correct. Now there are all kinds of LEDs to be exceptions to this, but in general your red/orange/green are all around the 1.8-2.2v range, but white and blue are the ones with the higher voltage drops up around 4.2v or so. Now I just wrote that off the top of my head, but you can easily google up some charts of typical forward voltage (voltage drop) and current values that will roughly align with that.
I just transcribed the voltage ratings off a variety pack of LEDs.
- In this pack, green is 3v and lime green is 2.1v -- green volcano buttons look more like regular green than lime green.   :dunno

As always, it's good to know the ratings for the specific component you're working with -- data sheets are our friends.   :lol

You can easily measure the voltage drop over the LED with a multimeter, and/or can use a battery to rig up a test circuit if needed
Yes, you can use a multimeter to find the correct current limiting resistor value.
- Start with a larger-than-estimated resistor that still forward biases the LED and measure the current flow.
- From there, adjust the resistor size to get in the 15 - 20 mA range.  A reduction in resistance ==> an increase in current.


Scott
« Last Edit: December 21, 2020, 04:58:24 am by PL1 »

Zebidee

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1390
  • Last login:Today at 08:49:42 am
Scott

Dammit

You... are right! About the power - I was basing my power calculations only on what was being dissipated by the LED itself, and let myself be misled by an online calculator (https://ohmslawcalculator.com/led-resistor-calculator) which reports power used the LED but not the entire circuit. I was letting myself ignore the resistor's contribution to power use. SO now I have to apologise for being a dick  :notworthy:

I realised my mistake once I started thinking about the circuit I'd put myLED into in an overall sense, how I'd measured the 5v circuit's current before and after (+20mA with LED) and used a little Ohm's law to calculate the extra power usage at.... +100mW. Duh. Obvious, and exactly what you'd said. For some reason it is easier to understand when looking at it from the "big picture" perspective   :dizzy:

I feel bad and embarrassed now about polluting javeryh's thread  - I'd be happy if you just deleted that part of the discussion. Your call   :-X

Check out my completed projects!


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8142
  • Last login:Today at 03:37:19 am
  • Designated spam hunter
No worries, Zebidee.  Glad we're back on the same page.   :cheers:

I'll just leave this for people trying to figure out the math for LEDs, current limiting resistors, parallel circuits, and those rare green volcano LED buttons.


Scott

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6908
  • Last login:Today at 09:15:26 am
    • Bella's Arcade
This stuff is hugely helpful for me. The 220 ohm resistors arrived so I'm going to wire them up this afternoon if I can ever get off of these work calls...

I found a thread on reddit HERE where someone was wiring volcano buttons and was using the 220 ohm resistors as well.  The wiring is a bunch of spaghetti but if I stare at it long enough I should be able to figure out which wire goes where (ground vs. the hot wire).

The final results make the LEDs look a bit dim but would be plenty good enough for me.  Is this what you guys are arguing about?  I assume the bigger the resistor the less power that gets through so the dimmer the LED will be?  But if you let too much through you will blow the LED?

 :cheers:


Zebidee

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1390
  • Last login:Today at 08:49:42 am
The final results make the LEDs look a bit dim but would be plenty good enough for me.  Is this what you guys are arguing about?  I assume the bigger the resistor the less power that gets through so the dimmer the LED will be?  But if you let too much through you will blow the LED?

 :cheers:

Yeah, that's pretty much it. LEDs have a "forward voltage" or "voltage drop" value, and the voltage reaching it at the anode (long leg) must reach that point before power flows through to the cathode (short leg). The voltage level "drops" by that amount as current passes through the LED. 2v is a pretty typical value for the voltage drop and while there are typical values for different colours etc., every LED is different.

So the resistor is to limit the current flow and "divide" the voltage so that it is close to (or a little bit above) the voltage drop. Otherwise the LED burns through too much current and can get quite hot, dramatically reducing its lifetime. A really hot LED might also represent a fire risk.

Anyway, by limiting the current the LED burn through less power and yes should be a bit less bright. But if you don't have enough power to pass the voltage drop or "open the gate", no current flows at all and LED stays off.

So you can do the calculations yourself or just use an online calculator, like what I linked before. An issue with those calculators is they will usually return a "safe" resistor value for which the LED should work 100% of the time, like 150R in the earlier example. However you can often get away with a higher value like 220R which still lets enough current through for the LED to work, but maybe a bit less bright. Looks like 220R will probably work for the volcano buttons. Resistors are very cheap and there is nothing to lose by trying different/higher values, the worst that can happen is no current flows and the LED won't work. Often it is worth seeing what you can get away with, especially if the LED is already very bright.

There's also nothing wrong with having some 150R resistors and other values handy too - I use them a lot in this hobby  :laugh:
Check out my completed projects!


Zebidee

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1390
  • Last login:Today at 08:49:42 am
This stuff is hugely helpful for me. The 220 ohm resistors arrived so I'm going to wire them up this afternoon if I can ever get off of these work calls...

FWIW almost everything I know about electronics I've learned from this hobby and my own efforts to learn more. Self-taught, well 90% anyway. Learned almost zilch at school.

I've come a long way but sometimes days like yesterday come and I feel like a dumb noob again. Both arcades and electronics are fascinating hobbies and there is always more to learn :D
Check out my completed projects!


PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8142
  • Last login:Today at 03:37:19 am
  • Designated spam hunter
I assume the bigger the resistor the less power that gets through so the dimmer the LED will be?  But if you let too much through you will blow the LED?
You got it.   :cheers:

Larger resistor ==> less current flows through the entire circuit and more of the 5v drops across the resistor leaving less voltage to drop across the LED.

You want to hit the sweet spot between enough voltage and current to forward bias (light) the LED and too much voltage and current that will burn out the LED.


Scott