LEDs without resistor, voltage OK

Hi hackers, I have a little problem with my LEDs. If I calculate the resistor required (2V for the reds, 3V for the blues), and install the correct resistor, they light up very little).
With a multimeter, I get 1.6V at the LED, so too little.

However my specs seem OK, consumption 20mA, 5V emitted by the arduino, I don't understand.

If I test with no load, I have 4.8V at the output of the arduino.
If I test without resistance, the LED lights up well, voltage at 3.3V (on the blue).

I tested other LEDs and another Arduino, same story.
I obviously unplugged everything else from the arduino to test.
And commented out anything unnecessary in the code.

Is it my arduinos in the voltage collapses due to a breakdown, or my LEDS whose specs were wrong (and which are at more than 20mA)?

NB: Arduinos as components come from AliExpress.

Thanks in advance everyone. Kiss.

Did you set the pinMode to output on your LED pins ?


Show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.


In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.

Use the </> icon from the ‘reply menu’ to attach the copied sketch.


Wire LEDs like D1 or D2 as in the image below.

Do not do that! It will damage the LEDs and possibly the Arduino pins.

LED's operate on current not voltage. The voltage quoted by the LED spec is a typical value and changes part to part and over temperature of the LED.

The output of the Arduino has a limit on the amount of current it can supply. As you require more current the output voltage drops until the current is within the capability of the output OR the output overheats and fails.

Unfortunately most of the characteristics are not linear so looking a the specifications is important. For instance of the 328L processor (many of the Arduino boards use this processor) the output voltage vs current is in figure 35-25 (see below),

However usually LED's can be pretty bright when controlled by Arduino. I would suggest you connect LED + resistor directly to your 5V power supply.

For the Reds:
R = E/I Where E = the voltage across a resistor and I = the current through the resistor.

R = (5V - 2V) / 0.02 = 150 ohms. This should be really bright when looking at the LED, but not is you are trying to light a room.

You didn't show your calculations tell us the resistance. ...For a 2V LED at 20mA you have 3V across the resistor so 3V/0.02A =150 Ohms. Is that what you're using?

And if you measure the current you are probably exceeding the specs for the LED and the Arduino! :wink: It might work OK or one or both may eventually die, or the Arduino may become flakey when the LED is on.

A common mistake is not setting the pin to OUTPUT in setup(). pinMode (ledPin, OUTPUT);
If you forget, then the LED is powered through the internal pull up of the pin,
which could be 0.1mA or less.

Pull up (or down) resistor should be somewhere between a few hundred and a few thousand ohm.
You don't have to drive a LED with 20mA.
5-10mA is usually more than bright enough for modern LEDs.
Leo..

And that is of course, the first thought. As Larry first replied. :thinking:

However, given that the effective resistance of the internal pullup is about 45k, then a correctly calculated resistor - 100 Ohms for the blue LED (2 V drop at 20 mA) would make no difference whatsoever to the LED in this case.

I am betting that setting pinMode to OUTPUT was indeed forgotten or mis-coded and the resistor in question is not 100 Ohms.

Of course since neither code nor the result of the supposed calculation was given, we so far do not - cannot - know. :grin:

Hi all ! sorry for the delay.
so,

@LarryD:
I don't know if it's going to be enough, but here are some pictures & my code (everything useless is commented)

// Pins
int mode = 2;
int respawn = 3;
int delai = A0;
int active = 4;
int desactive = 5;
int touche = 6;
int desactiveDuree = A1;

// Variables
int dernierRespawn = 0;

void setup() {
  Serial.begin(9600);

  pinMode(mode, INPUT);
  pinMode(respawn, OUTPUT);
  pinMode(delai, INPUT);
  pinMode(active, INPUT_PULLUP);
  pinMode(desactive, OUTPUT);
  pinMode(touche, INPUT_PULLUP);
  pinMode(desactiveDuree, INPUT);
}

void loop() {
  //digitalWrite(respawn, LOW);
  
  digitalWrite(respawn, HIGH);
  
  // Respawn
  /*if (millis() > dernierRespawn + 1000 + map(analogRead(delai), 0, 1023, 0, 10000)) {  // De 1s à 11s
    dernierRespawn = millis();
    digitalWrite(respawn, HIGH);
    delay(250);
  }

  // Touche (désactivation)
  if (1-digitalRead(touche)) {
    digitalWrite(respawn, LOW);
    digitalWrite(desactive, HIGH);
    delay(10000 + map(analogRead(desactiveDuree), 0, 1023, 0, 100000)); // De 10s à 110s
    dernierRespawn = millis();
  } else {
    digitalWrite(desactive, LOW);
  }*/
  
}

board here :



Do not do that! It will damage the LEDs and possibly the Arduino pins.
Note. :joy:

@JohnRob:
Thank you for all this information & the diagram on the voltage drop, on a previous assembly (this one is only my second), I had no problem with the leds (the same ones). And with equivalent resistances. Here the problem is precisely that with 150Ohm, the lighting is 10% of normal (compared to a direct 5V power supply & with the resistor).
If I connect the + to the 5V output of the arduino, same result, it lights up very badly.
I tested with another Uno card, same thing.
I just went to look for other resistors, I get normal lighting at 100 Ohm, but I find it strange on the internet we see everyone putting 220?

You didn't show your calculations tell us the resistance. ...For a 2V LED at 20mA you have 3V across the resistor so 3V/0.02A =150 Ohms. Is that what you're using?
Yes and it's too much. 100 is fine.

And if you measure the current you are probably exceeding the specs for the LED and the Arduino! :wink: It might work OK or one or both may eventually die, or the Arduino may become flakey when the LED is on.
My father explained to me afterwards that tension and charge were linked but I still have a little trouble with that. :wink:
Well I wouldn't do it again anyway. :grin:

A common mistake is not setting the pin to OUTPUT in setup()
Yes I had suspected when several people asked me that it must be something like that, no my PIN is correctly configured

Of course since neither code nor the result of the supposed calculation was given, we so far do not - cannot - know. :grin:
Yes I should have, I'm not sure why I didn't post at least the code from the beginning, it's stupid. :sweat_smile:

I use this site to calculate the resistance of my leds:

for the blue, it gives me 100 Ohm
for red, 150 Ohm
It's too much for red.
And in general people take a value a little above. There I even have to take a little below to be good.

I no longer have access to the LEDs page, they are 3mm bought on aliexpress, nothing very high-end.

thank you all for your attention and the time you spent answering me, in itself I can put 100Ohm everywhere, but I find it counter-intuitive to have no safety margin, or even to reduce it in the case of red.

(or else the specs of my leds are wrong).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.