Arduino Forum

Using Arduino => Displays => Topic started by: guix on Oct 06, 2012, 01:39 am

Title: How to control the display's backlight in the sketch?
Post by: guix on Oct 06, 2012, 01:39 am
Hello :)

I have Sainsmart's 3.2" display. It's nice but I can't adjust the backlight with code, only manually with the trimmer pot, that is located on the "adapter shield".

The backlight is made of 5 (not sure) LEDs which are controlled by the trimmer pot, which is wired on the 3.3v pin of the Arduino Mega. I have no idea about current required for those LEDs (I have a multimeter, but can't measure because I can't place the sensors, I first need some male-female wires...) but it shouldn't be more than 40mA since it's the max current that can be drawn from the 3.3v pin.

So I thought I could maybe desolder and remove the trimmer pot, and solder a wire where the trimmer pot's output was (the middle pad), to the Arduino pin 8 (or any other PWM pin), with maybe a resistor in between. So I could control the brightness with analogWrite. A picture is worth 100 words:

(http://i.solidfiles.net/64400c12ce.png)


So before I try and fry my Arduino or the display, or both...few questions :)

1) Will it work at all? If not, please tell me why.

2) Do I really need a resistor, if I use this code (obviously not tested, and I'm planning to use the SoftPWM library anyway):
Code: [Select]

#define PIN_BACKLIGHT 8

void SetBacklightPercent(int percent)
{
if (percent > 100)
percent = 100;

else if (percent < 0)
percent = 0;

//(3.3v/5v) * 255 = 168.3
analogWrite(PIN_BACKLIGHT, (int) round(168.3 * (percent/100.0)));
}


void setup()
{               
pinMode(PIN_BACKLIGHT, OUTPUT);     
}

void loop()
{
SetBacklightPercent(100);
delay(1000);

SetBacklightPercent(50);
delay(1000);

SetBacklightPercent(0);
delay(1000);
}


3) Do you have a better solution, which could possibly avoid to desolder the trimmer pot?

Thanks in advance!
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 06, 2012, 01:47 am
Having a datasheet to the display would help you tremendously.
Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 06, 2012, 01:55 am

Having a datasheet to the display would help you tremendously.


Help me for what? And there is no datasheet. The display use a SSD1289 controller, which doesn't control the backlight, that's all I know about it.
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 06, 2012, 01:56 am
Quote
Help me for what? ..., that's all I know about it.


To know more about how to use your devices?
Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 06, 2012, 02:09 am
Your replies doesn't help... Of course I have looked for a datasheet, can't find any, else I wouldn't ask myself how much current are required by the LEDs.

I think I know how to use my device :). There is no backlight control other than the trimmer pot, so I have to find a solution, which wouldn't be written in the datasheet, if there was any...
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 06, 2012, 01:44 pm
Quote
There is no backlight control other than the trimmer pot, so I have to find a solution


With out understanding of what the trimmer does, you cannot have a solution: the trimmer could be outputting a signal that the display uses to change backlight, or it could be the resistance in the backlighting leds....

Getting the datasheet or the schematic is your quickest and surest solution.

Short of that, trace the pcb and experiment.
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 06, 2012, 04:31 pm
Quote
Your replies doesn't help...

He is trying to help.  He is attempting to teach you how to fish.

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 06, 2012, 08:10 pm
Quote
or it could be the resistance in the backlighting leds....


Yes this, I'm pretty sure: the trimmer's input is 3.3V, output is LED-A pin, which probably stand for LED Anode. If I put a wire between LED-A (pin19) and GND (pin 1), the backlights turns OFF.

And to add to that: in the datasheet of the SSD1289 controller, there is not a single word about backlight, however there is code to turn ON/OFF the display, I tried it and does what it says, turn ON/OFF the display, but doesn't have any effect on the backlight.

Code: [Select]

void UTFT::lcdOff()
{
cbi(P_CS, B_CS);
switch (display_model)
{
case PCF8833:
LCD_Write_COM(0x28);
break;

//I added this ------------------------
case SSD1289:
//turn OFF
LCD_Write_COM_DATA(0x07,0x0000);
LCD_Write_COM_DATA(0x00,0x0000);
LCD_Write_COM_DATA(0x10,0x0001);

//only standby mode ON: no visible difference?
//LCD_Write_COM_DATA(0x10,0x0001);
break;
//-------------------------------------
}
sbi(P_CS, B_CS);
}

void UTFT::lcdOn()
{
cbi(P_CS, B_CS);
switch (display_model)
{
case PCF8833:
LCD_Write_COM(0x29);
break;

//I added this ------------------------
case SSD1289:
//turn ON
LCD_Write_COM_DATA(0x07,0x0021);
LCD_Write_COM_DATA(0x00,0x0001);
LCD_Write_COM_DATA(0x07,0x0023);
LCD_Write_COM_DATA(0x10,0x0000);
delay(30);
LCD_Write_COM_DATA(0x07,0x0033);
LCD_Write_COM_DATA(0x11,0x60B0);
LCD_Write_COM_DATA(0x02,0x0600);
LCD_Write_COM(0x22);

//only standby mode OFF: no visible difference?
//LCD_Write_COM_DATA(0x10,0x0000);
break;
//-------------------------------------
}
sbi(P_CS, B_CS);
}



So... If I just replace the trimmer by something else that does basically the same thing (analogWrite), isn't that OK? Then, you could reply to my questions :)
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 06, 2012, 08:23 pm
Quote
Yes this, I'm pretty sure: the trimmer's input is 3.3V, output is LED-A pin, which probably stand for LED Anode.

So the trimmer is essentially a voltage divider feeding the backlight - not a particularly good technique for implementing an LED.

Quote
If I put a wire between LED-A (pin19) and GND (pin 1), the backlights turns OFF.

This is not a good practice, especially for some settings of the trimmer.

Quote
And to add to that: in the datasheet of the SSD1289 controller, there is not a single word about backlight...

That is because the controller is designed to deal with the presentation of information on the LCD itself and the backlight is more or less an add-on to the LCD to make that information more legible.

The trimmer is part of the shield that goes between the display and the Arduino and the apparently non-existent documentation for that shield should explain its operation and perhaps other options.  By now you should have figured out why the distributors that provide good support seem to charge more for their products than those who provide minimal support.

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 06, 2012, 09:00 pm
Quote
Yes this, I'm pretty sure: the trimmer's input is 3.3V, output is LED-A pin,


I agree with the other poster that this is a terrible design. The LED(s) probably suck in a lot of current. For the trimmer approach to work, its resistance has to be fairly small.

Do you know if the wiper goes to the LED or one of the terminals goes to the LED? Essentially you want to know if the trimmer is used as a variable resistor.

Quote
which probably stand for LED Anode.


Yes. That's correct.

Quote
If I put a wire between LED-A (pin19) and GND (pin 1), the backlights turns OFF.


If the trimmer is used as a divider and the wiper is at the top, you have just shorted the power supply.

I think you can use a pwm pin to power the led and software control the duty cycle. That requires some resistance on the led, and some limit on how much current the led can draw. If the timmer is wired in right, you can use it. Otherwise, you can cut the trace and wire in a resistor.
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 06, 2012, 09:25 pm
Quote
Do you know if the wiper goes to the LED or one of the terminals goes to the LED? Essentially you want to know if the trimmer is used as a variable resistor.

The wiper goes to the LED.  It's shown right there in his original post.

Quote
If the trimmer is used as a divider and the wiper is at the top, you have just shorted the power supply.

And you probably burned out the trimmer just before you got to the top.  But it does indeed turn the backlight off, either way!

Quote
That requires some resistance on the led ...

Which should be present in any design including one using the unmodified shield.  There may be one on the PC board that holds the LCD, but don't count on it.

Quote
If the timmer is wired in right, you can use it. Otherwise, you can cut the trace and wire in a resistor.

That is essentially what he proposed in his original post except he planned to remove the trimmer instead of cutting traces.

Don

EDIT:  Wouldn't he be better off leaving the trimmer in place, cutting the trace between the top (right hand end) of the trimmer and the 3.3v pin, and moving his resistor connection over from the wiper to the top of the trimmer?
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 06, 2012, 10:01 pm
Quote
Wouldn't he be better off leaving the trimmer in place, cutting the trace between the top (right hand end) of the trimmer and the 3.3v pin, and moving his resistor connection over from the wiper to the top of the trimmer?


I would actually cut the trace and put in a resistor.

Another approach that requires minimum pcb work is to lift the underside of that trimmer, and connect it to the pwm output. The led is the dimmest when the trimmer is in the middle. This approach may not work if the trimmer's value is too small.
Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 06, 2012, 11:27 pm
OK guys I think I understood what you said :) I think I will just remove the trimmer anyway, since I don't need both PWM and manual control.

But I'm confused: do I really need a resistor if I limit the PWM output to 3.3v (as in my code) ? Knowing that:

- The 3.3V pin is rated 40mA max, same as the PWM outputs,
- When the trimmer is "fully open", there is no resistor between the 3.3V pin and LED-A pin.

So I think I don't even need to add a resistor!

Sorry, I'm still newb to electronics :)
Title: Re: How to control the display's backlight in the sketch?
Post by: Grumpy_Mike on Oct 07, 2012, 12:10 am
Quote
do I really need a resistor if I limit the PWM output to 3.3v (as in my code)

You can't limit the output to 3V3 in software. PWM is always a 5V signal, it is just the on / off ratio that changes.
See this for how it works:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html (http://www.thebox.myzen.co.uk/Tutorial/PWM.html)

You always need a current limiting device when using an LED and a resistor is the simplest one you can have. Anyone who tells you different is wrong.
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 07, 2012, 12:15 am
Quote
The 3.3V pin is rated 40mA max, same as the PWM outputs

That is a the absolute maximum permitted value and you really shouldn't operate there.  There are other restrictions as well depending on what is going on at the other port pins.

Quote
When the trimmer is "fully open", there is no resistor between the 3.3V pin and LED-A pin.

That is a poor design especially if there is no current limiting resistor on the display PC board.

Quote
So I think I don't even need to add a resistor!

It's your display and Arduino that are at risk.  I wouldn't do it.

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 07, 2012, 12:18 am
Quote
You always need a current limiting device when using an LED and a resistor is the simplest one you can have. Anyone who tells you different is wrong.

I was going to say the same thing but then I figured that someone would point out the exception, which would be if one happened to be using a current limiting supply.  Even then the resistor wouldn't hurt anything.

I agree - you should always use a current limiting resistor.

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: Grumpy_Mike on Oct 07, 2012, 12:26 am
Quote
which would be if one happened to be using a current limiting supply.

This is covered by the "current limiting device " part of my statement.  :)
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 07, 2012, 12:35 am
Oops - I missed that.

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 07, 2012, 12:52 am
Quote
But I'm confused: do I really need a resistor if I limit the PWM output to 3.3v (as in my code) ?


PWM 3.3v only means that the arduino is outputing 5v 3.3v/5v = 66% of the time, and 0v 33% of the time.

However, the answer to your question is yes and no.

Yes, you need a resistor for a proper design.

No, you don't need a resistor as the pin's internal limitations in its current capabilities serve as a "resistor", and the diodes are one of those electronic devices that can take a lot of abuses temporarily.

I would put one in myself. But I would encourage you to experiment by not putting one in just to see for yourself.

In case you are asking, I have shorted avr's output pins (when outputting a logic 1) without damaging any.
Title: Re: How to control the display's backlight in the sketch?
Post by: runaway_pancake on Oct 07, 2012, 01:25 am

So I think I don't even need to add a resistor!
Sorry, I'm still newb to electronics :)


Why do they always fight "the resistor"?
Why resist?
Is it "the expense"?

Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 07, 2012, 01:35 am
Okay but here: http://arduino.cc/en/Tutorial/PWM

I can read:
Quote

This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) [...] The result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED.


So I supposed, limiting the PWM as in my code, will output a steady 3.3V. :smiley-zipper: Then, I used a led resistor calculator (http://www.hebeiltd.com.cn/?p=zz.led.resistor.calculator) (the parallel calculator, since I suppose the LEDs of my display are mounted parallel)... which tell me that I need a resistor of 1 Ohm (AKA: I don't even need a resistor), when the input voltage is the same as the forward voltage of the LED, and doesn't matter how much current I enter as the "desired LED current".

Guys, I'm lost...

Quote

Why do they always fight "the resistor"?
Why resist?
Is it "the expense"?


I don't, in fact I planned to add a resistor since the first post. I'm just wondering why I need one when a calculator tell me otherwise.

Put simply, I don't see what is the difference between these two:
Code: [Select]

PWM 66%  ---------> LEDs
PWM 100% ---[R]---> LEDs
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 07, 2012, 02:11 am
Quote
when the input voltage is the same as the forward voltage of the LED


But that's the wrong assumption.

If you look at the page you linked to, the pwm waveform has a voltage output of either 5v or 0v, at any given point. If you were to held a steady 5v to your 3.3v led, it would have burned out quickly.

What pwm is doing to leds is to turn on the leds, abusively at 5v, quickly. Because of pov, the led looks dimmer when the duty cycle goes down.

The nice thing about diodes is that they are very good at taking high peak current for a short period of time  - sometimes 100x or 200x of their rated current.
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 07, 2012, 02:21 am
Quote
when the input voltage is the same as the forward voltage of the LED

In addition to everything in the previous post you have to also understand that:

(1) You do not know what the forward voltage of the LED might be.
(2) Even if you determine what it is for one diode under one particular set of circumstances it would be different ...
  (a) for a different diode under the same circumstances.
  (b) for the same diode under different circumstances.
  (c) for a different diode under different circumstances.

In other words - if you to try to design a circuit to drive an LED with some specific voltage you are doomed to failure.

Did you ever consider why it takes so long to earn an Engineering degree?

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 07, 2012, 04:24 am
Quote
Did you ever consider why it takes so long to earn an Engineering degree?


Ouch. That's harsh.
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 07, 2012, 04:29 am
Quote
Why do they always fight "the resistor"?


Nothing says that you have to have resistors. All you need to know is why you may need resistors and what risks you are running without resistors, so that you can make an informed decision.

Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 07, 2012, 06:17 am
Ok, another try (before I give up :))

(http://i.solidfiles.net/88729819c2.png)


In this exact situation (for now, I don't need to know in other circumstances..), let's say my multimeter show: 20 mA

3.3V, 20 mA, no resistor between Arduino's 3.3v pin and LED-A pin. There may be a resistor between LED-A pin and LEDs, or not, I don't care.

So for 5V, using a PWM output instead of the trimmer, I would just need to add a resistor of value (5-3.3) / 0.02A = 85 Ohm, between the PWM output and LED-A pin.

Am I wrong once again?
Title: Re: How to control the display's backlight in the sketch?
Post by: codlink on Oct 07, 2012, 06:39 am
I've attached what looks like info on that shield including datasheets, manuals, library, and example code.

I found more than one document so I attached them both.  Some are different, some are the same.
Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 07, 2012, 06:49 am
codlink, thanks for trying to help but I already have those documents: there is nothing in them, about backlight :)
Title: Re: How to control the display's backlight in the sketch?
Post by: codlink on Oct 07, 2012, 06:50 am
Eh, ok, I didnt look through them... 
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 07, 2012, 02:02 pm
Quote
let's say my multimeter show: 20 mA


The answer will depend on your multi-meter. If it is a multimeter that reads "average" (an analog meter or an rms meter (not quite but close)), your math then works.

I think you are overthinking this. Put a resistor (start with something safe like 330) in, power it to rail (5v), and find a resistor value that gives you more light than you want, as your pwm will dial back the (average) current later.

Then  you are done.
Title: Re: How to control the display's backlight in the sketch?
Post by: Grumpy_Mike on Oct 07, 2012, 08:29 pm
Quote
Then, I used a led resistor calculator (the parallel calculator, since I suppose the LEDs of my display are mounted parallel)... which tell me that I need a resistor of 1 Ohm (AKA: I don't even need a resistor), when the input voltage is the same as the forward voltage of the LED, and doesn't matter how much current I enter as the "desired LED current".

Because these calculators are very simple minded and do not take into account extremes like you have in that situation.
As well as considering the average current then you have to consider the peak current. This is the maximum instantaneous current that will flow in any given situation. With PWM this peak voltage is 5V no matter what the duty cycle gives you. Therefore you have what 5V will drive through the LED.
This will be limited by the impedance of your source, in this case the arduino pin. However remember that the data sheet says the absolute limit you should draw from a pin is 40mA. Anything at this level or over this level will damage your pin. You might not see that damage immediately or even in a month or two but the circuit around that pin will die sooner than it otherwise would.
In my tests with an arduino I have found that you can get 250mA peak current from an arduino pin, more than enough to damage it and possibly damage any LED connected to it.

Now you can totally ignore the data sheets and do what you want and your individual device may or may not fail immediately, maybe next month, next year or never. But if you take a large number of devices abused in this way some will fail quite soon. Damage is cumulative and the impedance of the output will gradually increase, maybe too slow for you to notice it without making measurements but it will occur.

On the other hand you might think we are all in a conspiracy to make you spend an extra $0.01 on a resistor, funded by the resistor manufacturers. If so I want my cut now from all the unnecessary resistors I have encouraged beginners to use. On the other hand have you noticed that only beginners as this sort of question?
Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 07, 2012, 08:49 pm
But you don't get it, it's not the problem of buying a resistor or not... I was just wondering "If PWM output is set to 66%, as if it was outputting 3.3v, why add a resistor, since it will drop voltage even more so the LEDs won't be at full brightness?"... But now (after re-reading entirely this topic) I think I understood :)

I will do what dhenry said in his last post, and use PWM's max value instead of trying to limit it.

Thank you :)
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 08, 2012, 04:11 am
Quote
since it will drop voltage even more so the LEDs won't be at full brightness?

It just doesn't work that way.  The brightness of an LED depends on it's current.  Similarly, the voltage across an LED also depends on it's current, but not linearly as with a resistor.  You must start by considering the LED current, not the voltage.

Quote
I will do what dhenry said in his last post, and use PWM's max value instead of trying to limit it.

Think of it this way, this technique also protects things in case the PWM output goes to 100% because of an error in the programming.  

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: psteve on Oct 17, 2012, 01:23 pm
I've used 2 diodes 1n4007 insthead the resistor ( series ) and it works great.

I can set pwm beetween tree values = 0 (off) 128 (it doesn't give much light but readable) 255 (max).

The current consumption respectively 86-105-118 mA.

I hope this help

Steve
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 17, 2012, 01:28 pm
Quote
the voltage across an LED also depends on it's current, but not linearly as with a resistor.


When you have some time, try to plot a LED's V-I curve.  You will be surprised. Particularly for high power LEDs.
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 17, 2012, 03:59 pm
Quote
I've used 2 diodes 1n4007 insthead the resistor ( series ) and it works great.

You don't understand the problem.  This is a different way of reducing the maximum voltage applied to the backlight.  The problem is that it is the current rating of the diode that we don't want to exceed.

Once again: if you to try to design a circuit to drive an LED with some specific voltage you are doomed to failure.

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: psteve on Oct 17, 2012, 04:48 pm
:) Hi Don,

I'dont try to design a circuit to drive an LED with some specific voltage, my problem was turn off light (and mA needed).

:) in sainsmart shield with 2 diodes is solved.

Steve
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 17, 2012, 04:59 pm
Quote
Once again: if you to try to design a circuit to drive an LED with some specific voltage you are doomed to failure.


The story is actually far more complicated than that.

Some data:

For 1n4001 (Vishay, diode), If = 20ma @ Vfwd = 0.65v; If = 50ma @ Vfwd = 0.7v (delta Vfwd = 50mv); dynamic Rd = 50mv / 30ma = 1.6ohm.
For CLA1B (Cree, LED), If = 20ma @ Vfwd = 3.05v; If = 22ma @ Vfwd = 3.10v (delta Vfwd = 50mv); dynamic Rd = 50mv / 2ma = 25ohm.

For the same change in Vfwd, the led's If increased much less than a diode's.

Contrary to conventional "wisdom", high power LEDs behave far more like a resistor than a diode.
Title: Re: How to control the display's backlight in the sketch?
Post by: guix on Oct 17, 2012, 05:18 pm

The current consumption respectively 86-105-118 mA.


:smiley-eek: How is that possible, if the PWM pin should not "give" more than 25mA ? And with LEDs OFF, it still use 86mA current? What I don't understand here... can you explain?

Thanks :)
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 17, 2012, 05:27 pm
Quote
Contrary to conventional "wisdom", high power LEDs behave far more like a resistor than a diode.

Is that what we are talking about here?  I associate 'high power' LEDs with those that are becoming available to replace household incandescent bulbs etc.  The LEDs being used in flat screen TVs could well fit into this category as well. 

I would think that any LED backlight that is being driven by an output pin of the Arduino would be classified as low power, and it would behave much like any diode, not like a resistor.

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 17, 2012, 05:30 pm
Quote
I've used 2 diodes 1n4007 insthead the resistor ( series ) and it works great.

I see people regularly drive over 70 mph in 55 mph zones.  It seems to be working great for them as well (so far).

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 17, 2012, 05:34 pm
Quote
Is that what we are talking about here? 


I ran the data at 20ma If.

Quote
I would think that any LED backlight that is being driven by an output pin of the Arduino would be classified as low power, and it would behave much like any diode, not like a resistor.


Pick any such leds and show your data and we can have a chat.
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 17, 2012, 05:41 pm
Save you some time:

VLMx1300 (red, Vishay, LED), If = 20ma @ Vfwd = 1.95v; If = 30ma @ Vfwd = 2.0v (delta Vfwd = 50mv). delta Rd = 50mv / 10ma = 5ohm.

higher Rd for organge (50mv / 5ma) and lower for green.

None of this factors in the output resistance of the avr's (30 - 50ohm for example).

Title: Re: How to control the display's backlight in the sketch?
Post by: floresta on Oct 17, 2012, 11:03 pm
I may be mistaken but it appears to me that you are giving support to those who think that the LEDs that they are using with their Arduinos have a voltage rating (like a light bulb), and if they apply this voltage to their LED it will work properly.

Myself and other contributors such as Grumpy Mike and Liudr have, for several years, been giving advice on why this reasoning is incorrect an why they always need current limiting, usually in the form of a series current limiting resistor, when driving an LED.

Keep in mind that the target audience for the Arduino is not someone with an Engineering background and frequently not even someone with the slightest interest in electronics or microcontrollers.  They are not concerned with the output resistance of an avr etc. and statements such as "For the same change in Vfwd, the led's If increased much less than a diode's" might just as well be written in Zorkonian.  They are, however, interested in getting their LED to light up without damaging either the LED or their Arduino.

The bottom line is one can mess around with PWM, diodes, or some combination, but one should still use a series current limiting resistor with their LED.

Don
Title: Re: How to control the display's backlight in the sketch?
Post by: dhenry on Oct 17, 2012, 11:24 pm
Quote
Myself and other contributors such as Grumpy Mike and Liudr have, for several years, been giving advice on why this reasoning is incorrect an why they always need current limiting, usually in the form of a series current limiting resistor, when driving an LED.


The length an advice has been given should be in no way shape or form supporting evidence for such advice's validity. Or we would still be living in dark ages thinking that the sun evolves around the earth.

Quote
Keep in mind that the target audience for the Arduino is not someone with an Engineering background...


Just because you think someone is "incapable" of understanding the truth doesn't justify your feeding them falsehood. You  just need to figure out better ways to communicate the truth to them.

and I don't for a second buy the argument that the arduino community is 2nd rate when it comes to understanding electronics.

Quote
The bottom line is one can mess around with PWM, diodes, or some combination, but one should still use a series current limiting resistor with their LED.


The bottom line is that the laws of physics are the laws of physics, regardless of how long someone has been perpetuating anything to the contrary.
Title: Re: How to control the display's backlight in the sketch?
Post by: Grumpy_Mike on Oct 18, 2012, 03:07 am
Quote
The bottom line is that the laws of physics are the laws of physics, regardless of how long someone has been perpetuating anything to the contrary.

And you dear Henry dear Henry talk utter rubbish.
It is time you stopped.