Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Full Colour L.E.D driver need help!!

Status
Not open for further replies.

picBasic_Freak

New Member
Hi there,i am currently doing my Final Year Project on how to control the color of Full Color L.E.D which has 6 legs in total ,i would like to know which model of PIC is the most suitable for me,currently i am using the PIC16F628A.For your knowledge i try to make use of the integrated PWM inside the PIC to control the duty cycle inorder for me to change the color of my L.E.D.Do you have a batter suggessions on how to control the color?
The interfacing circuit i used is via the Max232 which can communicate my programmed IC with my Computer.Can someone please help out on this,thanks.
 
picBasic_Freak said:
Hi there,i am currently doing my Final Year Project on how to control the color of Full Color L.E.D which has 6 legs in total ,i would like to know which model of PIC is the most suitable for me,currently i am using the PIC16F628A.For your knowledge i try to make use of the integrated PWM inside the PIC to control the duty cycle inorder for me to change the color of my L.E.D.Do you have a batter suggessions on how to control the color?
The interfacing circuit i used is via the Max232 which can communicate my programmed IC with my Computer.Can someone please help out on this,thanks.

Presumably it simply consists of three LED's (Red, Blue and green) in one encapsulation?.

To provide a simple 8 colours (including black and white), you only need to switch them on in the correct combination.

To do more you have to vary the brightness of the individual LED's, depending on how many colours you need you could simply have extra PIC pins switching different resistors in series with the LED's (using two PIC pins, and two resistors for each LED would give four different levels - including off).

Another option, as you've already mentioned, is using PWM to control the brightness - unfortunately you will need three PWM outputs (one for each LED), and the 16F628 only has one. Some of the larger PIC's, 16F877 etc. have two PWM channels, but I've never noticed (or looked for!) a PIC with three.

So you probably need to do software PWM, as the 16F628 has a hardware serial port you could use that to communicate with the PC (getting rid of one processor time waster!), and generate the PWM either in straight code, or as an interrupt routine.

Does your project have a requirement for a specific number of colours?.
 
Alternatively, you could use a small Atmel AVR, it is C programmable. My suggestion would be to use a software UART (you only need to receive, so you dont need a full blown level shifter). Do the PWM in software. Using an 8 bit register for each color would give you a millions of different colors. You might need to slightly increase the power and lower the duty cycle to get an acceptable amount of light (look through the data sheet for the peak current). For something like this, the PWM in software is very easy, no need for the dedicated PWM modules as this is all the uC is going to do.
 
My L.E.D consists of 2 blue color pins 2 ground pins 1 red pin and 1 green pin total 6 pins in total.But i don't know how to use VB 6 to control the color of my L.E.D and i am not sure how to do it,need some ideas from all of you.From the replies i know that i cannot use the integrated PIC PWM to control the color because the most PWM output i can get are just 2.What i need to do is just use PIC to comunicate with my pc and use software (VB 6) to control the color am i right?but where can i find those codes for vb on how to control the L.E.D color can someone please help out? Thanks for you early replies i really appreciate it.
 
I think you misunderstood what people said. Some PICs have build in hardware PWM modules. Most parts have 1 or 2, so you dont have enough to run all three colors. The suggestion was that you still use the PIC and just build a software PWM using a regular output port and some of the timer functions of the PIC. This should be very straightforward. For instance, you might control each color with a value from 0-255. You use the serial port on the PIC to communicate with your VB program. Your VB program just sends the color commands such as R255 for instance would set the Red LEDs to 255.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top