Shop OBEX P1 Docs P2 Docs Learn Events
An LED to Monitor an Output — Parallax Forums

An LED to Monitor an Output

SailerManSailerMan Posts: 337
edited 2007-11-25 09:13 in Propeller 1
Quick Question... I have an SX48 attached to a Motor Controller IC 1 pin is PWM and two pins to control the Direction.

What I want to do is when Pin 1 (Direction CW ) Goes High it Lights an LED and Pin 2 (Direction CCW) Turns off an LED and Vise Versa, I am thinking........, is it just as simple as A resistor - LED - Ground?

Maybe to a Transistor .

Will this interfere with the input of the motor controller?

Eric

Post Edited (SailerMan) : 10/10/2007 4:15:50 PM GMT

Comments

  • HarleyHarley Posts: 997
    edited 2007-10-10 16:52
    Depending on how 'high intensity' the LED is, YES, that should work.

    I'm assuming it is the Prop rather than SX driving the LED/resistor. Less than 10 ma should light modern LEDs; older vintage, some are quite dim.yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-10-10 16:54
    Just wire the LED in series with a current limiting resistor to ground, with the anode end connected to the pin.

    R = (Vdd - Vf) / Id

    R = value of your current limiting resistor
    Vdd = 3.3V
    Vf = forward voltage drop of your LED (depends on color)
    Id = 20mA or so

    Hope this helps

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • SailerManSailerMan Posts: 337
    edited 2007-10-10 18:47
    I'll just have to make sure that the Resistor and LED don't drop too my voltage that causes it not to trigger the Motor controller.

    Thanks for the tips

    Eric

    PS This should have been in Sandbox forum... Sorry.
  • RaymanRayman Posts: 14,162
    edited 2007-10-10 18:55
    I like Oz's circuit:
    http://forums.parallax.com/showthread.php?p=679578

    because it can be used whether the pin is an input or an output...· Instead of going to a switch, you could just have it go to your controller.
  • SailerManSailerMan Posts: 337
    edited 2007-11-24 21:00
    Basically, I need a circuit that doesn't load down the circuit.. I want the LED to light when the pin goes high but does not draw much current from the SX28 or Stamp. I'm Thinking a FET because it's voltage controlled with high input impedance... I don't have any to try this out with.. Does anyone have insight?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-24 21:09
    SailerMan,
    An FET is a good choice for the reasons you mentioned. A switching transistor will work too if you limit the input current. The 2N2222 has a gain of at least 75, so would need only 300uA to have more than enough drive for an LED. A base resistor of around 10K should work.
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-25 09:13
    @Sailerman:
    Your pins 1 and 2 for controlling the direction will most unlikely draw any noticeable current, so it should be possible to sideline some for the LED. The Prop can produce upto 40 mA, the SX most likely 20+ mA.
    However note that the max voltage will be reduced when drawing this max current out of a pin! This can be an issue with 3.3V devices, where it can esily drop below 3 V which seems to be the limit for motor controllers....

    There are so called "low current" LEDs which are a little bit "dim" compared to the ultra bright LEDs we get accustomed to, but will do fine for any sensible application... "Low Current" means 2 to 3 mA, i.e. needing a resistor of 710 Ohms for 3.3V and 2.2k for 5V.

    I myself would waste 10 mA (and spend 25 Cents) , connecting a two-wire DUO-LED (red/green) - and a 100 Ohms resistor - just between pins 1 and 2... As the SX is 5V I think, you should take 330R or 470R with it...


    ---
    "Low Current":A "low current" LED has the same price as any standard LED. How does this work? The semiconductor inside is extremely small. Which also means that there is little tolerance for heat dissipation.. They will definitely die @ 10mA, which is the reason careless deSilva does no longer use them... I take an "ultra bright" LED for 15 cents and just run 2 mA through it... same result (though at higher cost..)

    Post Edited (deSilva) : 11/25/2007 9:29:04 AM GMT
Sign In or Register to comment.