Arduino Starter Kit Project 02 - LEDs not lighting up

Hi,

I'm a new starter to this and after completing project 01 ( and some self made experiments using the switches successfully) I set up the wiring to Project 02 but the LEDs dont light up at all.

I'm wondering if there is a faulty part somewhere as I believe I set it up correctly.

Please could someone kindly provide some guidance?

P.S. I'm pretty busy and rarely get time for myself so hoping to fix this asap if possible. No worries if not, but it may take a while to make some time for this again.

Looks to me like you have the LEDs installed backwards. The side with the flat edge is the cathode.

I checked this too, the short side is connected to the yellow wires, while the long sides are connected to the resistors. Just in case, I flipped them all around and still they dont light up.

Also, to clarify, I'm on the part before any kind of coding takes place. I am using the USB port of my work laptop.

I'm not familiar with starter kit, but if you haven't coded anything, why would the LEDs light up?

Can you try connecting the LEDs directly to 5V instead of the arduino's logic pins and see if they light up then? If they do, then the LEDs are placed correctly and the issue is that you haven't installed code to drive the digital pins to the appropriate levels.

Errr... Arduino won't do anything much without code. What you you mean by that?

My observation: brown-black-orange is 10K Ohms. Too high for an LED series resistor. You will get a dull glow at best. Try 220~330 Ohms.

1 Like

Hi @dacurryhunter95. As mentioned by others, the LEDs will only light up once you have uploaded the sketch to the Arduino UNO R3 board. So just continue on to the "THE CODE" section of the project book. Once you have completed all the instructions in the book, give it another try. Hopefully it will start working as expected after that. If not, just let us know and we'll provide further assistance.

Thanks all, forgive my ignorance as I know practically nothing about coding and have very limited knowledge with electrics in general - I will try completing the coding instructions first and see if this works.

Will update you guys in a few :slight_smile:

Hi guys,

I've done the coding as instructed and uploaded to the UNO - but the LEDs still don't light up. The wiring setup is the same as above.

The code I used is:

`int switchState = 0;

void setup() {

// put your setup code here, to run once:

pinMode(3, OUTPUT);

pinMode(4, OUTPUT);

pinMode(5, OUTPUT);

pinMode(2, INPUT);

}

void loop() {

// put your main code here, to run repeatedly:

switchState = digitalRead(2);

if(switchState == LOW) {

// the button is not pressed

digitalWrite(3, HIGH); // blue LED

digitalWrite(4, LOW); // red LED

digitalWrite(5, LOW); // red LED

}

else { // the button is pressed

digitalWrite(3, LOW);

digitalWrite(4, LOW);

digitalWrite(5, HIGH);

delay(250); // wait for a quarter second

// toggle the LEDs

digitalWrite(4, HIGH);

digitalWrite(5, LOW);

delay(250); // wait for a quarter second

}

} // go back to the beginning of the loop`

Please ignore, I fixed this by flipping the LEDs around again - I didn't return them to original placing after checking the flipped way round earlier

2 Likes

To be honest, we did ignore that. The way you posted your code breaks forum rules. Please read them before you post code again.

Otherwise, glad you got it working. :slight_smile:

Thank you for the help!

Ah, could I ask why the way I posted the coding breaks forum rules? How should I post them if I want coding advice in future?Totally unfamiliar with this so apologies if any offence was done.

Also, question to help further my understanding - if the LEDs were able to light up on the Arduino when connecting in simple series and parallel circuits with one or two switches (as in Project 01), why was coding necessary to have the LEDs light up at all in Project 02?

You don't need ask me. Just read the rules. They are in a sticky post at the top of most sections of the forum. Everyone should read them before posting anything on the forum.

1 Like

Because in project 1 the circuits get their power from between the 5V pin and ground pins of the arduino:

and in project 2, they get their power from between the 5V pin and the digital/programmable/code-controlled pins.

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