32 LEDs with less than 20mA


Closed Thread
Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597

    Default 32 LEDs with less than 20mA

    Just an example of how little current is required to light 32 LEDs simultaneously:



    18F44K22 using internal oscillator at 64MHz

    LED turned ON
    PAUSEUS 500
    LED turned OFF
    PAUSEUS 500
    ...repeat for 31 other LEDs


    Not bad, 18.97mA for 32 LEDs and PIC mcu.

    To the naked eye, they all appear ON without blinking. A little pale, I could reduce the 330ohm resistor a little bit, maybe 270ohm, but this was taken under the kitchen light.

    Robert
    Last edited by Demon; - 4th January 2014 at 04:02.

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    Quote Originally Posted by Demon View Post
    Just an example of how little current is required to light 32 LEDs simultaneously
    Not really . I have a similar project where I drive 8 digits in an LED display by multiplexing them one at a time. Also, to the naked eye they all appear to be ON at the same time.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    They are lit simultaneously, but look at the code, they blink one at a time.


  4. #4
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    Wow demon,

    that's a LOT of LED's

    Hop over to ebay and search on "rapid prototyping LED"
    You will find some nice little LED modules all wired up with resistors ready to pop into your bread board. Just ordered me some green ones.

    They are all 6 LED's per module I couldn't find any that were 8. But still pretty nice and easy to use.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  5. #5
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    actually here are some that are 8 LED's per module.
    But they are a little different in the way they pinout
    and quite a bit more money... about $10US including shipping versus about $2 shipped for the 6 LED ones.

    http://www.ebay.com/itm/Rapid-Protot...#ht_2014wt_805
    Last edited by Heckler; - 5th January 2014 at 00:33.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    Did I mention I have a boatload of Leds and resistors? LOL

    I bought a wide variety on ebay several years ago, knowing I'd use them in projects eventually.

    I have enough "stuff' to print barcodes and start an inventory (future android project).

    So many ideas, so little will power.

    Robert


    Edit: oh yeah, those are neat. Must cut down on setup time when you have a lot in your circuit.

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    I'm down to 3mA on the blinking LED without a resistor.

    I posted test results over on the Indexing thread
    http://www.picbasic.co.uk/forum/show...843#post124843
    along with my code.

    Just have to rewire my breadboard to remove current-limitting resistors altogether, again, just redid using 270ohm gang resistors. Darn it's tedious.

    Still have to tweak my code to use Darrel's interrupts instead of PAUSE to be able to use interrupt on buttons later.

    Robert

  8. #8
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    You should also put them in a matrix to reduce the number of pins (and wires) required.

  9. #9
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    I thought of a matrix, but my code might become very complex so I'm trying to keep the basic structure as simple as possible.

    That and I have the pins available.

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    Figured out how to have same current at the LEDs no matter how many are used; set pin even if bit received from Master is a 0. So now it always take the same amount of time to go through the loop. Post is updated:
    http://www.picbasic.co.uk/forum/show...843#post124843

    Used NPN 2N2222 transistors to drive the LEDs. So now I've moved the problem of the PIC having a pin frozen ON, to a transistor frozen ON. Not enough experience to know if it is worth the extra parts.

    Transistors do bring another problem, it now takes a 100mA to drive all LEDs ON; a lot more than using the pin to LED to 0VDC technique. I don't know enough about transistors; I'm guessing it has something to do with switching times, I must have more than one still leaking current even if the PIC decided the pin is at 0VDC. LED loop is now running at 668 Hz according to Saleae probe.

    I have no experience using LED driver ICs (none on hand). I have to research those; they must bring in safeguards and fewer parts count into the picture. Is one more interesting in particular?

    The system will never have 32 LEDs ON, that was a stress test. Only one side can be lit at any one time, and that's if I disabled the zone or the zone is open; highly unlikely all 15 rows will be ON. SO current will not really be an issue, I was just hoping to get it as efficient as possible.

    Also, the panel won't be active all the time. You'll have to press the * on the keyboard, that will help conserve current when using battery mode even more.

    Robert


    Sidenote: I had one LED that was always dimmer than the others. I changed pin, LED, even the transistor, no difference. Turns out the 4K7 resistor was way off (gold tolerance), replaced and LED now same as others. First time I get one of those that is so far off that it affects LED brightness this much.
    Last edited by Demon; - 6th January 2014 at 06:19. Reason: Hertz

  11. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    Great bi-directional multiplex design here:
    http://www.picbasic.co.uk/forum/showthread.php?t=14439
    Only 5 pins to drive 16 LEDs.

    Woot!

    Robert The Happy Camper
    Last edited by Demon; - 11th January 2014 at 23:21.

  12. #12
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: 32 LEDs with less than 20mA

    CURRENT SAVING UPDATE

    Transistors are out, back with current limitting resistors and ultra bright LEDs.

    Old "frosted?" green 5mm LED with 330R: 40 LUX using 9mA

    New clear ultrabright green 5mm 10000 MCD LED with 1K at 90Hz: 40 LUX using 0.053mA
    Tested using AR813 Lux Meter.

    Robert
    Last edited by Demon; - 23rd January 2014 at 03:32.

Similar Threads

  1. Creating 4 to 20MA ?
    By amgen in forum Off Topic
    Replies: 10
    Last Post: - 3rd May 2014, 22:45
  2. 4-20mA using SPI Interface
    By gavo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th April 2013, 19:51
  3. 4-20mA output using PWM
    By gavo in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th December 2007, 09:45
  4. 4-20mA current loop
    By mychangl in forum General
    Replies: 5
    Last Post: - 20th April 2007, 11:41
  5. 4-20mA to 0-5V configuration
    By leonel in forum General
    Replies: 0
    Last Post: - 31st August 2005, 12:33

Members who have read this thread : 1

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