Led + resistor ?


Closed Thread
Results 1 to 8 of 8
  1. #1

    Default Led + resistor ?

    Hi all,

    i have a home project which is working perfectly in the breadboard.

    However i assembled it in a pcb and the result was a bit different.

    I have made 2 pcbs and they both react the same way ( 2 out of 6 leds do not light up with the same intensity as the other in the middle of the code...but they all light up good in the initialization ).


    The code is the same for the initialization and the rest:
    ex: led1=1 or led1=0

    The 2 things i made diferent from the breadboard are:

    5v generated from 3v (x2 AA bat. ) using a max1724 ( the breadboard version has 5v from 12v using 7805 )

    and

    removed all 10k resistors from the pic to leds to increase led brightness.

    The leds are conected to ports
    led2 var PORTA.6
    led1 var PORTA.7
    green var PORTB.4 ' bicolor led (green)
    red var PORTB.5 ' bicolor led (red)
    led4 var PORTB.6
    led3 var PORTB.7

    The ports that have these strange simptoms are PortA.7 and portB.4

    The pic is a 16f88

    My question:

    Can it be current issues in these ports ? Do these ports have some limitation that can react with the leds ?

    Thanks

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Hi,

    I'm surprised you had any brightness at all with 10 K reisitors; and connecting your LEDs without resistors is probably the only reason you're seeing these results, besides potentially damaging the LEDs, or the pic, or both; use 1 K (or 470 ohms for a brighter display) resistors instead, and that should make your PCBs behave like the breadboard version did.

    Regards,

    Anand

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post

    My question:

    Can it be current issues in these ports ? Do these ports have some limitation that can react with the leds ?

    Thanks
    Hi ruijc,
    The short answer is YES, PIC pin max 25ma, your diodes even less. ardhuru set you straight already as to how to fix that, I am just answering the question.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    ardhuru, Joe S., thanks for your help

    Those were my thoughts also, i just dont understand why only 2 ports ( without resistor ) give a diferent result and the other 4 ( also without resistors ) light up just fine.

    Without the resistor the leds light up brighter as expected, but these 2 ports ( also without the resistors ) just barely light up .

    Maybe there is something in this pic's hardware to produce this behavior.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Maybe there is something in this pic's hardware to produce this behavior.
    Solderless breadboard?
    Move everything up/over a few holes and see what happens...

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Hello Skimask,

    It's on the solderless breadboard that it's working as it should.

    It's on the pcb that i get this strange behavior.

    I'm beginning to suspect that the max1724 is not handling it very well.

    i'm going to simulate on the breadboard the final circuit ( including the max1724 ) and let's see what happens .

  7. #7


    Did you find this post helpful? Yes | No

    Default

    You need to check the data sheet for the specific PIC device you are using. Not all pins are direct drive. Some are only open collector and need pull-ups if you need a high output. Also, what level are you using to turn your LEDs on? The I/O pins will drive a higher current for a low(8.5 mA) than a high(-3 mA). So the best bet is to connect the LEDs to you positive rail to the anode and the I/O pin to the cathode.

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Thanks falingtrea, that is a good idea.

    In fact i was going to change my code to do that by i remembered that one of the ports i mentioned is one bi-color led ( green and red with comon anode ) and the green one doesn't light up.

    This was what i changed :

    PortA.7 and portB.4 added a 2K resistor in series.
    Remaining ( working ) ports...left as is ( meaning...without resistors )

    Result :

    Now all led light up normally !!!

    Still, i have to mention the hardware feature in these 2 ports that produce this behavior.

    I searched the 16F88's datasheet and i could not find anything that could link to this .

    .

Similar Threads

  1. Can I drive a 5v LED without a current resistor?
    By Fredrick in forum Schematics
    Replies: 31
    Last Post: - 11th September 2009, 14:42
  2. Calulating BJT base resistance for PIC led switching?
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th November 2008, 08:41
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. can't even flash an LED
    By bruno333 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th April 2005, 13:27

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts