Shop OBEX P1 Docs P2 Docs Learn Events
LED Active Low — Parallax Forums

LED Active Low

microcontrollerusermicrocontrolleruser Posts: 1,194
edited 2018-04-07 06:38 in BASIC Stamp
Have this LED board.

http://www.futurlec.com/Output_Test.shtml

LED's are pulled high.

Will use one LED on breadboard first to test this.

What's a Microcontroller covers low and high pull ups.

That's from old TTL days.

Plus you read a high to know circuit is connected. When LED is off.
«1

Comments


  • There's a slight problem.

    Pullup and pulldown section is for pushbutton not led.

    Maybe it will work out somehow.

  • Found this that Mike Green contributed when I was doing this before.

    pull-up or pull-down resistor is used to provide a specific state for a floating I/O pin yet allow some other signal to change it. A pull-up resistor is tied "up" to Vcc while a pull-down resistor is tied down to Ground. The resistor often has a value somewhere between 4.7K to 100K. You might connect a switch from the I/O pin to the opposite voltage from the pull-up/down. If the switch is open, the pull-up/down sets the I/O pin state. If the switch is closed, the opposite state is set. Often a pull-up is used with the switch tied to ground. The I/O pin state is 1 for open and 0 for closed. A 100K resistor might be used where a circuit runs off batteries and the current through the resistor when the switch is closed becomes important. A low value resistor (4.7K or 10K) might be used when the switch is far from the I/O pin and you want to swamp noise on the wiring with the higher current through the resistor and switch.

    That should be enough info to build circuit with one LED and read values first.

    Then it gets messy with pushbutton pulled up or down. Oops. Just realized they are two separate operations.

    Okay. So not so messy.Just take it one step at a time.

  • Going to use Stamp 1 Project Board.

    PINS directive looks simpler than Stamp 2 routine.

  • It works.

    Write to DIRS and PINS

    Read with % and DEBUG.


  • Here's the code.
    ' {$STAMP BS1}
    ' {$PBASIC 1.0}
    
    DIRS = %00001111
    PINS = %11111111
    
    
    DEBUG %DIRS
    DEBUG %PINS
    
    END
    
  • Do you have a schematic of the board?
  • microcontrolleruser,

    You mention pull-ups and pull-downs but what you are really talking about is "active-high" or "active-low".

    Active-high means the device is active when there is a high value (1) or a positive voltage.

    Active-low means the device is active when there is a low value (0) or no voltage (connected to Ground).

    As Mike Green mentioned pull-ups and pull-downs are used to ensure that an input gives a reliable reading.
    Input pins "float" or they follow whatever voltage is placed on them so even noise or voltage spikes will change them.
    A pull-up or a pull-down will hold the input pin at a known state and the high resistance values allow an external device to easily change the pin's state.

    Looking at that output board and the description, it appears the LEDs are active-high inputs which is how LEDs are normally used on the BASIC Stamp.
    You would connect end of each LED to an I/O pin and the other end to Ground (Vss).
    Then the LED would light up when a High or 1 was output and turn off on a Low or 0.

  • 'Do you have a schematic of the board? '

    Have plenty of paper copies.They came with each thing we got from them.

    Let me look through their emails for .PDF datasheet.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-04-06 23:14
    Genetix Thank you

    I think they are pulled high.

    Will find data sheet to post and settle it.

  • Cannot find .pdf online.

    Will look through emails again. Not 100% sure they ever sent that .pdf

    Looking at schematic.

    It is pin/560ohm resistor/led and then all tied to VCC.

  • ' {$STAMP BS1}
    ' {$PBASIC 1.0}
    
    DIRS = %11111111
    
    PINS = %00000000
    

    I ran this and LED came on.

    Is it safe to change pin 1 to a 1 or will that cause a short?

    Idea is to turn LED off.

  • Went ahead and ran it.

    0000 0010 mov to dirs

    LED stayed off.

    No short or blue smoke!
  • microcontrolleruser,

    How did you hook up the LEDs to the Stamp?

  • LED-VDD to breadboard row

    resistor-breadboard row to Pin 1
  • microcontrolleruser,

    It sounds like you wired it for active-low since you have power on one side and the Stamp on the other.
    0 or Low would turn it on and 1 or High should turn it off.

    The cathode of the LED should always be connected to the Ground side of the circuit, which in this case will be the Stamp.

    If you connect the cathode end to Vss (Ground) and the other end to the Stamp then the LED will be active-high.
    The I/O pin will supply power to the LED when a 1 or High is output.

    There should be a notch, line, dot, or some other marking on the LED for the cathode.
    Every now and then you might find that an LED was installed backwards.

    Some multimeters will light up an LED on the diode setting.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-04-07 05:35
    Next step is to connect LED output board in place of single LED.

    Here's 10 pin IDC connector pinout.

    Top to bottom.

    0 1

    2 3

    4 5

    6 7

    5+ 0v

    Pin 1 on connector is not marked.

    How do we figure that out?

    Last time used 5 volt battery box to figure it out.

    Going to mark Pin 1 this time.Duh!


  • Here's link to Gravitech version.Different LED's but same wiring. No schematic.

    http://site.gravitech.us/MicroResearch/TEST/MR-TEST-10P-8LED/MR-TEST-10P-8LED-Manual.pdf

    It does show 10 pin IDC socket though.

    How to we test this to find top and bottom.Locator notch only helps when you connect with cable.

    We're going to use jumper wires.

  • Figured it out.

    10 pin IDC connector is upside down on board.

    If you go by lettering on board.

    We connect 5v to VCC pin and then all LED's can be lit by grounding them.

  • Changed the title.

    This LED test board has no pull up resistors on it.

    It is active low that's all.

    Like Genetix said.

    Next is connecting test board to Stamp 1 board.

  • It worked!

    Can move from pin to pin on Stamp and change where 0 is in PINS.Then it lights up.

    Moved 0v jumper to 0 through 7 LED's on board They all work.
  • Yes, it seems to be the case. Active-low LED outputs. Not as intuitive as active-high, however many controllers can sink more current than they can source on the I/O pins, so that may be why it is set up that way.

  • 'Not as intuitive as active-high, however many controllers can sink more current than they can source on the I/O pins'

    No. Not very intutitive.

    Ah.Got it. Easier to put out a logic 0 than a logic 1.

    That makes sense.

    Use less power to the mcu and still control things or more of them.

  • It's usually more intuitive on a microcontroller to turn something on with a 1, not a 0. But a low output can sink more current. Interestingly, if you leave the output low (0), you can also turn the LED on/off by changing the direction register for that I/O pin.
  • kwinnkwinn Posts: 8,697
    It's usually more intuitive on a microcontroller to turn something on with a 1, not a 0. But a low output can sink more current. Interestingly, if you leave the output low (0), you can also turn the LED on/off by changing the direction register for that I/O pin.

    Same is true if the LED is wired so it is turned on by a high.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-04-07 14:24

    That's a handy tip.

    Next thing to do is test pulled high push button test board.
  • microcontrolleruser,

    LEDs don't use pull-up or pull-down resistors.
    Those resistors limit how much current the LED gets since LEDs usually have a maximum of 20-25 mA.

    When I younger I burnt out an LED by running it directly from a 9V but it didn't die instantly.

    The way you describe the 10 pin connector makes it seem like you can wire up the LEDs as either active-high or active-low.
    That make sense since a Chris said older micros could sink more current than they could source.
    In the old days the only way to use an LED was to use the micro to control the Ground pin.

    Also as the voltage changes or if you want to save power, the current-limiting resistor value needs to change.
    R_led = (V_source - V_led) / I_LED
    V_led is the voltage drop of the LED and I_LED is the current that you want the LED to see.
    LEDs will start to light up around 3-5 mA but there are super efficient LEDs that will be bright at this low of a current.

  • 'LEDs don't use pull-up or pull-down resistors.'

    Affirmative.I was confusing schematic of some other boards we have from them with LED board schematic.

    It will all be clear when I post schematic.It's one sheet with 4 or 5 schematics on it.

    I emailed a request for a PDF of it.I thought they had sent one along with something else.

    I looked through emails from them one time and I couldn't find it.

  • 'The way you describe the 10 pin connector makes it seem like you can wire up the LEDs as either active-high or active-low.
    That make sense since a Chris said older micros could sink more current than they could source.
    In the old days the only way to use an LED was to use the micro to control the Ground pin.'

    The LED board has a common VCC which on Parallax boards means unregulated power in.

    .When I first looked at it I was expecting common ground.So a high signal would turn on LED.

    This hardware is older stuff.I love it! So yes.It follows the old rules of using 0 volts to make things happen.
  • kwinnkwinn Posts: 8,697
    'The way you describe the 10 pin connector makes it seem like you can wire up the LEDs as either active-high or active-low.
    That make sense since a Chris said older micros could sink more current than they could source.
    In the old days the only way to use an LED was to use the micro to control the Ground pin.'

    The LED board has a common VCC which on Parallax boards means unregulated power in.

    .When I first looked at it I was expecting common ground.So a high signal would turn on LED.

    This hardware is older stuff.I love it! So yes.It follows the old rules of using 0 volts to make things happen.

    Careful now, if the leds are connected to Vin and that voltage is more than a couple of volts higher than the regulated voltage to the micro there may be no way to turn the led off if it is connected to an I/O pin on the micro.

  • Will do.

    I think it is a matter of what people consider VNN.

    Pretty sure the makers of board expect you to put 5v to.



Sign In or Register to comment.