NOTE: All components can safely handle temporary current spikes above their maximum ratings as long as the duration of the current spikes are SMALL ENOUGH. Then, I can be 99.99999% certain that I can safely operate the LED at 100mA for some period longer than 10us, probably close to 20us. For instance, with my LED, if I can operate the LED at 40mA for ever (40mA is the steady current max rating) and I can operate the LED at 200mA for 10us. They don't spec those scenarios because the vendor doesn't want to invest time in speccing and supporting the use of their component for corner use cases. The reason is this: Datasheets usually don't specify all of the valid operating scenarios of a component. In REALITY, I could safely use PWM to power my LED with a slower PWM frequency. I would need a PWM frequency 33.3kHz or greater to safely drive my LED (33.3kHz = The inverse of ). 58mA exceed my LEDs steady current maximum of 40mA by 18 mA. During the on-time, the current through the LED will likely rise to around 58mA (58mA = typical current draw at 1.7V of my diode divided by 34%). With a duty cycle of 34% and a power supply of 5V (34% of 5V = 1.7V) will produce an average voltage of 1.7V, I just need to ensure my PWM on time is 10us or less. I can drive the LED with 1.7V (the LEDs typical forward voltage from the datasheet). However, it also has a "Peak Forward Current" rating of 200mA, with a note that the current cannot remain at 200mA for longer than 10us. For example, the LED I have next to me has a max current rating of 40mA. BUT!!! If that information is specced on the datasheet, then you can safely take advantage of it. If that info is not specified in the datasheet, then the datasheet authors were lazy. Your biggest concerns will be how the LED handles a temporary high current and how the output circuit of your chip can handle a temporarily high current. When using PWM in this scenario, you are relying on the ability of your circuit's components to temporarily handle high currents. The frequency of the PWM is important.Things to worry about when taking the PWM approach. Using PWM can work just as well as applying a specific voltage (if you are careful), but there are better ways. 5V PWM at 34% duty cycle to achieve an average voltage of 1.7V)? Should you drive your LED with PWM set to a constant duty cycle (i.e. Why would you drive an LED without a resistor? Simple, to make your circuit more energy efficient. As a matter of fact, driving an LED without a current limiting resistor is often better. However, if you understand how an LED behaves, you can drive it without a resistor safely. I have to say that driving an LED without a resistor is NOT RECOMMENDED unless you know what you are doing. A 20mA indicator LED will often have 30mA as Absolute Maximum Rating. This will definitely damage the I/O port if you do this for a long time. Remember that the datasheet gave 40mA as Absolute Maximum Rating. The graph doesn't go that far, the resistance will rise with temperature, but the current will remain very high. A typical indicator LED will have a nominal current of 20mA, then The LED also has a voltage drop, typically around 2V for a red LED. But not all that will go over the resistor. The voltage you know: Arduino runs at 5V. How do you find out what the resistor needs to be? You do know Ohm's Law? If you don't, write it down in big letters: If you omit it the current limiting has to come from the Arduino's output, and it will not like it. The resistor is there to limit the LED's current. If they say to use a resistor there's a good reason for that! Switch it off, NOW! I have a link to a picture of the Arduino setup below.Naughty! :-). I'm a beginner at working with Arduino so I probably just need a more experienced eye to show me where I have messed up. The program is supposed to turn an inputted number into binary and then display it on the LEDs, on being 1 and off being 0 I have looked it over quite a few times and don't understand why it is not working as it should. I've written a program for Arduino UNO and 3 LED lights.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |