+ Reply to Thread
Results 1 to 6 of 6

Thread: Led Fading Steps

  1. #1
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Arrow Led Fading Steps

    Hi I need to fade an LED using 256 steps. My LED is connected via a 220R resister to the PIC.

    When I give 2V, 20mA to the LED its lighting up very bright.

    My problem is what do I have to write to duty cycle register?

    Do I need to calculate the duty cycle register for 2V or for 5V?


  2. #2
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,805

    Default

    You just vary the duty from 0 to 100%. The output from the pic will be 5V of which 3V will be dropped by the resistor and the other 2V by the LED. The current through the LED will be (V/R) 3/220 amps = 13.5mA.

  3. #3
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Quote Originally Posted by Pommie View Post
    You just vary the duty from 0 to 100%. The output from the pic will be 5V of which 3V will be dropped by the resistor and the other 2V by the LED. The current through the LED will be (V/R) 3/220 amps = 13.5mA.
    Hi thanks.

    220R will supply only 13.5mA that is quite not enough for the LED to light up fully bright.

    150R will give me the best brightness (20mA).

    After replacing 150R I'll change the duty cycle register.

    That means duty cycle will vary this current from 0mA to 20mA.

  4. #4
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    The reason I asked because

    The led will light from 1.75V.That means (255/5) X 1.75 = 89

    If I write the duty cycle register below 89 there will be no effect,LED will off 0-1.75V.

    In this case the duty cycle zero will starts from 89?

    This is what I want to verify
    Last edited by Suraj143; 5th February 2009 at 04:25 AM.

  5. #5
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,805

    Default

    No, the duty cycle will start from 1. The PWM is not converted to DC (I hope) but instead flashes the LED at full brightness. It the duty cycle is 10% then the LED will be at full brightness for 10% of the time and so you see it as dull.

    Mike.

  6. #6
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Quote Originally Posted by Pommie View Post
    No, the duty cycle will start from 1. The PWM is not converted to DC (I hope) but instead flashes the LED at full brightness. It the duty cycle is 10% then the LED will be at full brightness for 10% of the time and so you see it as dull.

    Mike.
    Thanks for verifying.That means what ever the value is write to the duty cycle register it will turn on the LED with full brightness for the specific time written to the register.
    Last edited by Suraj143; 5th February 2009 at 04:40 AM.

+ Reply to Thread

Similar Threads

  1. 255 steps for a servo?
    By gastonanthony in forum General Electronics Chat
    Replies: 15
    Latest: 4th October 2009, 09:36 PM
  2. detecting steps on the floor
    By Charon102 in forum Robotics Chat
    Replies: 7
    Latest: 25th July 2005, 01:55 PM
  3. Need Urgent help, I'm just a few steps away
    By 23401040 in forum Electronic Projects Design/Ideas/Reviews
    Replies: 6
    Latest: 13th January 2005, 10:45 PM
  4. can any one tell me the designing steps of digital ic
    By vaibhavi in forum General Electronics Chat
    Replies: 1
    Latest: 12th March 2004, 10:50 PM
  5. Steps for Encoding and Decoding
    By Bella in forum Micro Controllers
    Replies: 0
    Latest: 29th October 2003, 02:57 AM

Tags for this Thread