Shop OBEX P1 Docs P2 Docs Learn Events
circuit question — Parallax Forums

circuit question

ArchiverArchiver Posts: 46,084
edited 2002-11-25 03:29 in General Discussion
does it matter which order you put leds and resistors?

Is p0>---\/\/\--->|---Vss = p0>--->|---\/\/\---Vss ???

also, is the resistor protecting the led or is it protecting the stamp - really
what is its purpose?

mkl


[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-24 20:32
    The order does not matter. However, I like to put the resitor to the
    positive supply then the LED. The reason is incase there is a short in the
    circuit, worst case is you will ground the resistor and the current will be
    limited to .....voltage value / resistor value.

    The purpose of the resistor is to limit the current through the LED and to
    protect the Stamp.

    Resistor selection is done as follows.......A typical LED consumes 2 volts in
    the forward bias direction.
    1) You select what current you want through the LED (say 10mA for ex)
    2) You subtract the LED forward voltage from the voltage used to power the
    LED (for example 5 volts, minus 2 volts, leaves three volts)
    3) Take this 3 volts and divide it by the current you want (10mA) and that is
    your resistor value.
    Therefore 3 volts / 10mA is 300 ohms. 270 ohms will work just fine and give
    you a little more than 10 ma. Remember that the BS2 can only sink (ground)
    25 mA at any one time . Therefore if you want several LED's on at once you
    will need to have the Stamp turn on a transistor that will in turn control
    your LED. This way the stamp needs to supply just a fraction (less than 1
    ma) of the 10 mA the LED needs.

    A simple transistor like a 2n3904 will do just fine. If you need additional
    information on how to hook up the transistor, write back, it is very easy to
    do....


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-25 01:46
    I will take you up on the advise about transistors as I am "expanding [noparse][[/noparse]my]
    outputs." and am likely to light up 32 + leds at once by the time I am done.

    I have several transistors i have desoldered from various old answering
    machines etc. I understand the basics of how the transistor works with its
    3 prongs, the middle being the control. I understand that some are NPN and
    others are PNP. I have no other idea about them and what their numbers mean
    or how to tell how much volts/amps i'm allowed to put on their prongs.

    Also, is this the main application of a transistor - to take the load off of
    the controlling circuit?

    Further, I am wondering about the 74hc595 chip used in expirements 23 & 23b
    of stampworks:

    Expirement 23b daisy chains 2 74hc595s together and controls them with the
    SHIFTOUT command. This is great - 16 outputs for 3 stamp pins!

    The last parameter of the SHIFTOUT command is "bits" and takes a value of
    1 - 16.

    Does this mean that the stamp can only control 2 74hc595s using only 3 pins
    on the stamp or can you daisy chain say 4 74hc595s and it is just that you
    have to use SHIFTOUT twice to set all 32 pins.

    (I would just try this instead of asking but I only have the 2 74hc595s that
    came with the kit.)


    Original Message
    From: <smartdim@a...>
    To: <basicstamps@yahoogroups.com>
    Sent: Sunday, November 24, 2002 2:32 PM
    Subject: Re: [noparse][[/noparse]basicstamps] circuit question


    > The order does not matter. However, I like to put the resitor to the
    > positive supply then the LED. The reason is incase there is a short in the
    > circuit, worst case is you will ground the resistor and the current will
    be
    > limited to .....voltage value / resistor value.
    >
    > The purpose of the resistor is to limit the current through the LED and to
    > protect the Stamp.
    >
    > Resistor selection is done as follows.......A typical LED consumes 2 volts
    in
    > the forward bias direction.
    > 1) You select what current you want through the LED (say 10mA for ex)
    > 2) You subtract the LED forward voltage from the voltage used to power the
    > LED (for example 5 volts, minus 2 volts, leaves three volts)
    > 3) Take this 3 volts and divide it by the current you want (10mA) and that
    is
    > your resistor value.
    > Therefore 3 volts / 10mA is 300 ohms. 270 ohms will work just fine and
    give
    > you a little more than 10 ma. Remember that the BS2 can only sink
    (ground)
    > 25 mA at any one time . Therefore if you want several LED's on at once you
    > will need to have the Stamp turn on a transistor that will in turn control
    > your LED. This way the stamp needs to supply just a fraction (less than 1
    > ma) of the 10 mA the LED needs.
    >
    > A simple transistor like a 2n3904 will do just fine. If you need
    additional
    > information on how to hook up the transistor, write back, it is very easy
    to
    > do....
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-25 01:59
    In a message dated 11/24/2002 5:49:27 PM Pacific Standard Time,
    mklorenz@c... writes:

    > I will take you up on the advise about transistors as I am "expanding [noparse][[/noparse]my]
    > outputs." and am likely to light up 32 + leds at once by the time I am
    > done.
    >
    > I have several transistors i have desoldered from various old answering
    > machines etc. I understand the basics of how the transistor works with its
    > 3 prongs, the middle being the control. I understand that some are NPN and
    > others are PNP. I have no other idea about them and what their numbers
    > mean
    > or how to tell how much volts/amps i'm allowed to put on their prongs.
    >
    > Also, is this the main application of a transistor - to take the load off
    > of
    > the controlling circuit? YES
    >
    > Further, I am wondering about the 74hc595 chip used in expirements 23 &23b
    > of stampworks:
    >
    > Expirement 23b daisy chains 2 74hc595s together and controls them with the
    > SHIFTOUT command. This is great - 16 outputs for 3 stamp pins!
    >
    > The last parameter of the SHIFTOUT command is "bits" and takes a value of
    > 1 - 16.
    >
    > Does this mean that the stamp can only control 2 74hc595s using only 3 pins
    > on the stamp or can you daisy chain say 4 74hc595s and it is just that you
    > have to use SHIFTOUT twice to set all 32 pins. YES you can daisy chain, I
    > don't immediately remember but i think there is a maximum mumber of bits
    > you can send out using SHIFTOUT ( I will check data book on Monday)
    >
    > (I would just try this instead of asking but I only have the 2 74hc595s
    > that
    > came with the kit.)
    >
    >
    >
    Regarding the transistors.....USE NPN transistors. The emitter goes to
    ground, the base will go to the output of your 74 hc 595. Make the
    particular bit high to turn on the transistor which will ground the LED
    resistor circuit.

    Typical values as follows....
    Connect a 10k resistor between the output pin of the '595 and the base of the
    NPN transistor.
    Connect the emitter of the transistor to ground.
    Connect the collector of the transistor to the "ground side" of your LED
    RESISTOR and the other end of the LED RESISTOR to +5 Volts.

    When the bit out of the '595 if high, the transistor will turn on providing
    ground for the LED Reistor pair. Conversely, when the bit is low, the
    transistor is off and the led off.

    Don't hesitate to ask more questions if you need help


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-25 03:29
    On Sun, 24 Nov 2002, Matt Lorenz wrote:

    > Does this mean that the stamp can only control 2 74hc595s using only 3 pins
    > on the stamp or can you daisy chain say 4 74hc595s and it is just that you
    > have to use SHIFTOUT twice to set all 32 pins.
    >
    > (I would just try this instead of asking but I only have the 2 74hc595s that
    > came with the kit.)

    You can hook up as many as you want up to a limit dictated by signal
    strengths, line lengths, etc.

    8 cascaded 595's for 64 outputs are no problem using a PIC16F84, so should
    be fine with the stamp too.

    HTH.
    Mos.

    --
    84 AE86, 90 ST185GrpA, 91 MX83Gr, Sydney, Oz.
Sign In or Register to comment.