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.

RGB Controller

Status
Not open for further replies.

erosennin

New Member
Hi Everyone,

I've designed a PWM controller using a PIC18F series uC. The problem is however, I have had no luck in writing the program as I've never written a PIC program before and it never does what I want it to, not on the simulations anyway. So... I would love it if someone would be able to do it for me :rolleyes: (Or give me exceptional directions so a complete PIC noob like myself would be able to do it)

I've attached the schematic, so you can see which ports are being used for what. I apologise for the rather crude quality.

What I was after is... All three PWM running at the same time, as i'm pretty sure the PIC is able to do that, according to the data sheet.
The '*' button on the keypad would be used to cycle through the 3 pwms, the numbers used to enter a value from 0-255 and then the '#' button would be used as an 'enter' key. Once the '#' is pressed, all three values displayed on the LCD. For example, R:xxx, G:yyy, B:zzz.

This is a personal project, and won't be used for commercial or educational purposes - I am willing to give full credit to the programmer for the coding.

If you think there are any hardware issues, any feedback is appreciated. The LEDs are common cathode RGBs. They are arranged in a 7*7 matrix - i.e. a row of 7 in series * 7 of these in parallel. I thought this was the most efficient way, but any feedback on this is also appreciated.

I thank you all for all your assistance.
 

Attachments

  • Schematic Prints0001.gif
    Schematic Prints0001.gif
    94.4 KB · Views: 325
Questions about your LED drive.
U1, when on will dump a large amount of current into Q4 base. Why D12 it will never see more than 0.6 volts.
Why use an opto-isolator?
Q4+Q1 are a little slow. I assume you PWM is running slow. 100hz?

Suggestion: Switch the cold side of the LEDs not the hot side. Use a logic level FET, 100k resistor gate to ground, gate to PIC.

Suggestion: You use a 5 watt resistor for current limit. Use 7 small resistors. The current will divide up better between the 7 strings of LEDs.

Suggestion: You could use 7 (1watt LEDs).

Why R1,R8?
Need capacitor on +12 volts.
MCLR needs connection dot on schematic.
 
As ron pointed out plus
move your keypad to PORTB and use its built in pullups, adding diodes to the matrix would also help.
The reset button resistors are backwards and the cap is unnessary, take a look at the reset on either my Firefly or Junebug tutors for suggestions.
 
Another question about the opto, Are you using 32V, if so I don't know if having a 15V zener without a current limiting resistor is a good idea.
 
RE Ron:
D12 is there to drop voltage, no other purpose - albeit 0.6V
I'm using an opto isolator as the PIC output is only 5V and it wont switch the FET or Transistor. I'm having trouble find PNP logic level FETs.
I can't switch the cold side because it's a common cathode led, There are 3Leds in the one package with one 'ground'. Thus if I switch the cold side I can't have my dimming.
I was hoping to run it around 4kHz... this might be audible on cheap Transistors/FETs though so I'll make sure to get good ones...
R1 and R8 are there to extend the Time Constant of the caps to get better smoothing...

RE Blueroom:
I didn't want to use PORTB because that's the inbuilt PWM port...
Thanks for the reset, I'll deal with that during construction.

RE Supervoip:
Yes I'm using 32V on the opto, and I will add current limiting resistor to the 15V Zener. Assuming I can't find decent Logic Level P-Channel FETs. Then the output stage will obviously change. As Ron suggested.

Thank you everyone.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top