Pages: 1 2 [3]   Go Down
Author Topic: Super basic question on how to connect LED to a breadboard. Please help!  (Read 2723 times)
0 Members and 1 Guest are viewing this topic.
Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4769
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Offline Offline
Full Member
***
Karma: 0
Posts: 103
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 

Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
... 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.

Quote
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
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4769
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It depends on the pot,

No it doesn't.

Quote
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.


Quote
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.  http://www.arduino.cc/playground/Code/LCD4BitLibrary


Don
« Last Edit: December 06, 2011, 11:41:09 pm by floresta » Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4769
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33379
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
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.

Quote
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.
« Last Edit: December 07, 2011, 08:04:36 am by Grumpy_Mike » Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4769
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
Quote
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-.

Quote
Quote
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.
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33379
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
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.
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: 1 2 [3]   Go Up
Jump to: