My Arduino Uno arived in the mail today (yay ^^) so I'm trying it out right now. I uploaded the standard blink-file to the Uno (the one that makes the LED next to pin 13 blink) and it worked fine. However, I cannot use it to blink a LED on a breadboard. I tried changing pin 13 to 12 in the code and then compiling and uploading it again, but this also has no effect. Turning the LED around doesn't work either and neither does using the the 3,3V or 5V pins. Does a USB-powered Uno provide power at all, or have I missed something?
You will have to show us how you are trying to wire up the led (be sure to use a series resistor) to tell you where you might be going wrong. Assuming you can upload to the board and your using the blink sketch it probably isn't a sketch problem, but posting your actual sketch is also a good idea.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
As mentioned above, this one works for the LED on the board, but not for LED's that I try to connect to the pins.
Another possibly important detail:
When I connect a wire to the 5V, the green power-LED turns off (and disconnecting the wire turns it on again).
Another possibly important detail:
When I connect a wire to the 5V, the green power-LED turns off (and disconnecting the wire turns it on again).
What is the other end of the wire going to? You are somehow shorting the power on the board. Are you sure you are following the wiring correctly. Are you using a resistor in series with your diode? What value resistor?
retrolefty:
Please ignore this suggestion. Wiring a led to pin 13 without a series resistor will short out the output pin and damage the 328 controller chip.
Yes it will. To prove it to yourself measure the current you are allowing to flow through that led. Then note that the absolute maximum safe output pin current is 40ma.
the led only need 20ma to power up; a exemple: if you plug a 500ma usb on a arduino that need 40ma alone, the arduino will take only 40ma from usb. this is basic eletrical enegering.
the led only need 20ma to power up; a exemple: if you plug a 500ma usb on a arduino that need 40ma alone, the arduino will take only 40ma from usb. this is basic eletrical enegering.
I'm afraid your basic electrical engineering needs a refresher course. 20ma is a pretty normal recommended continous current for a LED. However the LED does not determine this value, the current must be controlled external to the LED, normally with a series current limiting resistor. Once a LED has greater then it's forward voltage drop applied it will draw excessive current unless controlled externally.
I really don't care if you get this or not, what I'm trying to prevent is other newcomers reading your post and thinking they don't require the use of series resistors with LED because that will lead to damaged arduino boards and burned out LEDs.
the led only need 20ma to power up; a exemple: if you plug a 500ma usb on a arduino that need 40ma alone, the arduino will take only 40ma from usb. this is basic eletrical enegering.
I'm afraid your basic electrical engineering needs a refresher course. 20ma is a pretty normal recommended continous current for a LED. However the LED does not determine this value, the current must be controlled external to the LED, normally with a series current limiting resistor. Once a LED has greater then it's forward voltage drop applied it will draw excessive current unless controlled externally.
I really don't care if you get this or not, what I'm trying to prevent is other newcomers reading your post and thinking they don't require the use of series resistors with LED because that will lead to damaged arduino boards and burned out LEDs.
Lefty
yes, we not need resistor on arduino pins because of low current, but if we plug a led directly into arduino 5v or other power soucre we need a resistor. finished this.
...what I'm trying to prevent is other newcomers reading your post and thinking they don't require the use of series resistors with LED because that will lead to damaged arduino boards and burned out LEDs.
Agree completely. Robert Faludi does this in his book Building Wireless Sensor Networks. Hooks LEDs directly to the Arduino and also to XBees. Raised my eyebrows a bit. It would seem the pin output circuitry limits the current to a sane level. Maybe it's OK sometimes, maybe it's marginal, maybe it depends on the LED, etc., but I ain't doing it, it's Bad Practice, and should definitely be discouraged. If nothing else, it's dissipating more power inside the MCU than necessary. Does make me curious, though. Luigi, does the MCU get warm? What if you hook LEDs directly to 8 or 10 pins and turn them all on simultaneously?
In the meantime, I'm still trying to find out what I'm doing wrong. I tried connecting the uno to a different USB-port, but this has no effect either.
The exact details of how I connected this:
Jump wire from pin 12 (uno) to pin 1A of the breadboard.
Resister (220 ohm) from pin 1B of the breadboard to pin 1F of the breadboard.
LED from pin 1G of the breadboard to 1H
Jump wire from pin 1J of the breadboard to the GND-pin above pin 13 of the uno.
I have also tried setting this up along the 10th row of the breadboard.
I would like to present a picture, but I have no camera around at the moment.
We had one like this months back on the old forum, turns out he was using a 220K ohm resistor instead of 220 ohms...............
If you don't put a resistor on an LED its the output gate of the Atemega chip that is doing the current limiting, an expensive and fragile substitute for something costs next to nothing.