Shop OBEX P1 Docs P2 Docs Learn Events
programming vss input — Parallax Forums

programming vss input

techgeektechgeek Posts: 12
edited 2009-05-15 04:27 in BASIC Stamp
Hey,
I'm working on trying to get a 3 color LED to function. only problem is it needs 1 positve voltage and 3 neg vss voltages,

Is there a way to make this happen?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-10 22:23
    You need to post a datasheet for this LED. It's not clear what you need from the limited data you've provided
  • techgeektechgeek Posts: 12
    edited 2009-05-10 22:27
    I bought the LED at radioshack.
    Here is the page for it.
    http://www.radioshack.com/product/index.jsp?productId=3020765&tab=summary
    basically, I need 1 positive voltage, and each light color has its own pin, the light runs off of 1 positive voltage, and 3 diff neg inputs,

    please help.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-10 22:54
    This is what is known as a common anode display where all the anodes are connected together and the cathodes are available separately. Connect the common anode (long lead) to +5V. Connect each of the cathode leads through its own series resistor to a separate Stamp I/O pin. Use a 150 Ohm resistor for the green and blue LEDs and two 150 Ohm resistors in series (to make 300 Ohms) for the red LED. By making the I/O pin LOW, you'll turn on the LED. These resistor values limit the current per LED to around 10mA and the total current for the 3 I/O pins (if all three are on) of 30mA which is well within the Stamp's ratings (30mA per single I/O pin and 50mA total per group of 8 I/O pins).
  • techgeektechgeek Posts: 12
    edited 2009-05-12 02:37
    ok, thank you.
    i know i may sound stupid asking this question.
    but, what does it mean when the light goes bright, then slowly dims???
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-12 03:03
    It may mean that there's a problem. If you're running your setup off a 9V battery, your battery may be weakening. If you're lighting several of the LEDs at the same time, the current drain can be at least 30mA. If your power source is relatively high (voltage) like 9-12V, your regulator may be heating up and shutting down over time. The dimming could also be a deliberate function of your Stamp program although it doesn't seem like that's what you're talking about.
  • techgeektechgeek Posts: 12
    edited 2009-05-12 03:05
    ok. it does it through both the stamp and then also by running power directly to the risistors to it.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-12 03:08
    Your description is not particularly useful. Specifically, what's connected to what? What's your power source? A schematic would be helpful.
  • techgeektechgeek Posts: 12
    edited 2009-05-13 01:03
    I apoligize for the confusion, I'm still new to this stuff. I'm also not very good at drawing schematics yet.

    when the tri-color LED is plugged into the homework board. it has 1 470ohm resistor plugged into 1 npn then into one neg leg of the LED. each one is on its own port. (ie p15 controled red, p14 controls green, p13 controls blue.) the red light starts bright then fades, when not using the controller stamp. just testing the cericut on the board, using the always on positive, the red does the same thing, using the battery (not going via stamp) using same setup. the red light of the LED did the same thing.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-13 01:10
    I still can't picture how you have things connected.

    How about starting with what I suggested earlier.

    It's usually best to start with something expected to work, then modify that.
  • techgeektechgeek Posts: 12
    edited 2009-05-13 01:34
    OK. i have tried what you have told me. it works pretty good. im now wondering what about using NPNs to reverse the voltages to the LED?
    Here is the Schematic of what i am trying to do, im needing help figuring out how to use the NPNs correctly, and also what Resistors i need.
    I also still not sure how to use resistors properly....


    any help would be appretiated.
    Thank you all.

    Post Edited (thinkgeek) : 5/13/2009 3:11:57 AM GMT
    960 x 720 - 28K
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-13 03:53
    Assuming these are junction transistors (as opposed to MOSFETs), you have to have a current limiting resistor in the base lead as well as a current limiting resistor in the lead between the collector and the LED. The base resistance could be 1K to 4.7K or so depending on the current gain (hFE) of the transistor. The current flows into the base-emitter diode and the transistor amplifies that to produce the collector current. You want the base current * hFE to be greater than the amount of current needed to flow into the collector.

    There are Wikipedia articles that show how a junction transistor works. Have a look at them and at the links from those pages.
  • techgeektechgeek Posts: 12
    edited 2009-05-15 04:10
    thank you,
    I dont think they are MOSFET's... i have got it to work with a 9 volt battery. by itself. using a 150ohm then switch then npn then 1x150ohm for blue and green then 2x 150ohm for red. now, i'm going to try the basic stamp.



    one more question, does anyone know where i can find how resistors actually work and how to tell where to use certain resistors and when....

    thank you for all your help.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-15 04:27
    The Wikipedia is your friend. Do a websearch for "wiki transistor" or "wiki resistor" or "wiki capacitor" or "wiki inductor", read the article and browse the links provided. You'll learn a lot. Other topics might be "wiki Ohms law" or "wiki series and parallel circuits" or "wiki mosfet".

    The resistor values I gave you were for use with a Stamp and it's +5V output. At 9V, the current will be nearly double that at 5V. It won't damage the LEDs at that current (close to 20mA each LED), but could damage the Stamp. You can't just use the same values under different circumstances and expect everything to work properly.
Sign In or Register to comment.