My LED's need more power!

Hi, long time no post!

Ok so I have not messed around with my Arduino Duemilanove for a while now since I have been busy, however tonight I dusted it of and have started on a simply task. But I am a little stuck already! :)

Ok so the idea is that I have a potentiometer attached to my Arduino which has a value that ranges from 0-1023 and the value that it is on determines whether a red, yellow or green LED is lit. Ok so I am ok with the coding and so far have got to the point where the first LED is lit when the value is between 0-160. My problem is that the LED is very dull and so I want to add more power using a 3v power pack. However I do not know how to attach it. I have tried it in a few locations but the first caused the LED to stay constantly lit, the second lit all three LED's and the third caused the all the LED's to light up but the brighness changed depending on the potentiometers position??? Any help would be great! :)

Sorry I can’t help right now, my crystal ball is in the shop. I suppose that if you posted some diagrams I could help without using the crystal ball.

Don

You don't need more "power" you need more "current." If you are only driving one LED (with a current limiting resistor!) and it is very dull you probably forgot to set your pins to OUTPUT.

When asking questions, it is helpful to include diagrams and/or code.

I want to add more power using a 3v power pack. However I do not know how to attach it.

Connecting a power pack directly to the arduino in any way is a good way to damage the arduino, as well as being a totally useless way of powering an LED.

There is no need to use an external power pack to get the current in an LED to be greater than 40mA because the arduino pin can source or sink that much and it is more than most LEDs can take. If you do have to use external power then you MUST use something to drive it like a transistor.

It is likely the LED is dim because you have the wrong value of current limiting resistor, if it is not what James said.

Hi guys, I am really sorry for the lack of diagrams of photos but it was about 3 in the morning when I posted it. :sleeping:

Ok so here is a diagram of what I have so far. Hope it is clear enough!

From your picture i can see that you are not uing a current limiting resitor for your LED's.

This is VERY bad. You risk killing your Arduino board, and the LED's.

You should go to the playground and find an example on how to connect LED's to Arduino.

Its ok I do know how but I admittedly forgot to but the resisters in. Also is it actually called the playground lol?

Ok so I have added the resistors which are 2.0 K ohm each. Below is the diagram showing where I have added them but I have still got very dull LED's?

So Mike was correct, your resistor values are too large. How did you arrive at the 2K value you used?

Don

Also is it actually called the playground lol?

If you do a search for 'Arduino playground' you will get your answer.

Don

No sorry, when I said I forgot to put the resistors in I mean in real life not the diagram and the LED's are exactly the same brightness with or without the resistors in place. Well at least I think they are 2.0 k ohm, I have used my iPhone app to check using the stripes on them. Ok so should I use a 220 ohm resistor or is that the same as 2.0 K ohm? Sorry for being such a noob!

Ok so should I use a 220 ohm resistor ...

If you do a search for 'LED resistor' you will get your answer. Have you ever heard of Google?

Don

Ok so should I use a 220 ohm resistor

Yes

or is that the same as 2.0 K ohm?

No

Thanks Mike I will give a 220 ohm resistor a try. And thanks for making me feel so welcome floresta with your sarcastic answers making me feel so stupid and as if I should give up now. It is always nice to get some positive help when trying out a new hobby.

Ok I now have 220 ohm resistors in place as shown on the previous diagram but still the LED's are very dull?

What happens if instead of connecting them to the arduino pin you take that wire to +5V, are they any brighter?

My board does not have a +5v, just 5v but I am guessing that is what you mean? I have tried it and they are much brighter, but then they will be constantly on and not just on when the coding tells them to be?

My board does not have a +5v,

Yes it does.

just 5v

No it is actually +5V, there is no such thing as 5V because a voltage is only able to be measured with reference to another point. So a point can only be +5V of another point or -5V of another point, to say it is 5V only without a sign has no meaning.

and not just on when the coding tells them to be?

That is the first mention of code in the post. Can you say what it is doing? Is it operating PWM signals to them? Have you set the pins to be outputs in the setup()? Can you write code that keeps them on so you can see if they are as bright? Can you post what code you have?

Sorry I did briefly mention that I had coding in my very first post but I guess I did not explain it clearly. Ok so the idea is that I have a potentiometer attached to my Arduino which has a value that ranges from 0-1023 and the value that it is on determines whether a red, yellow or green LED is lit. So the code is needed to tell the LED’s to light up when the potentiometer is at different values. So far I have only written the code up to where the red LED is lit if the potentiometer is at a value of 160 or less. Below is my code.

int gage = 3;
int redLED = 5;
int yellowLED = 6;
int greenLED = 7;

int gagePosition = 0;

void setup() {
Serial.begin(9600);
}

void loop() {
gagePosition = analogRead(gage);

if (gagePosition <= 160) {
digitalWrite(redLED, HIGH);
delay(300);
digitalWrite(redLED, LOW);
}
}

Sorry , I forgot to mention that I also tried the code without a delay on the LED so that the LED stayed lit but it was still just as dull.