LED brightness help request

Hey i'm new to the Arduino world helping my daughter on a school project and im stumped on a problem with the LED brightness.

The micro controller is a :Adruino Mega 2650 Rev3

Anyway,
We have 14 LED light connected in series in banks of two, each bank connected to pins 30 thru 37 and to ground (no resistors in the circuit)
They are all supposed to flash at one time when the (if) statement conditions are meet it runs fail1 or fail2 scenario, it works but they are all very DIM.

Any help would be greatly appreciated.

void(* resetFunc) (void) = 0; //declare reset function @ address 0
#include <LiquidCrystal.h>  // include the library code:
#include <Servo.h>
#define button_pin A3                    // Defines the Button pin location on the Mega
long randnumber;                         // Defines the maxium numeric size of the random number
int randomnumber;                        // Defines that the random number is an integer(a number,not a letter)
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);  // Initializes LCD library & defines the Mega pins connected to the LCD pins
Servo myservo;                           // Initializes the Servo
int servospos = 150;                     // Start postition of servo
#define ledpin 13                        // Defines the Winner LED pin location on the Mega
#define ledpin30 30  // Defines the Fail Lights Pin
#define ledpin32 32  // Defines the Fail Lights Pin
#define ledpin31 31  // Defines the Fail Lights Pin
#define ledpin33 33  // Defines the Fail Lights Pin
#define ledpin34 34  // Defines the Fail Lights Pin
#define ledpin35 35  // Defines the Fail Lights Pin
#define ledpin36 36  // Defines the Fail Lights Pin
#define ledpin37 37  // Defines the Fail Lights Pin

#define buzzerpin 4   // Defines buzzer pin on the Mega
int buttonState = 0;  // Defines the data type for buttonState and starting value is 0
int count_value = 0;  //   Defines the data type as interger and starting value of 0 for the counter
int prestate = 0;     // Defines the data type as interger and starting value of 0 for the button prestate
int S = 60; // counts down 60 seconds

void setup()
{

  Serial.begin(9600);
  randomSeed(analogRead(0));    // Tells the random number generator to use the Mega's analog pinA0 to listen for electrical noise and grabs a seed number from the noise to start the random sequense.
  Serial.begin(9600);          // Turns on the serial port to use the PC serial monitor for debugging.
  lcd.begin(16, 2);            // Set's up the LCD's number of columns and rows:
  randnumber = random(1, 11);  // Defines the Random Number Range to be between 1-5 (Note:The number listed as the upper range will not be genrated)
  Serial.println(randnumber);  // Print to Serial port for debuging
  lcd.setCursor(8, 0);         // Sets the LCD cursor to column 8, line 0 (Note: line 0 is the top line)
  lcd.print(randnumber);      // Prints the random number to the LCD
  lcd.setCursor(8, 1);       // sets the LCD cursor to column 8, line 1   (Note: line 1 is the botton line)
  lcd.print(count_value);    // Prints the number of button presses since reset
  myservo.attach(3);         // Defines what pin the servo's signal wire is connected to on the Mega.
  myservo.write(servospos);  // Moves the servo to the globaly  defined starting postion[Box closed]so its ready when needed (position -> 30°)
  pinMode(ledpin, OUTPUT);      //defines LED pin is an Output
  pinMode(button_pin, INPUT);   //defined LED pin is an Input
  pinMode(buzzerpin, OUTPUT);  //defined LED pin is an Input
  lcd.setCursor(8, 1);        // sets the LCD cursor to column 8, line 1   (Note: line 1 is the botton line)
  lcd.print(count_value);   // Prints / updates the number of button presses since reset


  Serial.println (S);
  S--;
  delay(1000);
}
void loop ()
{
  if (S < 0)
  {
    M--;
    S = 59;
  }
  if (M < 0)
  {
    H--;
    M = 59;
  }
  if (H < 0) {
    H = 0;
    M = 0;
    S = 0;
  } if (M > 9)
  {

    Serial.println (S);
  }
  else
  {
    Serial.println (S);
  }

  if (S > 9)
  {
    Serial.println (S);
  }
  else
  {
    Serial.println (S);
  }

  if (H > 9)
  {
    Serial.println (S);
  }
  else
  {
    Serial.println (S);
  }

  buttonState = digitalRead(button_pin);  // Reads the current position of the button (pressed/high or not pressed/low )
  if (buttonState == HIGH && prestate == 0) {
    count_value++;
    prestate = 1;  // States if the button is pressed add 1 to prestate value

  }

  else if (buttonState == LOW) {
    prestate = 0;  // States if button is not pressed the prestate value is 0
  }

  lcd.setCursor(8, 1);
  lcd.print(count_value); // Reprints the number of button presses since reset

  // Fail Action if total button press count is less than random number
  if ((count_value < randnumber) && (count_value != 0))  // If the count comparison is less than the random number & not equal to 0 this runs the LED and buzzer fail sequence!

    digitalWrite(ledpin30, HIGH);    digitalWrite(ledpin31, HIGH);  digitalWrite(ledpin32, HIGH);    digitalWrite(ledpin33, HIGH);   digitalWrite(ledpin34, HIGH);   digitalWrite(ledpin35, HIGH);   digitalWrite(ledpin36, HIGH);   digitalWrite(ledpin37, HIGH);
  // delay(1000);
  digitalWrite(ledpin30, LOW);     digitalWrite(ledpin31, LOW);     digitalWrite(ledpin32, LOW);     digitalWrite(ledpin33, LOW);     digitalWrite(ledpin34, LOW);     digitalWrite(ledpin35, LOW);     digitalWrite(ledpin36, LOW);    digitalWrite(ledpin37, LOW);
  //delay(1000);
  digitalWrite(buzzerpin, LOW);
  //delay(500);
  digitalWrite(buzzerpin, HIGH);
  //delay(1000);
  digitalWrite(buzzerpin, LOW);
  //delay(3000);




  //winner Action if total button press count is equal to Random number
  if (!(randnumber != count_value))               // compares random number to the button press count to see if they are the same if there are is opens the box & lights the winning LEDs flashes!
  {
    digitalWrite(ledpin, HIGH); // Turns on & off Winner LEDS
    //delay(1000);
    digitalWrite(ledpin, LOW);
    // delay(500);
    digitalWrite(ledpin, HIGH);
    //delay(1000);
    digitalWrite(ledpin, LOW);
    // delay(500);
    myservo.write(30);//myservo.write(servospos);  //Tells Servo to Opens the box
    // delay(000);
    //lcd.setCursor(8, 1);
    //lcd.print(count_value); // Prints the number of button presses since reset
  }


  else (count_value != 0);
  digitalWrite(ledpin, LOW);  // If the above two if statement are not true do we wait longer IF so how long until it completely resets?
  lcd.setCursor(8, 1);
  lcd.print(count_value); // Prints the number of button presses since reset



  //Fail Action if total button press count is greater than Random number
  if ((count_value > randnumber) && (count_value != 0))  //If the count comparison is greater than the random number this IF statement handles the LED and Buzzer fail alerts!
  {

    digitalWrite(ledpin30, HIGH);    digitalWrite(ledpin31, HIGH);  digitalWrite(ledpin32, HIGH);    digitalWrite(ledpin33, HIGH);   digitalWrite(ledpin34, HIGH);   digitalWrite(ledpin35, HIGH);   digitalWrite(ledpin36, HIGH);   digitalWrite(ledpin37, HIGH);
    // delay(1000);
    digitalWrite(ledpin30, LOW);     digitalWrite(ledpin31, LOW);     digitalWrite(ledpin32, LOW);     digitalWrite(ledpin33, LOW);     digitalWrite(ledpin34, LOW);     digitalWrite(ledpin35, LOW);     digitalWrite(ledpin36, LOW);    digitalWrite(ledpin37, LOW);
    //delay(1000);

    digitalWrite(buzzerpin, LOW);
    //delay(500);
    digitalWrite(buzzerpin, HIGH);
    //delay(1000);
    digitalWrite(buzzerpin, LOW);
  }
}
//resetFunc();  //call reset


pinModes for the LED pins?

Please don't use single letter variable names - this isn't 1970s BASIC.

Fix that too.

Welcome to the forum

Why not ?

Pins default to INPUT unless you use pinMode() to set them as OUTPUT. Are all of your LED pins set to OUTPUT ?

You do know why no resistors will be an issue?

Why not do a Pinmode, output for the LED GPIO pins?

In simple terms:
You can't put two LEDs in series and connect it to a mega pin, it WON'T work and you will probably damage the mega.

You can only put ONE LED with a series resistor to limit the current to 20mA or less.

Given the 200mA total limit, 14 LEDs at 14mA each is 196mA.

Calculate the resistors for 14mA (or less) and put the LEDs in parallel-pairs, each with their own resistor.

10mA is probably "bright enough" and with two in parallel you won't exceed the 20mA per-pin recommendation.

Our eyes are proportional/logarithmic so 10 mA is only perceived slightly dimmer than 20mA. LEDs also vary in brightness, so an LED with more brightness is another option.


...LEDs (like all diodes) are non linear. As the voltage goes-up their resistance goes-down. Ohm's Law says when voltage goes up current goes up, and when resistance goes down current goes up.

So if the voltage across an LED is a little too high the current can get WAY too high and the LED or whatever is driving it can burn-up! (Or other "bad things" can happen.)

If the voltage is a little too low the current goes WAY down and the LED gets VERY DIM. With devices in series the voltage is divided so that's probably why your LEDs are too dim...

By using a series resistor to control the current, the voltage "magically falls into place" and everything is good!

High power LEDs (1W or more) normally use a special constant-current driver because resistors waste power, and you need a high-power resistor, etc. But that's complicated and expensive and with low-power LEDs we aren't using much power anyway so a resistor is usually the best solution.

That equals eight pins, not seven.