One thing...do the MOSFETS/resistors in the power supply get very hot?
Red MOSFET gets warm enough for a heatsink due to greater voltage drop but blue and green hardly get warm at all though I have put heatsinks on all of them as the electronics are in a plastic box with little air flow and will be on for hours at a time.
2W seems a little on the low side for the resistors. I'm thinking the resistors in the photos are more than 2W.
Without ordering online and paying P&P I could not get a small 2W 2.2ohm resistor so got the 3W wirewound ones from Maplin
What is the difference between the circuit you linked and this one?: http://www.tbideas.com/blog/build-an-arduino-shield-to-drive-high-power-rgb-led/
Yours has extra parts for beeing PWM friendly as it says on the page, but I really don't understand the explanation.
I did mine and I noticed that when PWM level is low the led blinks a little, I really don't know if it will bother with the other colors turned on, need to test that.
Do you think adding those extra parts will solve that?
Pancra85:
What is the difference between the circuit you linked and this one?: http://www.tbideas.com/blog/build-an-arduino-shield-to-drive-high-power-rgb-led/
Apart from using different MOSFET and resistor values the circuits are the same, the schematic I attached to the first post has 3x of these circuits to separately drive the RGB colours in the LED it also has a voltage regulator to give a 5V supply for the ATtiny85 that does the PWM colour changes.
Yours has extra parts for beeing PWM friendly as it says on the page, but I really don't understand the explanation.
I did mine and I noticed that when PWM level is low the led blinks a little, I really don't know if it will bother with the other colors turned on, need to test that.
I use no extra parts to make the thing more "PWM friendly". I don't notice any flicker at low levels but that might be because at lease one other colour is always bright so may mask the flicker effect.
Do you think adding those extra parts will solve that?
See above
Apart from using different MOSFET and resistor values the circuits are the same
I mean the shaded parts, it says on the webpage that those parts are for "adding PWM input support", I built it without those parts and still works (even if it blinks a little when PWM is low)
How should I change your .ino script if I need this on Arduino?
I have all the components of ATtiny-RGB Moodlamp.pdf but instead of Tiny I have Arduino.
UniFly:
How should I change your .ino script if I need this on Arduino?
I have all the components of ATtiny-RGB Moodlamp.pdf but instead of Tiny I have Arduino.
Just make sure redPin, greenPin & bluePin are PWM pins on your arduino and wire to them pins.
Secondly, colors are switching that means not fading.
Should I use 0,1,4 PWM pins on Arduino? Any comments what should I change?
You need to use PWM compatible pins. On the UNO they are pins 3,5,6,9,10 & 11 (the pin number on the board has a ~ in front of PWM pin numbers)
Over the weekend, I finally got around to finishing a similar thing, except i used 5 of them... potentially it can supply over 50 watts of light but I decided to limit the current, it pulls around 2amps at 12v (or 24watts) and decided that's bright enough.
But i also did what you did using an attiny85 for the bedroom, they certainly beat 5mm LED mood lights you get from shops..
I figured it's kinda pointless seeing it in daylight... so I just switched it on (it's 1am, plenty dark enough i suspect)
oh and just to explain... I'm using 2n2222's and no "current regulation" each npn can deliver around 800ma, so I use a 68 ohm resistor to the base pin for each segment, this rougly supplies 120ma per color which is well within spec of the transistor... I purposely kept it low knowing that when the LED heats up, i expected the current to rise up to 200 maybe 300ma, in which case it's well within spec of the 800ma limit of the transistor AND within the 300ma per RGB channels from the 10 watt.
So, 120ma * 3 * 5 = 1.8amps or 21watts.
The multimeter reads 1.8 - 1.9 amps...
Now, because I have no current limiting resistor on the emitter/collector side of the LED, it relies just on the 68ohm resistor, I originally was going to use something like a 30-40ohm resistor and 1/4watt was not up to the job, so i stuck with the 68 ohm resistor and hoped that once the LED's warmed up, it would draw more current to get to the 300ma mark.
And (as I suspected) ... No.
The heatsink keeps the LED's cool and sadly (even in 45c / 100f+) heat, still no... maybe if i run it for a few hours instead of 30 - 40 minutes the current will slowly creep up? - good because I like bright.
next time i'll use 1/2watt resistors and push the 50watt boundy, as it is 21watts is bright enough.
Also I changed the script lines for Arduino Uno: #define RedPin 3 #define GreenPin 5 #define BluePin 6
Now I'm focusing on scripting. Can anyone give me simple example - how to get e.g., Violet color light (whitout fading and extra stuff). Just as simple as possible script.
UniFly:
Now I'm focusing on scripting. Can anyone give me simple example - how to get e.g., Violet color light (whitout fading and extra stuff). Just as simple as possible script.
If you want just a single colour then use a paint programs colour wheel or an online version to select the required colour and read off the RGB values. Then change loop() to just these three lines