8051 developing kit issue

Discussion in 'Embedded Systems and Microcontrollers' started by bobparihar, Aug 22, 2014.

  1. bobparihar

    Thread Starter Member

    Jul 31, 2014
    93
    0
    i am using a 8051 developing kit and i am working LED dancing patterns.

    iam using 8 LEDs each one is connected to a port's single pin. i got achieved what pattern i want.. but the problem is when pattern starts the LED connected to port 1.0 glows brighter always and the other 7 LED's glows at dim light

    if i give high signal(1) to all 8 pins of the port then also other led are glows dim
    where should be the problem is??
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Do you have a schematic?

    Could you outline the program and what "pattern" means?

    I'm no sure if you have 7 poor LEDs and one good one or 7 good ones and one extra bright.
     
  3. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,383
    495
    Generally speaking, the brightness is controlled by current. So the bright led gets lots of current. The dim led gets some current, but not enough to be bright.

    What you could do is adjust the amount of current that each led gets. This is done by using resistors. You put a resistor in series with led.
    Example:
    Connect uC pin to led +leg, connect led -leg to resistor, connect other leg of resistor to ground. You can change the resistances until you find combination that gives you consistent brightness across all 8 led.

    Another thing you can do is change the uC setup. uC is not designed to source a lot of current. Lets say you have led that take 20 mA. You have eight of them. 8*20 mA=160 mA. Is your uC designed to source 160 mA at any given time? To work around this limitation you can sink current into uC. What you do is you use external power supply to provide led with current. So when the uC pin goes low (digital zero), the uC pin becomes ground and there is voltage drop that turns led On and current flow from external power supply to ground, this current flows through the led and determines the led brightness. Again, use resistor in series with led to control the amount of current.
    Example:
    External power supply/battery +pin connected to led +leg, led -leg connected to resistor, resistor other leg connected to uC pin. Probably need to connect external power supply -pin to ground that is common with uC ground.
     
Loading...