Shop OBEX P1 Docs P2 Docs Learn Events
Duty cycle and current limiting resistor calculation — Parallax Forums

Duty cycle and current limiting resistor calculation

DigitalDjDigitalDj Posts: 207
edited 2007-12-12 13:15 in General Discussion
I am using the scanning method for a matrix and I am not getting the brightness that I need out of the leds on a display, is there a calculation based on the current limiting resistors, voltage and duty cycle or on time that will allow me to calculate what I need? Also what would the on time be? I used a scope to check some of this out and I came up with what I think is about 500ms on time for the led and 20 - 25% duty cycle. Someone correct me on this if I am totally wrong!

Thanks,
Kevin
·

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



Post Edited (DigitalDj) : 12/9/2007 1:38:17 AM GMT

Comments

  • JonnyMacJonnyMac Posts: 9,217
    edited 2007-12-09 01:38
    I'm confused -- perhaps you are, too -- about your "on time." If you're scanning (do you mean multiplexing?) then 500 milliseconds is a very long time. You can only run so much out of the SX; you may need to add external hardware that allows more current through your LEDs.

    Posting code in question is always helpful.
  • DigitalDjDigitalDj Posts: 207
    edited 2007-12-09 02:00
    I was running your code!

    Nevermind the post, I am running ULN2004's on the rows and colmns, pnp transistors after the ULN2004's on the columns to switch 12 volts for some led modules. I just found that my column transistors PN2907's must have a high on resistance because I doubled them up and it is alot better. I guess I should change them out to fets.


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

  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-12-09 13:21
    The PN2907's can only handle a few hundred milli-amps. You are probably drawing at least 3 or more amps. Since you are using more than·5·volts for the LEDs you will need to use some dual or complimentary higher current P channel + N channel·MosFETs·with perhaps 3-6 + amp ratings.

    You can get free samples from Fairchild semiconductor: http://forums.parallax.com/showthread.php?p=649643

    Look at the HiSwitch.jpg attachment which is an example of this to·turn on·higher current·at higher·voltages (12v in this case)·than 5 volts (TTL). So a microcontroller output can go to the TTL input (for 5 volt switching). Tie the +5v and +12v grounds together too. On the Q4 drain output have this go to maybe·a·100 ohm (try different values - lower = more brightness - but be carefull not go too low then you might burn up an LED or more).

    Also look at my attached guides for LED moving displays to learn the "rules" for setup and voltage and current calculations. Remember since you are using more than 5 volts, you will need to use a·N and P channel FET combo.

    Also post some of your questions here in the micro-controller section:

    http://www.electro-tech-online.com/

    They have been very helpfull to me.

    Post Edited (T&E Engineer) : 12/9/2007 1:32:47 PM GMT
  • DigitalDjDigitalDj Posts: 207
    edited 2007-12-09 18:05
    Thanks for the info!

    Actually the 2907's are good to 800ma but the spec sheet only shows base current saturation for a collector current of 500ma. I was running 200ma per column.·I have 2 projects going on the one with a PIC for a friend and I am woriking with the SX for mine. I did this because of not having pic stuff but I do have the SX. I am learning alot dealing with the high power side of driving leds.

    I found I had my transistors emitters and collectors reversed, 2 different spec sheets showed them different. I am thinking of changing them to the mosfets though! I like the ULN2004's because they are quick and easy.

    Kevin



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

  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-12-09 20:27
    I have been using P channel MosFETs on my LED anodes (5v only LED designs) and they really work well to make sure the necessary current is drawn. You will see a difference with them. The only issue is I can only·get them in tiny surface mount size so I have to create a special printed circuit board (etched with Radio Shack etchant solution - and they only sell double sided copper boards now so there is more copper to remove so they don't always turn out right). I solder wires off of the board for the 8 anodes (Source +5v, gate from the micro-controller and Drain out to the resistors/LEDs).
  • DigitalDjDigitalDj Posts: 207
    edited 2007-12-11 22:24
    T&E,

    How did you come to the 39ohm base current limiting resistor in you docs.

    For the anode drivers use saturated bipolar transistors (2N3906 or PN2907 *) which have a typical drop of 200mV @ 240mA, if 10 mA of base current is provided which requires a 39 ohm base resistor.

    Thanks,

    Kevin



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

  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-12-12 13:15
    Sorry. I dont have my calculations in front of me but in most cases you can just try a resistor value on 1 or 2·of the LEDs and then get the brightness you desire by decreasing the resistance. I usually stick with 10 - 100 ohms in most cases for good results with MOS FETs (P channel) - High current.
Sign In or Register to comment.