Oz-Solutions Tutorial: RGB LED
#1
Posted 08 November 2010 - 12:57 AM
#2
Posted 08 November 2010 - 03:38 AM
#3
Posted 08 November 2010 - 04:02 AM
#4
Posted 08 November 2010 - 08:39 AM
#5
Posted 08 November 2010 - 03:00 PM
...
Very nice tutorial. But please include current limiting resistors in the schematic, so people do not burn both the LED and Netduino (PWM pins can source only 8 mA).
I didn't think about the current being used, I'll update the schematic as soon as possible (this weekend at the latest). thanks for pointing this out!
#6
Posted 08 November 2010 - 09:15 PM
Very nice tutorial. But please include current limiting resistors in the schematic, so people do not burn both the LED and Netduino (PWM pins can source only 8 mA).
I updated the schematic, thanks again for pointing this out.
#7
Posted 08 November 2010 - 09:50 PM
Nice try I am not going to nit-pick any further, but generally it is not considered a good idea to connect LEDs with different forward voltage in parallel with one resistor. The reason is left as an exercise for the curious readerI updated the schematic, thanks again for pointing this out.
P.S. Is the resistor really yellow-violet-yellow (470 kΩ)?
#8
Posted 08 November 2010 - 10:03 PM
Nice try I am not going to nit-pick any further, but generally it is not considered a good idea to connect LEDs with different forward voltage in parallel with one resistor. The reason is left as an exercise for the curious reader
P.S. Is the resistor really yellow-violet-yellow (470 kΩ)?
It would be a shame if someone messed up their netduino or led because of me, so nit-pick all you wish! The resistor is that value, I used that value with some other leds I have, but I feel like it isn't to important since [hopefully] people will use the resistor that fits their led. I am sitting here ready to change the schematic, what resistance would you suggest?
#9
Posted 08 November 2010 - 11:24 PM
Well then...It would be a shame if someone messed up their netduino or led because of me, so nit-pick all you wish! The resistor is that value, I used that value with some other leds I have, but I feel like it isn't to important since [hopefully] people will use the resistor that fits their led. I am sitting here ready to change the schematic, what resistance would you suggest?
In general, the value of current limiting resistor is calculated as R = (VCC - VF)/IF, where VCC is the supply voltage, VF is LED forward voltage (aka drop) and IF is LED forward current. The typical and maximum values of VF and IF are usually obtained from the device datasheet, certain safe values can be used (depending on LED color) in case the datasheet is not available. For example, Sparkfun's RGB LED has typical forward voltage 2.0V/3.2V/3.2V for Red/Green/Blue at IF = 20 mA. Thus, the resistor values for LEDs powered from 3.3V rail are:
- Red: (3.3 [V] - 2.0 [V])/0.02 [A] = 65 Ω,
- Green: (3.3 [V] - 3.2 [V])/0.02 [A] = 5 Ω,
- Blue: (3.3 [V] - 3.2 [V])/0.02 [A] = 5 Ω.
- Red: (3.3 [V] - 2.0 [V])/0.008 [A] = 162 Ω,
- Green: (3.3 [V] - 3.2 [V])/0.008 [A] = 12.5 Ω,
- Blue: (3.3 [V] - 3.2 [V])/0.008 [A] = 12.5 Ω.
Regarding the shared resistor and parallel LED connection, it is relatively safe (if you know what you are doing) for LEDs with the same forward voltage - it can vary significantly, so measure, prefer LEDs from the same batch etc. For different forward voltages (e.g. 2.0 V red vs. 3.2 V green) the variations in the forward voltage requirements of individual LEDs will result in non-uniform current distribution, which means non-uniform brightness. Additionally, if one of the LEDs fails, the other can be damaged by high current.
There is a lot of information on the subject available on the Internet, the key is to understand the LED current vs. voltage characteristics - the I-V diagram. Hope this helps a bit.
P.S. Burning LED smells really badly...
#10
Posted 08 November 2010 - 11:41 PM
P.S. Burning LED smells really badly...
Thanks for that wonderful information. Though, I'll leave the diagram as it is since all LEDs are different, and hopefully people read your very detailed explanation above. If you make a diagram with all those safety features included you're welcome to post it here, I can even attach it to this thread, with proper credits given of course.
Thanks again
#11
Posted 27 February 2011 - 03:47 AM
#12
Posted 27 February 2011 - 03:50 AM
Hi,
When I create new PWM I receive a Exception, Anybody knows ?
Thanks!
type the erro message in here, maybe i can help. OH and only pins 5 6 9 and 10 are PWM.
#13
Posted 27 February 2011 - 04:01 AM
type the erro message in here, maybe i can help. OH and only pins 5 6 9 and 10 are PWM.
OZ, mine is FEZ Panda, it has 6 PWM IOs, are 5,6,8,9,10 and maybe the 7.
Look the exception in attachment;
Thank you in advance.
Attached Files
#14
Posted 27 February 2011 - 04:15 AM
OZ, mine is FEZ Panda, it has 6 PWM IOs, are 5,6,8,9,10 and maybe the 7.
Look the exception in attachment;
Thank you in advance.
Hi Gandarez,
Let's see if we can get you started on the right path...
I believe that you need to switch your pin assignments over to the ones GHI uses for the NXP chips. And then manually cast their Pins enumerations to the Cpu.Pin type using (Cpu.Pin).
Here's a link to GHI's forum. You may be able to get insights there (and I believe they have the reference design schematics available as well).
Chris
#15
Posted 04 July 2012 - 03:20 AM
#16
Posted 04 July 2012 - 06:50 AM
Guys,
I could use some help. We've built a netduino project similar to this one. But it doesn't work. I took this sample code and tried it too, doesn't work.
I grabbed a couple of AA batteries and put them in series to generate 3volts, then touched the contacts to my led to see if it's broken, and it works, but only if I reverse the polarity from what's in the diagram. What am i doing wrong?
I was connecting the negative side of the battery to longest lead (common) of the RGB LED. That won't light it up, but it will if I reverse the connection and put the positive to the common.
Have I done something wrong?
Rob
I think you've got a common anode LED. There is nothing you're doing wrong, just put the common lead into the 3V# instead of GND. this will also make it so SetDutyCycle(0) will turn them on, and SetDutyCycle(100) will turn them off. so its reversed.
#17
Posted 15 December 2012 - 06:27 PM
#18
Posted 17 December 2012 - 11:32 PM
The Microsoft.SPOT.Hardware.PWM class constructor requires four arguments.I'm beginner of NetDuino Plus2
I have a error when I do your source code:
Microsoft.SPOT.Hardware.PWM ne contient pas un constructeur qui accepte des arguments 1.
http://msdn.microsof...y/hh399616.aspx
You'll need to add period/duration or frequency/dutycycle and then set "invert" to bool, for a total of four agruments.
These arguments' values will be used as the starting PWM configuration when you call PWM.Start().
Does that help get you on the right path?
Chris
#19
Posted 21 December 2012 - 11:24 PM
#20
Posted 22 December 2012 - 08:08 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users