im a complete idiot. Help me!

Go To Last Post
52 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone,

I am very new at electronics, I am starting small with a tutorial I found on sparksfun, and I'm trying to learn how to read a schematic and put it on a breadboard.

Well, I hooked up power to the board. I read the between 14.5-15.36 volts that the 9v wall wart is putting out.

Then I successfully placed a 5v voltage regulator into the circuit. And the voltage does drop on the other side of the voltage regulator.

The problem comes with a resistor. I placed both a 330ohm, and a 220ohm resistor on the other side of the 5v regulator, but nothing changes.

If I remove the regulator then I see voltage drops down to 12ish with both resistors.

What am I doing wrong?

PS I am trying to find a camera so I can take a picture of the breadboard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you're not doing anything wrong, the regulator will do everything in it's power to maintain that 5V. The "wall wart" adaptor on the other hand is unregulated, so its voltage will drop as it is loaded. The adaptor will nominally deliver 9V at its rated current.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for the quick reply. Your reply makes perfect sense, but doesn't answer the one question I still have. Why am I blowing LEDs? I have 5 volts, and I put in a 330ohm resistor infront of the 20mA LED, and the LED lights up for spilt second and then nothing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We'd have to see schematically how you've connected things up. My guess is that you are still putting it across your adaptor, as a result you're driving around 30MA through the LED, which will cause it to overheat and burn out.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

here is my breadboard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's hard to see exactly how your circuit is wired. Can you upload a schematic?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you say the resistors are "ahead" of the LED, do you mean in series?

That is REALLY important.It is hard to imagine how you would be burning out LEDs with a resistor in series.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kmr wrote:
It's hard to see exactly how your circuit is wired. Can you upload a schematic?

Kmr,

I don't completely understand yet how schematics translate into prototypes. I've read quite a bit, but I guess it hasn't quite clicked. That's what I was hoping my first experiment would kind of teach me. I will try to put something together though.

I'm not sure this would help, but I will give you a description of whats going on, on the board.

I have a barrel connector at the end of the breadboard. A few spots down from it is a 100uF cap that is *100%* sure placed with the correct poles.

At the end of the breadboard along that rail, is a ground wire running from the ground rail to the GND of the 5v regulator. Down from that is a gnd jumper, then a gnd wire from the ground rail to the gnd of my switch.

I then have a red wire connecting the power rail to the right side input of the switch.

The left most pin of the switch has a red wire from that to the input section of the 5v regulator.

i then have a red wire from the output of the 5v regulator and a black ground wire running to a .01uF cap. Then black and red wires out to the other side power rails.

Moving back down the board I have a 330ohm resistor in place, then I placed an LED (correctly aligned) in the two holes directly below the resistor.

ka7ehk wrote:
When you say the resistors are "ahead" of the LED, do you mean in series?

That is REALLY important.It is hard to imagine how you would be burning out LEDs with a resistor in series.

Jim

Jim,

If I understand my terminology correctly, then yes it is wired in a series circuit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just to make sure: one end of the resistor is going to the 5V supply, the other end of the resistor is going to the LED (anode) and the other end of the LED (cathode) is connected to ground (0V). That is what a series connection means.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

well I can't see any LED in the pictures, but your resistor is going from +5 to GND. If you are placing the LED next to the resistor, then you are placing it in parallel to the resistor, not in series, so the resistor is doing nothing to limit the current through the led.

What you want to do is connect it such that one leg of the resistor goes to 5V, the other leg to one of the other holes in the proto board (but not GND) Then the anode (+ side) of the LED to that 2nd leg of the resistor. Then place the cathode (- side) of the LED to the GND rail.

Some basic notes on the terminology here. Current will flow between VCC and GND. When you place device connecting the two, you create a path. If you connect multiple devices in this way you are creating multiple parallel paths. Hence the name "parallel" connection.

If you place the multiple devices such that there is only a single path, then this is a "series" connection.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

Last Edited: Wed. Sep 3, 2008 - 05:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I beat you to that one, glitch. :D

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

emuler wrote:
Just to make sure: one end of the resistor is going to the 5V supply, the other end of the resistor is going to the LED (anode) and the other end of the LED (cathode) is connected to ground (0V). That is what a series connection means.

No. It wasn't. I had one end of the resistor going into voltage, and one into ground. As I stated in the subject. I'm an idiot!

Emuler, I think you fixed the problem I was having, for some reason my wall wart has stopped working, but as soon as I can get a new one I will test. Thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Blessed are the idiots who know they are idiots, for they shall seek enlightenment ... and then they'll no longer be idiots. How do you think the rest of us started out?

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
then a gnd wire from the ground rail to the gnd of my switch.

I then have a red wire connecting the power rail to the right side input of the switch.

Quote:
for some reason my wall wart has stopped working,

Perhaps I've misunderstood your set-up. A photo looking straight down on the proto board might be helpful. I think you ought to look at the Spark Fun tutorial again.

Do not put a switch from +5 to ground, that is not what you want to do.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I don't completely understand yet how schematics translate into prototypes. I've read quite a bit, but I guess it hasn't quite clicked. That's what I was hoping my first experiment would kind of teach me. I will try to put something together though.

build a house starting with a design drawing.
Same for a schematic then it is realized as a breadboard or printed circuit board.

Without a schematic, I don't think I could make any circuit with more than 3 components work. It's OK even if it's drawn with a pencil on scratch paper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ashon1980 wrote:
kmr wrote:
I don't completely understand yet how schematics translate into prototypes
You can consider your prototype to be the first instantiation of your schematic. Before hooking up any components, it turns out to be a very good idea to have a schematic before doing so. As mentioned, hand-drawn diagrams as just fine. Also, a popular tool for hobbyists is Eagle http://www.cadsoft.de/ as it is free of charge for small boards.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I really appreciate all the answers I have gotten tonight. I have seen some people kind of get slammed on this board for asking dumb questions, and honestly I was a little afraid, but you guys have been great.

I definitely understand what you guys are saying about the schematic. I'm a woodworker, and I never build a project without a diagram. The problem is I am still struggling to see/make a schematic that I can then translate into real wiring. For instance is the schematic I made up for this little project

The question is, does that really represent what I have on my breadboard? or did I draw something completely different than what I made. Make sense?

Lastly, I was eager to put the suggestion made by emuler and glitch to the test, so I found an old wall wart for a linksys router in my closet. It listed on the back 9v/1000mA. The old wall wart (which just stopped working?) was 9v/700mA. The voltage regulator said it was rated for 1.5A, however, when I plugged the linksys PSU into my circuit my regulator started to smoke.

The weird thing about all of it, is that I can't get a voltage reading from the linksys PSU. The old wall wart would read around 14ish volts when I hooked the multimeter up, but I was getting nothing from the linksys.

Any ideas why? I'm completely clueless

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh Lord! Where do I start? :(

Sorry for the freehand sketching in MSPaint. :roll: Haven't installed Eagle yet. :oops:

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi ashon1980

I think this more what you're after :)

EDIT: emuler beat me to it!

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, he seems to be good at that, but thank you both. They are a little different, and each helped me understand more about how to read and create schematics.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's one goodhabit that a lot of schematics creators adhere to: Always try to have your supply rails at the top (VCC) and the bottom (GND) of the schematic.

And some terminology and "theory": C1 and C2 the way you had them will block all DC flowing through the circuit, allowing only AC components of the signal to pass. The therm often used for this arrangement is a "coupling capacitor". Arranging the Cs as emuler and Declan did will let the DC component through the "main path" of the circuit but (often in comination with a resistor, like R1 above, or a inductor/coil) will let parts of the AC component "leak down to ground", and the term would be "decoupling capacitor".

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Coupling and decoupling are words with confusing meaning. You have multistage amplifiers with AC coupling and DC coupling between stages. If one stage causes interference to an adjacent stage, this unwanted coupling is a problem, and the stage must be decoupled somehow. Usually a C to ground as a power supply low pass filter. Maybe DC blocking is clearer than AC coupling when speaking of series caps between stages. I agree caps from vcc to ground are called power supply decoupling caps, because they filter any ripples in the power supply voltage to ground, preventing unwanted coupling between chips/signals. Heaven help any non English speaking person dealing with this subtle distinction that might or might not make any sense when translated.
In the lab at EE school, they told us to design a two stage common emitter amplifier with a gain of 100. They knew it would oscillate especially because it wasnt supposed to. Interesting to watch two types of design at work... guy with nice neat bound lab book calcs required R and C to 3 significant figures, then goes to the stock room and gets the closest 10% R and 20% C. The other guys just shotgun different values willy nilly. Still oscillates. He asks 'What kind of cap do I need to stop it from oscillating?' and the graduate asstant tells him to go get a BFC and hang it on the oscillating node. Some of those guys went to the stockroom and asked for a BFC.

Imagecraft compiler user

Last Edited: Wed. Sep 3, 2008 - 01:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very good, Bob! (You're my hero so far this week.)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know why no one has mentioned the most common analogy for anyone starting electronics. ashon1980, think of electrical current as water flowing in a pipe. All your wires are pipes, current is the amount of water flowing, and voltage is the same as pressure. Think of resisters as thin pipes that restrict flow. Think of capacitors as big buckets that temporarily store water. Think of your LED as something that does work, like a water wheel or something like that. The more 'flow' the brighter the LED gets.

So, your wall-wart is putting out too high of pressure. The regulator reduces that pressure down to 5V. Now the pressure is fine but if we hook the LED to it the flow will be much too high! The pipe is too big. (The 7805 can put out amps and we only need milli-amps). So we neck down the pipe a bit by putting a resistor upstream of the LED.

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice! Except flowing water has momentum. :( But he can ignore that for a while. ;)

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Think of capacitors as big buckets that temporarily store water.

For me, a water capacitor is a barrel with one pipe at each end and a rubber membrane dividing it into two compartments.

A water-diode is a one-way valve.
A transistor is a valve whose openness is etermined by the pressure in a third ppe.'
etc
.
.

Now, for an inductor... A water wheel with a flywheel?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guess how I learned the diode and the transistor
nearly 40 years ago:

(Remembering another thread:
This is the water-analog, don't confuse with:
analog-water vs. digital-water :lol: )

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I always remember the comments Richard Feynman made about the water analogy. He hated it and all other such analogies that are made in science. They are not perfect so they distract from real understanding. However what Dr. Feynman didn't understand was that you have to crawl before you walk. Crawling is the wrong way to walk. Who crawls after they learn to walk? Crawling only has minor correlation to the actions required to walk yet we do it anyway. Why? because if we tried to walk right off the bat we would never get there.

Yes, emuler, water has momentum and although electrons have momentum too the analogy is broken. Also, Johan pointed out, the bucket analogy isn't perfect either. A leaky bucket would be the next step and then maybe the barrel/diaphram version. But the point is that we must crawl before we walk and walk before we run.

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Who crawls after they learn to walk?

There speaks a man who's never enjoyed 8 pints of Guinness !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sgomes wrote:
I always remember the comments Richard Feynman made about the water analogy. He hated it and all other such analogies that are made in science. They are not perfect so they distract from real understanding.
I am surprised by this since IMHO virtually all physics is 'understood' by analogy first which eventually leads to the math. Look at the wave and particle nature of light, it has neither property as we experience them every day - hit a ball, watch a wave on the ocean - but the physics describe light as one or the other depending on how it is observed. I guess you could only look at the math, but I really can't imagine anyone getting anywhere with physics without analogy.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
A transistor is a valve whose openness is etermined by the pressure in a third ppe.'
current in a third pipe.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

smileymicros wrote:
I really can't imagine anyone getting anywhere with physics without analogy.

Smiley

This was exactly Feynman's complaint. So much time is spent teaching analogies that are not exactly correct. He wanted everyone to just intuitively understand the material the way he did. One of his pet peeves was the particle / wave duality issue. In his mind neither are correct and you only get confused if you try to make the analogy.

Believe me I'm not saying he was right about all this. I'm sure he has a good point but I'm also sure that most of us do not understand physics the way he did!

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kmr wrote:
JohanEkdahl wrote:
A transistor is a valve whose openness is etermined by the pressure in a third ppe.'
current in a third pipe.

Eeeek! Yes, of-course. The pressure thing would be a FET, right?

I am ambivalent when it comes to the good- or bad-ness of these analogies. As far as Feynman and other great physicists go, I once heard a theoretical physicist at our uni saying that them really bright guys often do not use analogies when thinking. They actually think in formulas. :shock: Us complete idiots might benefit from the analogies for a while. As with any model you need to know it's limitations and shortcomings, though.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kmr wrote:
JohanEkdahl wrote:
A transistor is a valve whose openness is etermined by the pressure in a third ppe.'
current in a third pipe.

Unless it's a Field Effect Transistor of course....

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ashon1980

Perhaps this is interesting for you :

http://ourworld.compuserve.com/h...

or just try to find other resources on the net.
Many interesting sites in these times.

A further remark about current and voltage.
In German voltage is "Spannung" and current is "Strom",
but some people have created the word "Stromspannung"
(literally currentvoltage):

http://www.brasilienportal.ch/in...

This totally misleading word is used quite often
these days here ! :shock:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had a quick glanse, ossi. Interesting, but nothing on op-amps. I've never needed them as I'm very much a digital and mainly a software guy. Not very brilliant when it comes to math either. But I am curious.

I have to admit that I've never grasped those op-amps. Buffer, attenuate, amplify... Components all around, backwards, forwards, adding, subtracting, multiplying... Every explanation I've seen gets very intricate and complicated very quickly. A TI "paper" I have spinning around in PDF form on some hard disk is hundreds upon hundreds of pages. I'm curious, but not that curious. Where is that tutorial on the net that will teach me the basic basics about op-amps in one evening?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Johan:
With OpAmps it's very simple:
Always if I think to have understood, the next
circuit makes me an idiot again !
:wink:

At which level should your OpAmp course start ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

At which level should your OpAmp course start ?

Zero, or minus one. In my own view, I'm actually not very good at transistors either. I can see the difference between NPN and PNP in a schematic, and did understand the currents-for-BJTs, voltage-for-FETs issue above. I've tried the Horowitz/Hill section on transistors but they have a strange little fella called the transistor man who turns a variable resistor which in fact isn't a resistor but rather looks like "a poor-quality constant-current sink" and at that time I usually put the end of the barrel in my mouth and ponder if I should end this tormenting feeling permanently once-and-for all.

From time to time I get spoken to with some kind of admiration by someone that has a really hard time thinking in algorithms and digital and stuff. I really know how they feel. I see some of you talk amps and stuff from time to time and I think "what are these guys made of tossing that stuff around as it where nothing more difficult than burping after a beer...".

Maybe I should just stay digital and algorithmic...

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sgomes wrote:
Unless it's a Field Effect Transistor of course....
Excellent point!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

While we're on the subject of water, and transistors, here's a great read that tries to improve the water/pipe analogy that is so commonly used.

http://amasci.com/amateur/transi...

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Johan
with electronics it's perhaps similar to programming.
To learn you have to get your hands dirty and to
make many errors for yourself. That's what
@ashon1980 is now doing, and probably many of us did.
Without own experience it's probably very
hard to follow the books, even if they are as
good as the Horowitz/Hill.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll 2nd what ossi said. I have been reading for almost two weeks now. Anything and everything I can get my hands on. Take the parallel and series circuit. I have read about them many times, and have a decent understanding of the differences between them, but when it came time to wire physical units together, I screwed up.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you should start with simple circuits made
from cheap components. And make as much measurements
as possible. And try to understand the outcomes of the
measurements. I think a regulator, some resistors
and LEDs or normal lamps are a good start, even
if many may think that's too simple. It's not !

Then get some diodes (1N4007 or so) and you
are ready to built simple logic gates.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My favorite waaaaayyyyy before Horowitz & Hill... Forrest Mims When I was a kid I bought every volume of his little circuit books. I think I still have them somewhere. A fantastic way to get started building and playing.

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I'll tell you what. I'm having no luck lately. First my power supply dies, then I screwed up building the kit for my programmer.

So, I was planning on doing some actual experimentation before I started asking more questions, but I'm stuck until the new parts come in.

I don't enjoy feeling like I'm sitting still. So I thought I'd post up this schematic I am screwing around with, and maybe discussing my concepts.

http://s275.photobucket.com/albu...

I know I have a huge chip, and I did it on purpose because I want something that I can continue to add on and modify quite a bit as time goes by.

What my basic plan is, is to have 28 LEDs. Four of them being charlieplexed together. I know that I am under-utilizing the charlieplex, but I have some real concerns about brightness, so I plan to start with 4, and if its bright enough then move to 5 and even 6 maybe.

So, any given moment I will have 7 LEDs on, at 20mA I'll be pulling 140mA of my 200 from the uC, and thats just too much for my taste, thus why I have the transistors in there.

Here are the questions I am hoping to have answered:

1. Firstly, are they wired right in the schematic
2. (This is going to be long) - I have a pack of 2N2222. They have an HFE of 200. Now let me see if I understand this correctly. The uC will be putting out 5volts/20mA when the pin is turned on. I want a resistor to take that mA down to .02 so the transistor will boost the mA back up to 20mA. If I did that would I even need a resistor between the transistor and the LED?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi ashon1980
I can't quite follow your LED schematic, so I'll leave that department for another freak.

But you should AVCC to the VCC rail and AGND to the GND rail.

Unless your are going to use the internal RC oscillator of the mega323, you should include a quartz crystal, of your desired frequency to the XTAL1 and XTAL2 inputs, then two ceramic capacitors (between 18pf and 27pf should work) with one of their legs connected to the GND rail and the other legs connected to the XTAL inputs.

The only other suggestion I have, is to include a decoupling capacitor, maybe 10uf or similar between the VCC and GND rails.

:)

EDIT:
Reread your post. The AVR can directly drive the LEDs. The transistor shouldn't be needed, you can just each of the four LEDs to their own input of the AVR. Of course you still need the 330ohm resistors.

Last Edited: Thu. Sep 4, 2008 - 02:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Declanwilliams,

Thanks for that input. I did a bit of reading about XTAL1 and 2, but it confused me a bit, and decided to hold off on that until I figured out exactly how I was going to wire the LEDs in. What you said there makes perfect sense to me though so that's one less problem I have to deal now :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your LED connections won't work the way they are. First of all, you only have GND connections, and no source of voltage attached to them. Second, the AVR's pin is not delivering 20mA no matter what, it will source as much current as the load will draw, but is only rated to deliver 40mA per pin (to a 200mA maximum per part typically). Drawing more than that can damage the part.

I suggest you "scan" the LED's rapidly, 28 LED's is not that many. As a result you only have one LED on at a time, and can safely drive it directly from the AVR With a small current limiting resistor. LED's while rated at some number of mA continuous, can handle quite a bit more in short bursts. Though for starters I would limit it to what the LED can handle in short bursts. Once you get things working you can start reducing the resistor value until you reach a satisfactory brightness. The LED data sheet will show you how much current it can handle at what duty cycle. With 28 LED's each LED has a 1/28 duty cycle.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also, unfortunately you can't count on hfe of the transistor. It will be different from transistor to transistor and it has a strong temperature dependence. If you circuit above was fixed to provide a power source, you would find you could turn off the LEDs with a hair dryer. Since you are waiting for parts it's time to do some more studying. Google for "emitter degeneration". It sounds like something serious but it's not bad. It's the right way to fix your collector current.

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As glitch noted, since only ground connections are used here this is nothing to source the LEDs. The other problem is BJTs don't work for charlieplexing. Charlieplexing requires something that is capable of three states like a microcontroller pin that can be high impedance, sink and source. A single BJT can only be high impedance and sink or high impedance and source.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not a complete idiot ... after my last spell in hospital, parts of me are missing

C. H.
-------------------------------------------------------------------
It's only waste if you don't use it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

c_hirst!

Two reads (English not my native language). Then LOL!

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]