As you notice in the first image, there are no resistors involved except for the one by the switch (which I have no idea why there's one there, but I copied it anyway...if someone could shed some light on that that would be great). So I did the same on my circuit.
So my question is - did I goof? Do I need resistors somewhere? I've already made a board and have one set (2 green and 2 red) of LEDs incorporated. What this is is a Restroom occupancy sign system. Each sign will have 1 pair of green and 1 pair of red LEDs. So at any given time, all of the greens will be on or all of the reds will be on. So I have 1 sign already installed and working. I can add resistors to it without much difficulty, so I'm willing to 'fix it' if I need to.
So far, the sign has been running for a couple of weeks and hasn't burnt out on me yet, so I really don't know if I need to do anything, but you guys are the experts.
Any information on what I need to do, would be greatly appreciated.
One important thing that book leaves out is the arduino has an LED tied to pin 13 with its own resistor. So plugging an LED in there isn't a problem with the resistor that on the board. Any other pin and the LED has to have a resistor or you risk blowing the LED. SO you need to figure out what size resistor you'll need. Generally a 220 Ohm will do the job.
BTW that guide isn't a very good starting point. You would be better off running threw the example codes as presented on the arduino home page.
If you want something more structured and easy to follow then have a look at this free book.
One important thing that book leaves out is the arduino has an LED tied to pin 13 with its own resistor. So plugging an LED in there isn't a problem with the resistor that on the board.
OMG dude stop saying that, unless the op has purchased their board years ago and JUST NOW started playing with it, that is flat out wrong information
yes there is a resistor and a led on the current boards, you plug something into the header it does not use any of that as it is in parallel and therefore a non effect
to the op: yes, you need resistors, once the led reaches its magic point where it is full brightness it might as well be a short circuit, shorts burn stuff out, ie your arduino, google "led resistor calulator" and fill in the boxes best you can for a good idea of what you need
the only difference tween your led situation and the switch resistor situation is that a switch creates an instant and full blown short circuit, but you have a resistor in place to keep current draws in check
the led on the other hand follows a time vs effect graph and while not instant, will eventually kill something, and damage may have already occurred
Ok, thanks to both of you for the info and the links. I will start figuring out what kind of resistors I need to use with the LEDs I'm using and 'install' them as soon as I can.
I appreciate the help.
(PS: I purchased my Arduino early this year, and have had a lot of fun learning so far...even though I have tons upon tons more to learn)
OMG dude stop saying that, unless the op has purchased their board years ago and JUST NOW started playing with it, that is flat out wrong information
The book in questions assumes the use of the Duemilanove board.
From Getting Started with Arduino book:
There are many versions of this board; the one we'll use throught this book is the Arduino Duemilanova, which is the simplest one to use and the best one for learning on.
Like i said the book isn't all that great. It illustrates connecting the LED directly into ground and pin 13. In the previous example in the book of Blinking an LED. It mentions that there is an LED on board that is tied to pin 13 but doesn't mention anything about connecting a resistor between the LED and pin 13 or that the on board LED has a resistor tied to it. Thus making it safe to plug an LED directly to the pin. Nor does the Push button example say anything about a resistor. As you can see in the diagram the OP posted it sure doesn't show one there either.
Also the OP clearly shows in his picture he is using a Duemilanove board.
Now i am going off the iPhone/iTouch copy of the book. It may differ a bit from the printed version. I don't know. But that is why i said what i did. If i'm still wrong then so be it. But from what i can tell i gave accurate information as it pertains to this thread.
The book in questions assumes the use of the Duemilanove board.
yes but it was only the very early Duemilanove that had a resistor fitted in series with the header connection. This caused problems when people wanted to use this pin with SPI so it was moved. My version of the same board bought in 2008 would fry it an LED was connected like this.
I don't know, we have explained this to you in every single thread you say it in, it might have been true at one point (years ago when that book was written) but it is NOT now
I don't know, we have explained this to you in every single thread you say it in, it might have been true at one point (years ago when that book was written) but it is NOT now
see you next time
I agree. All of us that respond to newcomers on this pin 13 issue should try and be consistant and give at least SAFE information. The current board and it's schematic shows that there is a direct connection from the pin 13 connector pin to the AVR chips output pin, therefore offering NO protection from over current draw. So even if a newcomer has a 'old board' that had a on-board series protection resistor wired to the pin 13 connector, adding an additonal external series resistor will not do any harm and he/she will not damage anything by having an external series resistor in either case, new or old board.
I don't know why so many new comers have to be convinced that LEDs require current limiting resistors, is there that much bad information out in the Web? Don't answer, I know that answer.
I don't know why so many new comers have to be convinced that LEDs require current limiting resistors, is there that much bad information out in the Web? Don't answer, I know that answer.
I found this thread because I got to this example BlinkWithoutDelay and couldn't figure out how it was supposed to work. I even searched the atmega doc for some magic built into it, but couldn't find any.
ps. At first I put in a link to the BlinkWithoutDelay example but apparently I'm not allowed to put in links since this is my first message at this forum.
What aspect of the Blink Withoput Delay Tutorial confuses you?
The hardware - why you need a resistor in addition to the led or why you need to do things to the port? In this case you might be interested in learning more about current, resistors, voltage, Ohm's Law and how it relates to LED and keeping your poor little Arduino safe from burning out.
or the Software - what's that business with millis() and why isn't delay() needed? In this case, imagine the function millis() the be the equivalent of reading a stopwatch that has been started when the Arduino started and where you can't press any buttons. The variable previousMillis is like a piece of paper where you put down when you started to blink and the function loop is constantly asking like a pesky kid in rear of the car: Are we there yet? That would be this line:if(currentMillis - previousMillis > interval)