Using Arduino to change the colour of TRI LEDs

Hey Guys,

Lately i have been working on a mod for my PC case fans. the general idea is to swap the normal blue LEDS to TRI LEDs and that they change colours depending the actual reported temperature of the CPU. what would be the best way to do this?

also it would be good tho know what would be the best board for the job?

Notes: all up there will be 18 LEDs (54 counting individual colours (18 red, 18 blue, 18 green) so i might need to use a transistor to up the amperage.

the best program to get the CPU Temperature data of would be Everest, which has external programs capabilities.

the colours that i want to use would be 0-40*C = BLUE, 40-50*C = GREEN, 50-60*C = YELLOW (GREEN + RED), 70*C+ = RED

Also if you need to know my Motherboard is an ASUS P5KC

let me know if you need to know anything else. Thanks

I am figuring out the LED numbers tooo.
I am going to use a Mega board due to number of pwm , so far I am using 2 leds per every 3 pwm pins, each Led has a 220 homs resistor, it works great. I will get my Mega tomorrow, so I will start working on it
One thing to think about is the amount of current that Leds will draw.

Well do you want to control all the LEDs at once? Or is each one seperately controlled? One thing to note, is you don’t need PWM. All the colours you mentioned are solid.

If you want seperate control, its a little complicated. You need 54 pins output pins. Your options would eb to get a board that has that many pins (MEGA), or use a LED Driver (MAX7221)
Note: While you can daisy chain the MAX7221s, they do have a problem with syncing (important if you use a max7221 for each channel)
If you’ve never worked with multiplexing before, any money is nt an issue, I’d go with the MEGA

If you want to control them all at once, the size of the board isn’t that important, any one would work. You only need three output pin and three transistors.

You would however need a fairly powerful power supply. If you account 3V per voltage drop & 20mA per forward current. you are looking at supplying <4 Watts of power. A common 12V, 1A power supply should do. I’d arrange each channel, into 6 parallel brances of 3 with a 220ohm led per branch

thanks for the replies,

i will quite literally have 56 or so amps avaliable on the 12v rail (850watt PSU) so the power would not be the problem, the problem that i can see is that the chip wont handle the power draw from the leds

the LED setup goes like this, 6 fans (possibly adding 1/2 more later), 3 leds per fan, 3 colours per led, each set of three leds have thier own resistor per colour.

the mega seems fine, the shop in australia is selling them for 40-60 dollars so not to bad.

it would be cool if i could tur it of and be able to coltrol the colour myself either by switches or on the computer itself. and also be able to turn of individual fan leds (hence the layout of the resistors).

so is it all doable? and would using everest be a good idea?

also i am a compleate newbie at this so i will need help making the code. the only coding i have done it HTML and a little bit of PHP.

thanks guys

the mega seems fine,

Indeed it is, but the MEGA like all the other ATMEL chips in this series has an absolute current limit of 200mA sourcing and 200mA sinking current, irrespective of the number of output pins it has.

so is it all doable?

I would say a definite yes providing you have the right sort of drivers or design.

ok cool, i'm keen to do this then.

is it best to get the board now or after the coding?

also Everest writes the CPU's temperature in the registry.

HKEY_CURRENT_USER\Software\Lavalys\EVEREST\SensorValues\Value.TCPU

with these boards is it the best idea to use transistors to up the amperage? or is there a better way?

sorry about all the questions but i am really exited about this :)

sorry about the repost but i could find a edit post ‘button’

would there be another Arduino with at least 18 outputs? the mega might be a bit large being 10 cm long.

"i could find a edit post 'button'" It is labelled "modify", just up there on the right.

I'd suggest sitting down and planning it all out (Boo! Killjoy!)

Seriously, think about the steps you need to work through, and compartmentalise all the software components. Take small steps; check that you can drive the LEDs using a simple program loop, check that you can communicate with the monitoring program...

Think how are you going to test it all? Presumably you don't want to have to heat up your CPU to check that the LEDs turn red ;)

By building upon simple solid blocks, you'll avoid a lot of frustration and disappontment.

errr im a idiot.... now were is that facepalm smilie.... :-[ close enough :p

i have the LED array set out using YENKA. so that's all organized

basicly i have all the plans done for a LED array with switches

here are the steps that i need to figure out (i will need advise with all of these)

Edit: i can heat up my CPU buy using CPU Stressing programs (i use it all the time to test my CPU stability at a high overclock)

  1. what transitors to use to allow more than 500 mA to be drawn from the arduino, or some totally different solution.

2 big step cut down into little ones: Programing, will need big help :( a. how to get it to read from the registry (main concern can't find any information about people doing this) b. general programing (e.g. 40*C = Blue) c. how to manually control the colors (very low priority)

Now if this were my project, I'd drive the LED's with ULN2003's and use RGB LEDS to keep the parts count down.

http://www.datasheetcatalog.org/datasheet2/f/0c6x6a46ig46qlxf3j2qsaii8o3y.pdf http://www.mpja.com/prodinfo.asp?number=17137+OP

The ULN2003 is rated at 500ma per driver with 7 darlington transistor drivers per chip. The simplicity of having 3 LEDS in one package is clearly a bonus when trying to fit things into a PC case.

ok thank you for the info, i think i will use the ULN2003's, i already planed on using RGB LEDs

i will make up a plan and put it up here.

any more info/tips will be greatly appreciated :)

ok here the diagram

PLEASE NOTE: i have no idea how to wire up a ULN2003 please help :(

Also i did this in MS paint, so excuse the mess :p

You can't use a ULN2803 with common-cathode LEDs, as you have shown. The ULN2803 and ULN2003 cannot connect the output wire to 5 Volts, it can only connect the output wire to Ground. That means you must have common-anode LEDs, but multi-colour LEDs are not available in common anode. So, you'll need a different driver circuit, one that can source current, not one the can sink it, as the ULN2803 can.

Pin 9 on the should be left un connected (as you aren't using it) or connected to the +ve supply otherwise you are shorting the supply through the diode. Also you have the current flow wrong as stated above. Are you sure you have common cathode LEDs?

but multi-colour LEDs are not available in common anode.

You can get RGB common anode LEDS. I have 50 of them lying around at home infact as there was an ordering mistake and I need 50 common cathode instead. These are the ones I have

http://www.seeedstudio.com/depot/5mm-triple-output-led-rgb-common-anode-p-25.html

You can't use a ULN2803 with common-cathode LEDs, as you have shown. The ULN2803 and ULN2003 cannot connect the output wire to 5 Volts, it can only connect the output wire to Ground. That means you must have common-anode LEDs, but multi-colour LEDs are not available in common anode. So, you'll need a different driver circuit, one that can source current, not one the can sink it, as the ULN2803 can.

Ill see if i can grab darudude's ones, i havent bought anything yet.

Pin 9 on the should be left un connected (as you aren't using it) or connected to the +ve supply otherwise you are shorting the supply through the diode. Also you have the current flow wrong as stated above. Are you sure you have common cathode LEDs?

ok then i will redo the diagram and post it back up here

You can get RGB common anode LEDS. I have 50 of them lying around at home infact as there was an ordering mistake and I need 50 common cathode instead. These are the ones I have

might take those of your hands if you dont mind shipping internationally (TRI LEDs are around $5 each here)

TRI LEDs are around $5 each here

Look on ebay they are much cheaper £16 for 100:-

http://cgi.ebay.co.uk/100-pcs-5mm-RGB-LED-4000mcd-Common-Cathode-Free-R_W0QQitemZ180345791143QQihZ008QQcategoryZ66954QQssPageNameZWDVWQQrdZ1QQcmdZViewItem

might take those of your hands if you dont mind shipping internationally (TRI LEDs are around $5 each here)

I wouldn't mind selling them to you, however, depending on where you live it might be cheaper online. I've shipping to other forum members in the states (I'm in canada), and it cost them approx $15 in shipping. This might be cheaper cause the package is smaller however.

im new to this anode and cathode stuff, would all the the traces stay the same? logic tells me it all has to be opposite for me to use anode LEDs, and the ATMEL chip wouldn't like being reversed im guessing

what about pull up resistors?

Well according to your earlier schematic, the LED direction is reversed and the common anode is attached to 5V instead of GND.

Other than that the traces should be the same. Also your code will be different. On a common cathode LED you generally make each segment HIGH to get colour on that segment. On a common anode you will make each segment LOW.