Single PIC to Blink 5 LEDs Independently?


Closed Thread
Results 1 to 40 of 69

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: Single PIC to Blink 5 LEDs Independently?

    I've looked at your schematic, and im not sure what you are doing with those transistors. Are you using them just to turn on and off the leds? is your pots there, to tune the current for the leds?
    I use N-Mosfets, instead of transistors, they act more like a switch, transistors turn on more the more voltage/current their fed, but a fet can be turned on fully with a minimal of power. You can drive a FET directly from the chip, no resistor needed. heres what I would do, +5v to Pot Pin 1, Gnd to Pot Pin 3, Pot Pin 2 goes to LED +, LED- goes to FET Drain, FET Source goes to GND, FET Gate goes directly to PIC PIN. this allows to to turn on and off your LEDs with very little to no current/voltage loss on the FET, all FETs will be turned on the same ammount. FETs do not get as warm as regular transistors and can usually handle more current.
    The only thing I see a problem with is how many LEDs in parallel you hook up to each POT, You can turn on a LED with 10-25ma, if you have 5 turned on and running at 125ma, that may cause a wattage problem for the POT. But this may not be a problem, It all depends on application and use.
    #1 though, you shouldnt be sinking or driving LEDs to the PIC directly, its fine to do this on a breadboard for testing and such, however if your using many leds, its good to throw in a resistor. That notice on how much the chip can sink current wasnt placed there so you could sink current from leds, its a electrical rating for the chip for all outputs, when you hook up a button with a debounce circuit, the chip has to sink som of that current, each pin that has a high input with a resistor that the pic makes low, has to sink current. all these add up, if you start adding LEDs thats alot more it has to handle. It can make the chip work eratic, or fail, it may not happen today or tomarrow. best to just use the pins for data or drive another device to handle the voltage/current.
    OH there is also another good reason to use FETs, you can use a seperate voltage source of a much higher voltage, you could drive 12volt headlights on a car using the right FET and they would behave just like the LED, or a Motor, or lots of things. Like I said a FET is like a 1-Direction Switch, either on or off.
    Have fun, your project sounds interesting. I did the same type of project a few months back with very little code, not much different than yours. I just now read your thread so I didnt have a chance to post code before you got it working the way you wanted. good luck.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Single PIC to Blink 5 LEDs Independently?

    The transistors are there so I can drive up to 10 LEDs per PIC pin. The trim pots are to control the LED brightness (via current change).

Similar Threads

  1. Single button function
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 40
    Last Post: - 4th April 2020, 18:33
  2. How to blink 8 LEDs at different rates- concurrently?
    By rmteo in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th April 2010, 23:47
  3. single sided PCB
    By schu4647 in forum General
    Replies: 1
    Last Post: - 10th December 2008, 18:22
  4. Can't Blink 2 LEDs
    By dfort in forum mel PIC BASIC
    Replies: 2
    Last Post: - 5th March 2008, 22:36
  5. Tx and Rx of Single Pin PIC's
    By Dwayne in forum Code Examples
    Replies: 0
    Last Post: - 26th May 2004, 14:55

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