Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Choosing an LED/Resistor for Netduino PWM

led n+2 resistor

Best Answer Paul Newton, 10 January 2013 - 06:36 PM

No - the transistor acts as a buffer between the two voltages. Referring to the diagram in Noom's link: The transistor sits at the bottom connected to ground. To turn it "ON", the Netduino needs to apply a voltage of approximately 0.7V to the base. Since the the Netduino outputs are 3.3V, there is actually too much voltage available, and this could damage the transistor. Hence the 2K ohm resistor between the Netduino and the transistor to limit the current that can flow into the base. Above the transistor there is the load and a series resistor to limit the current in the load. In your case, you want 3.3V at 20mA to flow when the transistor is ON. If you use the 3.3V rail, you would not need a resistor since the voltage not too large. However, when the transistor is ON, it is not a perfect switch and there is a small amount of voltage wasted (approx 0.3V). So the LED will only get about 3V. My suggestion then is to use a 5V rail with a resistor to limit the LED current: R = V / I = (5 - 3.0 - 0.3) / 20mA = 1.7 / 0.02 = 85 ohms Since you can't buy every value of resistor, you could try an 82 ohm resistor. Hope this helps - Paul

Go to the full post


  • Please log in to reply
5 replies to this topic

#1 zorlack

zorlack

    New Member

  • Members
  • Pip
  • 9 posts

Posted 09 January 2013 - 06:43 PM

Hello all,

 

There's quite a bit of literature about this topic, but I'm having trouble understanding all the implications. I'm working on a project which I'd like to have PWM-controlled LEDs.

 

I've been reading that I need a current-limiting resistor to protect the Netduino's PWM pins from damage. I was wondering if this is always the case.

 

I have some LEDs which state that they have a 3.3V forward voltage at 20MA. By my read that should not unduly stress out the PWM pin.

 

Am I misunderstanding the characteristics of the LED?

 

A little guidance would be helpful.

 

Thanks so much!

 

-Z



#2 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 09 January 2013 - 06:55 PM

i would never use 20ma on a pin. yes the plus2 can handle that - but it has still a total limit.

 

you best thing todo: add a 2kohm resistor to the pwm pin.. hook it up to a transistor.. and drive the led with that.

 

http://blog.codeblac...ransistors.aspx

 

i mean, seriously, you dont wanna fry your netduino - or one of its pins



#3 zorlack

zorlack

    New Member

  • Members
  • Pip
  • 9 posts

Posted 09 January 2013 - 06:59 PM

Thanks NooM!

 

Will using a transistor in that fashion pass the PWM pulses along to the LED, or will it lock to high or low?



#4 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 09 January 2013 - 09:00 PM

Hi Zorlack,

 

The Netduino  PWM output would turn the transistor on and off repeatedly.

This will send a pulsed current through the LED - by changing the period of the Netduino output, you will acheive the brightness control you are after.

 

Have fun - Paul

 

Edit:

To get the most out of your LED, you will want to supply it from the 5V rail, with a series resistor.

If you use the 3.3V rail, you will not be giving it the full 3.3 due to a small voltage drop accross the transistor.



#5 zorlack

zorlack

    New Member

  • Members
  • Pip
  • 9 posts

Posted 09 January 2013 - 10:50 PM

Thanks for this tip Paul!

 

To get the most out of your LED, you will want to supply it from the 5V rail, with a series resistor.

If you use the 3.3V rail, you will not be giving it the full 3.3 due to a small voltage drop accross the transistor.

 

If I connect the transistor to +5v, do I not have to have +5V to trigger it as well?

 

-Z



#6 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 10 January 2013 - 06:36 PM   Best Answer

No - the transistor acts as a buffer between the two voltages. Referring to the diagram in Noom's link: The transistor sits at the bottom connected to ground. To turn it "ON", the Netduino needs to apply a voltage of approximately 0.7V to the base. Since the the Netduino outputs are 3.3V, there is actually too much voltage available, and this could damage the transistor. Hence the 2K ohm resistor between the Netduino and the transistor to limit the current that can flow into the base. Above the transistor there is the load and a series resistor to limit the current in the load. In your case, you want 3.3V at 20mA to flow when the transistor is ON. If you use the 3.3V rail, you would not need a resistor since the voltage not too large. However, when the transistor is ON, it is not a perfect switch and there is a small amount of voltage wasted (approx 0.3V). So the LED will only get about 3V. My suggestion then is to use a 5V rail with a resistor to limit the LED current: R = V / I = (5 - 3.0 - 0.3) / 20mA = 1.7 / 0.02 = 85 ohms Since you can't buy every value of resistor, you could try an 82 ohm resistor. Hope this helps - Paul







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.