"What is a microcontroller" chap 2 questions
ToddH
Posts: 34
I'm going through the "What is a microcontroller?" book. I have 2 questions about the LED test circuit exercise in chapter 2:
1) They have me use a 470 ohm resistor in the circuit. Why 470? Why not 1000 ohm or '??' ohm? Is there a formula that is used based on the 9 volt battery and the LED that I'm trying to light up?
second question:
2) The circuit is laid out as such: Vdd (+) --> Resistor -->LED ---> Vss (-)
If the current flows from negative to possitve, why isn't the resistor between the (-) and the LED rather than the (+) and the LED that is shown? Wouldn't you want the resistance to come as the current is flowing towards the LED (from the negative side)?
Thanks for any help!
1) They have me use a 470 ohm resistor in the circuit. Why 470? Why not 1000 ohm or '??' ohm? Is there a formula that is used based on the 9 volt battery and the LED that I'm trying to light up?
second question:
2) The circuit is laid out as such: Vdd (+) --> Resistor -->LED ---> Vss (-)
If the current flows from negative to possitve, why isn't the resistor between the (-) and the LED rather than the (+) and the LED that is shown? Wouldn't you want the resistance to come as the current is flowing towards the LED (from the negative side)?
Thanks for any help!
Comments
Using ohm's law, which describes the relationship of current (I), voltage (V)·and resistance(R):
I = V/R = I=9V/470 ohm = .019 A or 19mA.·
This is only a 'rough' approximation, since the LED will drop some voltage too.
As to the placement of the resistor, in a series circuit it just doesn't matter on the placement.· The current flow is common to all, and the current is based on the total resistance in the path.· You can't have 100mA rushing to the LED, then only 20 mA leaving the LED to the resistor.
Feel free to experiment with larger resistor sizes and to re-arrange the components.
Good questions, it's nice when people want to know 'why's' instead of just following what the material tells you.
-Martin Hebel
Southern Illinois University Carbondale
Electronic Systems Technologies
http://www.siu.edu/~mhebel
I'm going through the "What is a microcontroller?" book. I have 2 questions about the LED test circuit exercise in chapter 2:
1) They have me use a 470 ohm resistor in the circuit. Why 470? Why not 1000 ohm or '??' ohm? Is there a formula that is used based on the 9 volt battery and the LED that I'm trying to light up?
second question:
2) The circuit is laid out as such: Vdd (+) --> Resistor -->LED ---> Vss (-)
If the current flows from negative to possitve, why isn't the resistor between the (-) and the LED rather than the (+) and the LED that is shown? Wouldn't you want the resistance to come as the current is flowing towards the LED (from the negative side)?
Thanks for any help!
(and·testing my signature updates)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
Electronic Systems Technologies
Southern Illinois University Carbondale
Personal Links - ·Lot of BASIC Stamp info
and
SelmaWare Solutions
StampPlot Pro Version 3 Release 4
Now allows additional controls to be added, or developed!
·
In Fig 2-11 It is my understanding that the LED is spec'd as 20ma and that P14 is outputting 5V....
If this is the case then shouldn't the resistor be 250 Ohm? As 5V / .02 Amps = 250 Ohm?
Is it a typo or is there some black magic going on that I am not quite getting
Ian
Thanks for the replys btw ;-)
I hate grey areas! Thanks
I agree with the other replies. However, you should also keep the sinking/source limits of the BS2 micro controller in mind as well. Especially if you start experimenting with several LED's at once. This is copied and pasted from the BS2 Data sheet:
"General-purpose I/O pins: each can source and sink 30 mA. However, the total of all pins should not exceed 75 mA (source or sink) if using the internal 5-volt regulator. The total per 8-pin groups P0 P7 or P8 15 should not exceed 100 mA (source or sink) if using an external 5-volt regulator."
So now if you use Ohm's law combined with "Fan In/Out specs," it may make more since as to why the Parallax folks are using a higher value resistor in their manuals.
I wasn't aware of those differences! Thanks Mike!
Amanda
I think Mike spelled it out in post #14. Is there still something you do not understand?