8 Mayıs 2010 Cumartesi

RGB LED Controller




RGB LED Controller 



This is a Project that I've been woring on. It is pretty much finished. Just needs some LED indicators if its running and if serial connection is working.
What it basically does is, it waits for info from the PC through the RS232 interface and then controlls the brightness of the different collors.
I then wrote a programm which sends bytes to the cotroller depending on where the mouse is positioned on the color triangle.
The second program is a opensource program called BobLight ( http://www.xs4all.nl/~loosen/elektron... ). it looks at the screen and then sends the dominant colors through the comport. I modified it a little so it would only look at the top left corner of the screen.
the I made a plugin for winamp that produces plain colors depending on the beat of the music.That's about it. then I made some LEDclusters and strips and mounted them in my room.
Thats what I'm doin right now. I haveto wire more strips to put them all over my room.
Oh yeah the Programm also works when whatching movies, which then turns my whole room into one big ambilight :)

The circuits:


This is the schematic of the controller-board.
The top part shoes the powersupply. As 12V I use an old PC power supply because they can deliver quite a bit of current, which is needed for the amout of LEDs I want to drive. If you use one of those, keep in mind that they only run stable if there's a load on the 5V supply. you can achieve this by hooking p a few old harddrives, or just put some resistors :) they can get quite hot though.

I just realized, that some people are confused where to put the LEDs. The anodes of the LEDs should be connected to X2-1, X2-2. and X3-1.
The cathodes are connected to X4-1/2. The 4th output (X3-2) is for UV (blacklight) LEDs. I decided to make an extra output in case I wanted to connect some UV LEDs.
This output is not used in this version though. So you can just leave it if you dont want UV LEDs.

The pins on J1 are for the RS232 interface. The problem there is, that the PC expect -12V for a logic 1 and +12V for a logic 0.
Since the controller runs on 5V it puts out 0V for a logic 0 and +5V for a logic 1. There are ICs to convert this, but I didn't have any at the time, so I decided on a quick and dirty solution.
The PC is not so strict about the values. It also interprets 0V as a 1 instead of -12V and interprets +5V as a logic 0 instead of +12V.
So all you need to do is invert the signal of the controller by either using inverters or the following circuit:



I know this is kinda dirty, but it works :)




This is the Layout and finished etched board.
If you want, I can send you the eagle files. Just write me an email.

The LEDs:

The LEDs I use are common CATHODE superplux RGB LEDs. thats why I have P-channel MOSFETs as driver.
I need to switch the +12V to the LEDs. The circuit would be a bit simpler if they were common anode, but I had these lying around.
The advantage of these LEDs is, that they have all three color in one casing. the misadvantage ist, because they share a cathode, you cannot connect the individual colors series. Which means you need an individual resistor for each color of every LED. Which results in a bit more soldering work and higher currents.

The Software:

The Software for the Atmega8 is written in C. You can download it here.


It waits for Data on the RS232 port. The first byte is the brightnes of
the red color, the second for the grenn and the third for the blue.So, when you want to write you own program to controll the LEDs all youneed to do is send packs of 3 bytes through the comport.I will eventually modifie it so there are multiple modes to chose from.For example a standalone mode, which changes colors randomly, and maybe add a microphone, so it can change color to the music without a PC.

My Prog:



My Prog:This program I partly copied and partly wrote myself. You can use it to send a specific color to the controller. It's pretty quick and dirty aswell.In the randome field, dont type in 0 or leave it blank, this will crash the program :) Also it works on comport 1 .

Boblight:

Boblight: is a opensource program to imitate the philipps ambilight. It expects a controller with three individual LED outputs (left, top, right)though, so I modified it a little to suite my controller. You can download that version  You can download that version here
 I modifed it some more, so the program doesn't analyze the whole screen, but only the top left corner. I then put a Winamp visualization in the top left.and the controller sends the colour of the visualisation to the controller,which makes the light change to the music.It would be alot more efficient, if the pluginitself would send the bytes to the controller, but I'm not a programmer and couldn't figure out how
to write a plugin for winamp. That's about it for now. I will eventually update the site when I have
some time and will work on the controller. This site should help you to get an idea and get you startet on building your own. If you have any questiones
you can contact me via or email info@ledcontroller.de.vu

Hiç yorum yok:

Yorum Gönder

İzleyiciler

LED DİRENÇ HESAPLAMA

All LEDs require current limiting, without a current limiting mechanism the LED will usually burn out in under a second. Adding a simple resistor is the easiest way to limit the current. Use the calculator below to find out the value of resistor you require.

For example if you are wanting to power one of our_blank">red LEDs in an automotive application you would see that the typical forward voltage is 2.0 Volts and the maximum continuous forward current is 30mA. Therefore you would enter 14.5, 2.0 and 30 into the Single LED calculation box. After calculating you get 470ohm 1 watt as the result. Here is a that allows you to enter a resistor value and generate the corresponding color code.

Note: For automotive applications use the actual system voltage, not 12 Volts. Most 12 Volt system actually operate at around 14.5 Volts.

Supply Voltage
VOLTS
Voltage Drop Across LED
VOLTS
Desired LED Current
MILLIAMPS



Calculated Limiting Resistor
OHMS
Nearest higher rated 10% resistor

Calculated Resistor Wattage
WATTS
Safe pick is a resistor with
power rating of (common values are .25W, .5W, and 1W)
WATTS

LEDs in series

Several leds in series with one resistor
Supply Voltage
VOLTS
Voltage Drop Across LED
VOLTS
Desired LED Current
MILLIAMPS
How many LEDs connected




Calculated Limiting Resistor
OHMS
Nearest higher rated 10% resistor

Calculated Resistor Wattage
WATTS
Safe pick is a resistor with
power rating of (common values are .25W, .5W, and 1W)
WATTS
LM317 UYGULAMA DEVRELERİ HESAPLAMASI

 




Çıkış Voltajı
R1 resistor

R2 resistor

R1 resistor
R2 resistor

Çıkış Voltajı


Lm317 uygulama devreleri ve detayli bilgiye Buradan ulasabilirsiniz

LM555 - ASTABLE OSCILLATOR CALCULATOR

LM555 - ASTABLE OSCILLATOR CALCULATOR
Value Of R1 Ohms Value Of R2 Ohms
Value Of C1 Microfarads
Output Time HIGH SECONDS Output Time LOW SECONDS Output Period HIGH + LOW SECONDS Output Frequency HERTZ Output Duty Cycle PERCENT
Resistor values are in Ohms (1K = 1000) - Capacitor values are in Microfarads (1uF = 1)

NOTE: The leakage currents of electrolytic capacitors will affect the actual output results of the timers. To compensate for leakage it is often better to use a higher value capacitor and lower value resistances in the timer circuits.

LM555 Astable Oscillator Circuit Diagram


LM555 - ASTABLE CAPACITOR CALCULATOR

The next calculator can find the capacitance needed for a particular output frequency if the values of R1 and R2 are known.

Value Of R1 Ohms Value Of R2 Ohms
Frequency Desired Hertz
Capacitance uF
s

VOLT AMPER OHM ve WATT HESAPLAMA

Current:
kA (kiloamps) A (amps) mA (milliamps) µA (microamps)
Voltage:
kV (kilovolts) V (volts) mV (millivolts) µV (microvolts)