Super basic question on how to connect LED to a breadboard. Please help!

Point taken. Watch my bike riding here: http://arduino.cc/forum/index.php/topic,81754.0.html

I got this to light up! Learned to use a pot and transistor while doing this project. I love this forum!

Much better! Very good!

Can you make the lamp circuit without using the Arduino? And then see how the Arduino can be fit in?
If you can then there are circuits available to do millions of things, and the Arduino can fit into most all of them.

Have you learned Ohm's Law? If not then do, it entails what I think is the most basic understanding of DC electric. With Ohm's Law you can begin to put numbers to much that you are doing. More lessons become possible.

Welcome to the Next Level again and again, as many times as you 'play the game'.

Some people will laugh but Radio Shack -used to- sell a series of circuit training kits that are even faster and easier than breadboarding. They have many mounted components with coil spring contacts. You bend the spring to make an opening and stick the bare end of a wire in and let go, connection made. Very Mickey Mouse, rather limited, but they worked fast and hassle-free. The larger kits had 80-150 projects in a book with easy to follow schematics to do many things, but what could be done was not limited to the projects. But of course they don't make those any more. Radio Shack used to be a much nicer, more hobbyist-friendly operation.

This is the same that my brother and I had 'back in the day'. And it was no $10 item then!
http://www.ebay.com/itm/100-1-ELECTRONIC-PROJECT-KIT-Build-Radios-Amplifiers-1972-Radio-Shack-/370565701425?pt=LH_DefaultDomain_0&hash=item56476fdf31

I still have a 130-in-one kit from the 80's but a breadboard or two and a real parts collection lets you do far more.

I see much of breadboarding with Arduino examples and projects as an advanced and more flexible version of that. But you have to get your own collection of bits and mount them and more important is finding the 'book' since it is not something bound together right where you can't miss it.

Admittedly I don't know how to make this circuit without the Arduino. If I took out the Arduino I think I know how I would power it. Just take the DC adapter, cut off the connector, and place the ground line and power line into the rails of the breadboard.

That leaves the connection to Arduino at pin A0 for the pot, and pin 9 for the transistor. If I take away the Arduino I wouldn't know where to put the wires that go in pins A0 and 9.

Yes, I wikipedia'ed Ohm's law and understand the basic formula, I = V/R.

I've been to radioshack and I've seen the modern-day equivalent of what you're talking about. But rather than shell out $50-$99 for a kit, I thought I could just take that money and spend it on Arduino and parts and ask questions here.

I might actually get that ebay item you linked. $30 is cheaper than the new ones at RadioShack.

Your lamp circuit -- http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads
You see 3.2? You can ditch the Arduino and transistor amd the wires that connect to them.
External power goes to power and ground directly since it's the -only- power left.
The yellow wire on the lamp goes to the middle leg of the pot and the green wire goes to ground.
Turn the pot adjusts the lamp.
The Arduino is for when you want to add intelligence to adjusting your lamp. That's where 'magic' comes in.

What you need to be able to do with these circuits is follow the flow of power to ground for every part. If you can't do that then you need to learn more. It's critical.

For your ultra-bright led you would need to protect the led from getting too much power even when the pot is turned all the way up and split the power and ground into 3 each to connect. How much resistor in the power line (1 for each line) depends on your external power supply.
A 3V to 3.3V regulated power supply that can provide 600-650 mA wouldn't need any resistors since it would never provide enough current to burn the led out and still make the thing a lot brighter than you'd want to stare at. Uh-huh, you don't -have- to run the led to max and it will have a longer life if you don't.
Mount the led on a metal lamp shade for a heat sink and there's your room lamp.

If it was me, I'd just go with a bunch of regular bright or ultrabright (as opposed to insanely bright) 5mm leds that don't need heat sinks wired in parallel for light. I could wire a cheap chip socket with power on the legs of one side and ground on the legs of the other if I could be sure that power would be just enough volts to not burn my leds up. Then I'd plug the leds into the socket, long leg on the power side, short on ground. If a led does die, it'd be no big deal to pull it out and stick another one in as they wouldn't be soldered in place.
It's more likely I'd be using 5V power and need a resistor on each leg of one side (I choose the power side) or at least the legs that will get leds stuck in (probably every 2 or 3). That would be better anyway since I could set up more than 1 socket and use different resistors on each to plug different color leds in each socket. Oh yah, different color leds need different voltages. Red needs the least, then orange, yellow, green, and blue. White leds need the most.
There's an actual bit of health/psychologic benefit to having a certain mix of colors but look that up. We are made to have blue sky and a lot of yellow in sunlight, ever noticed how gray skies or too much indoor lights influence people? And just FYI, house plants need only red and blue about 4:1 depending on the season, but sunlight for them is still best.


It's mostly about the circuits that I pointed out that Radio Shack kit, but to tell the truth it is a way to wire circuits faster.

OTOH you can buy a lot of small parts through allelectronics.com for $30 even with the $7 shipping... but still the pieces add up. It's very easy to spend over $50 there. VERY easy. I've got a lot of small plastic bags from there and though they aren't filled with certain substances, the electronic parts in them have an addiction all their own!

I like the starter kit here: http://arduino-direct.com/sunshop/index.php?l=product_detail&p=109
But last time I tried, the size and/or weight pushed the cost of shipping way up!
At the same shop they have nice assortment packs that don't add badly to the Hong Kong shipping.

There are other online shops with good assortments tailored for starting out with Arduino, so definitely look around and always, always figure the shipping in.

Don't forget that one way or another you will need a soldering station (iron, holder, solder, flux, sponge/cloth) and good ventilation (flux and lead in them fumes) and a multimeter at some point not far along.

The Radio Shack kit has 1 or 2 values of a number of resistors and a hand full of other parts that is enough to do a -lot- of things but you won't be making anything even semi-permanent with it. Still ot's possible to close the box with project wires in place, but you might want to take the batteries out when you shelf the thing. Having a meter as well would be a real big plus. I can't say how fast but you'll grow out of the thing and still at times miss how easy those springs are for hooking up simple rigs while at the same time not missing the limited parts selection.

To answer a bit about PWM from an earlier post, it stands for Pulse Width Modulation. It's a pretty simple concept: it's where a signal (the pulse) has a set period of time (the width) for which it is active before being shut off (modulation). This event occurs rapidly to create multiple 'pulses.'

In how it would help with fading an LED, each 'pulse' is a signal equal to a certain voltage (in the case of an Arduino, 5 volts). If we are at half the maximum PWM, meaning per instance of a pulse, half the time the pulse is on, and half the time it is not, the LED would light up half as much as it would normally. If we set it to the maximum, then the pulse signal is 'solid' and the LED will illuminate all the way. So we we use the Arduino to cycle back and forth from the lowest to the highest point for the PWM signal, we can make the LED fade.

That's just an extreme nutshell explanation. 90% of the forum could explain it a lot better and in greater detail, but that should at least provide a basic explanation.

-Flame

GoForSmoke,

THANK YOU for the very helpful explanation. I now see the 'flow' of electricity that you refer to. You're like a Jedi master teaching me the ways of the Force.

I see you got rid of the Arduino and transistor...then that leads me to ask, what did I need the transistor for originally?

I know you would go the superbright LED route instead of "insanely bright: route. For my purposes, I just want to light up my dreary 9 foot by 8 foot room with a regular/warm white light. Do you think an array of superbright LEDs are bright enough to light up a room?

And YES, the cost of these little electronic things add up fast. I think I might forego the Ebay kit and buy that beginner's kit you linked to since it's closer to what I'll be working with, and not a Mickey Mouse version of the real thing.

Flame,

I appreciate the time you took to explain that to me. I successfully used PWM on some LEDs to fade them. Although I got it to work, I'm still honestly trying to wrap my head around the concept. I think it will slowly sink in over time. :slight_smile:

Your lamp circuit -- http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads
You see 3.2? You can ditch the Arduino and transistor amd the wires that connect to them.
External power goes to power and ground directly since it's the -only- power left.
The yellow wire on the lamp goes to the middle leg of the pot and the green wire goes to ground.
Turn the pot adjusts the lamp.

Have you actually tried this?

Don

I see you got rid of the Arduino and transistor...then that leads me to ask, what did I need the transistor for originally?

Because he didn't try it before posting.

Don

noobtoarduino:
I see you got rid of the Arduino and transistor...then that leads me to ask, what did I need the transistor for originally?

The transistor is there because you don't want to run the current to power the lamp in that example through the Arduino. The light bulb needs more power than the Arduino pin can take without burning up. The small current from the Arduino is used to control the transistor which acts as an electric valve, allowing more power from the external power supply to flow through the light bulb.
Please note that the transistor only allows as much current as the external supply can provide to flow through the bulb, up to 100%. By removing the transistor you still allow 100% of the external power to flow with only the potentiometer acting as control.
External power flows through the pot to the light bulb to ground and there is your light circuit. When the pot is not turned up full, as that is wired, some of the power flows straight to ground which really you can disconnect that leg of the pot from ground and your circuit will still work and btw, waste less electricity.
Use a meter to check resistance between any two legs on a pot as you turn the dial. You need to use all three when you want to read the value on a pin but that doesn't mean it's the only way a pot can be used. With only two legs connected, a pot is just a variable resistor.

Do I have to test it? Do I have to check that 1 + 1 = 2?

Ok GoForSmoke, I think I understand the concept of the transistor limiting the power to the lamp so it doesn't burn out. In my mind I'm thinking of a dam built to hold back water and only let some water dribble through a little at a time.

The transistor is there because you don't want to run the current to power the lamp in that example through the Arduino.

You don't want it going through the potentiometer either.

... you can disconnect that leg of the pot from ground and your circuit will still work and btw, waste less electricity.

It will waste a lot less electricity after the potentiometer (which is now connected as a rheostat) burns out - and it will burn out the first time you run the wiper up to the top.

Do I have to test it?

No, but you should warn others that it is untested and not guaranteed. Anyone can post anything here, just look at the playground. The problem is that the others read the stuff and think that it is correct.

Don

It depends on the pot, lamp and current supplied. I didn't think to check.
Perhaps that's because I have run low voltage DC light bulbs through pots before without burning anything up.

Perhaps no one should say use a resistor without specifying the wattage rating either. Come to think, I've never smoked a resistor before either but I know it can be done.

I've run examples from the playground and somehow they've worked. I'm just lucky to pick the right ones, I guess.
That includes using a led as a sensor and capacitive sensing though in the bare wire single-pin cap sense one I do understand there's a chance to have static go right into the sense pin.

What playground examples do you object to? There's some lessons to be learned here for sure!
Maybe a dumb klutz like me should get a Ruggeduino and a couple years in electronics tech.

It depends on the pot,

No it doesn't.

Perhaps that's because I have run low voltage DC light bulbs through pots before without burning anything up.

Then you didn't run the pot, really a rheostat, through it's entire range.

What playground examples do you object to?

Here's one that we get all the time. http://www.arduino.cc/en/Tutorial/BlinkingLED

Here's another one that pops up frequently. http://www.arduino.cc/en/Tutorial/ShiftOut

Actually these are worse than playground examples because they are tutorials and they both have errors that can destroy the I/O circuitry.

Here's a playground example. Arduino Playground - LCD4BitLibrary

Don

LOL, I did burn an IR led with current through a pot acting as a rheostat. It's the first and last component I burned up all year. And that pot was a 10 or 25 cent trimmer. IR leds smell funny when they blow. The pot is still fine. Regular leds don't take much, the weaker part failed first.

Come to think of it, I haven't used a small (as in low voltage) light bulb since the early 80's, not counting strings of Christmas tree lights.

I see what you mean and you're right. I should be far more careful. Just because I got away with something however many times doesn't mean I will continue to do so.

If I found a datasheet on a pot I use, it should show me the limits of what it can take, I suppose?

I see 2 problems with the blink example.
One is using a led without a resistor, except that IIRC the one on the UNO pin13 -has- a resistor built in and works out to be some kind of exception. Did they do that just because of Blink?
The other problem is the use of delay() being not just wasteful code but blocking code as well.

I can only guess that in the shift register example, all the power comes through the Arduino and the example implies that it can be extended as desired. I can also guess that you have other objections I am blind to.

On the third one you list, I haven't a clue. Too tired to really look. I just got up but I have sleep apnea and still not got a new mask and machine (long story involving the VA and records) but should have that wrangled out "real soon now", I am told. Waking up dizzy makes problems all it's own.

If I found a datasheet on a pot I use, it should show me the limits of what it can take, I suppose?

Probably not in the form you would like. The problem is that at the top (or bottom) all the current is taken by a tiny portion of the track not over the whole length. It is the current over the whole length that is quoted in the data sheet.

except that IIRC the one on the UNO pin13 -has- a resistor built in and works out to be some kind of exception.

You see you are fooled, pin 13 does not have a resistor built in. It used to do on the very first arduino boards but it hasn't had one for the last five years.

all the power comes through the Arduino and the example implies that it can be extended as desired.

Wrong it's the capacitor on the latch line.

Grumpy_Mike:

If I found a datasheet on a pot I use, it should show me the limits of what it can take, I suppose?

Probably not in the form you would like. The problem is that at the top (or bottom) all the current is taken by a tiny portion of the track not over the whole length. It is the current over the whole length that is quoted in the data sheet.

I do accept that the control circuit for any more than insignificant load does need the transistor and can't take much power. It'd be nice at some point to be able to know just how much. I have enough trimmers that a few can die for the cause if necessary but I'd rather not sacrifice any.

except that IIRC the one on the UNO pin13 -has- a resistor built in and works out to be some kind of exception.

You see you are fooled, pin 13 does not have a resistor built in. It used to do on the very first arduino boards but it hasn't had one for the last five years.

Whatever. I don't remember just how the words went when I was working through those first examples. All I remember was there was supposed to be something special about that led connected to pin 13 on the UNO. I don't like to choose pins without reading docs first just because of crap like that. Now it seems that I can't trust -anything-.

all the power comes through the Arduino and the example implies that it can be extended as desired.

Wrong it's the capacitor on the latch line.

And maybe some day I will know why that's so bad. You do. I don't.

I guess I should stay away from the Arduino site and especially the playground and find a nice safe place to get examples from that don't apply to things that have changed without update or just plain have mistakes that I won't see until it's too late. I can see I've been lucky so far but luck is nothing to depend on. I know a bit of code and have forgotten much more but with electronics I need reliable cook books.

And maybe some day I will know why that's so bad. You do. I don't.

Yes a capacitor when discharged looks like a short circuit so any capacitor on a signal line will draw an infinite amount of current from it. As infinity is a touch over the limit of 40mA where damage occurs it is best not to do it.

I have enough trimmers that a few can die for the cause if necessary

A bit of a beginners mistake. If you try something and it does not result in immediately blowing up the device does not mean it is safe to do it. The only way is by proper analysis of the data sheet.

Don't stay away from the site or watever, just keep your mind open to the fact that what's written may not be the best way or even right, just because some chef published a cook book doesn't mean he's a good chef or that the recipes will work
use this site as just one source on info, not the only