Go Down

Topic: Blink Multiple LEDs on Arduino Board (Read 262 times) previous topic - next topic

lnichl

Very new beginner to Arduino here.

I am trying to make 3 LEDs blink in sequence, but all the tutorials I have found online are using wires that go to a separate board (a bread board?) and the LEDs have been inserted to that instead.

I want to have all 3 LEDs using the pins on the actual Arduino. I have worked out how to do one (Using Ground and pin 13) I just don't know how to make more output pins for the other ones.

Any help would be greatly appreciated! Thank you.


PaulRB

#1
Mar 07, 2016, 03:00 pm Last Edit: Mar 07, 2016, 03:07 pm by PaulRB
There is a reason why you always see breadboards used. If you stick an led into the Uno's sockets and ground, you will damage the Arduino and the led because too much current will flow. You must use series resistors, probably one for each led. Anything between 100R and 500R will be ok.

Paul

lnichl

#2
Mar 07, 2016, 03:02 pm Last Edit: Mar 07, 2016, 03:07 pm by lnichl
Thank you, having done some further research after posting this I have learnt that you are meant to use resistors!

I am actually attempting to recreate work I did in a class, and the instructor hadn't told us this.

I know this is bad practice (!) but how would I do it anyway, as I don't have any resistors?

PaulRB

Don't. Get some resistors. And some wire and a breadboard.

lnichl

Thank you, I do appreciate this.

But I have a class assignment, and I have to show the LEDs in the arduino (as my instructor had shown me in class) This might not be the best thing to do, but it's a one off and I don't have access to a breadboard and resistors!

I'd be very grateful for any help!

ieee488


Thank you, I do appreciate this.

But I have a class assignment, and I have to show the LEDs in the arduino (as my instructor had shown me in class) This might not be the best thing to do, but it's a one off and I don't have access to a breadboard and resistors!

I'd be very grateful for any help!
Your instructor is an idiot if he expects you to be able to do this project without access to a breadboard and resistors.


PaulRB

In that case, plug them in anywhere you want. Just don't plug in the power, usb or otherwise.

Is your next lesson "how to run with scissors"?

lnichl

He really isn't the best, its got to be said! I've taken your advice, and I've managed to borrow a breadboard from someone. I'm hoping I will be able to follow some of the existing tutorials now.

Thank you for your time, Paul.

marco_c

I suggest that you use resistors and explain to your instructor that you did some research on what to do and this is best practice. If you can explain why, that would be even better. He may also learn something.
Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com
Arduino++ blog https://arduinoplusplus.wordpress.com

LarryD

Quote
He may also learn something.
Or get his nose out of joint.
.
No technical PMs.
The last thing you did is where you should start looking.

shawnlg

I have used LEDs without resistors on the Arduino by using PWM.  If you have the duty cycle short enough, the light isn't that bright, and I believe most LEDs can handle the short burst of current.  Plus, the Arduino pins don't put out that much current.

I think it's harder than people think to damage the pins.  I've accidentally shorted out a pin and had it output 5 volts.  It was fine :)

You can use pins 3,5,6,9,10, or 11
Use analogWrite(3,5) to turn on the LED in pin 3
Use analogWrite(3,0) to turn it off.
You can change the second number to make the LED brighter or dimmer.

BTW, you can get clone Arduino nanos for $2 or so, so it's not the end of the world if you try something out like hooking up an LED without a resistor.

You learn by doing - even doing dumb things.
Shawn Gordhamer

ieee488


I have used LEDs without resistors on the Arduino by using PWM.  If you have the duty cycle short enough, the light isn't that bright, and I believe most LEDs can handle the short burst of current.  Plus, the Arduino pins don't put out that much current.

I think it's harder than people think to damage the pins.  I've accidentally shorted out a pin and had it output 5 volts.  It was fine :)

You can use pins 3,5,6,9,10, or 11
Use analogWrite(3,5) to turn on the LED in pin 3
Use analogWrite(3,0) to turn it off.
You can change the second number to make the LED brighter or dimmer.

BTW, you can get clone Arduino nanos for $2 or so, so it's not the end of the world if you try something out like hooking up an LED without a resistor.

You learn by doing - even doing dumb things.

What you do with your hobby is one thing.

This assignment is in a classroom environment which means they should do what is the proper way if you want to eventually call yourself a technician, an engineer, an electrician, or any other kind of professional.




Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy