I have an Arduino Uno driving 4 channels of RGB LED strips via the SoftPWM library and an array of transistors (TIP-120/IRF-510); These are wired as follows:
RGB Channel #0: [pins] 2, 4, 7
RGB Channel #1: [pins] 3, 5, 6
RGB Channel #2: [pins] 8, 12, 13
RGB Channel #3: [pins] 9, 10, 11
: SETUP :
This layout is due to grouping the strips by hardware and non-hardware PWM outputs, as early on in prototyping, I ran into odd issues with SoftPWM if I combined the usage of these pins. Anyway, moving forward into the rat's nest. External power is supplied by a 12v/1.25A PSU, with the ground connected to the Uno's Vin/Gnd set GND pin. [For some reason, if I connected it via the barrel jack, the Uno's power LED kept rhythmically flashing]. --- There are 11 TIP-120 transistors and 1 IRF-510, all with their own ties to Gnd and varying indepenent resistors in the 100~250Ω range.
: CODE :
Code: Select all
#include <SoftPWM.h>
int ledR0 = 2;
int ledG0 = 4;
int ledB0 = 7;
int ledR1 = 3;
int ledG1 = 5;
int ledB1 = 6;
int ledR2 = 8;
int ledG2 = 12;
int ledB2 = 13;
int ledR3 = 9;
int ledG3 = 10;
int ledB3 = 11;
void setup() {
Serial.begin(9600);
SoftPWMBegin();
SoftPWMSet(ledR0, 0);
SoftPWMSet(ledG0, 0);
SoftPWMSet(ledB0, 0);
SoftPWMSet(ledR1, 0);
SoftPWMSet(ledG1, 0);
SoftPWMSet(ledB1, 0);
SoftPWMSet(ledR2, 0);
SoftPWMSet(ledG2, 0);
SoftPWMSet(ledB2, 0);
SoftPWMSet(ledR3, 0);
SoftPWMSet(ledG3, 0);
SoftPWMSet(ledB3, 0);
SoftPWMSetFadeTime(ledR0, 300, 300);
SoftPWMSetFadeTime(ledG0, 300, 300);
SoftPWMSetFadeTime(ledB0, 300, 300);
SoftPWMSetFadeTime(ledR1, 300, 300);
SoftPWMSetFadeTime(ledG1, 300, 300);
SoftPWMSetFadeTime(ledB1, 300, 300);
SoftPWMSetFadeTime(ledR2, 300, 300);
SoftPWMSetFadeTime(ledG2, 300, 300);
SoftPWMSetFadeTime(ledB2, 300, 300);
SoftPWMSetFadeTime(ledR3, 300, 300);
SoftPWMSetFadeTime(ledG3, 300, 300);
SoftPWMSetFadeTime(ledB3, 300, 300);
Serial.println("Ready!");
}
void loop() {
delay(1000);
Serial.println("On");
SoftPWMSetPercent(ledR0, 100);
SoftPWMSetPercent(ledG0, 100);
SoftPWMSetPercent(ledB0, 100);
SoftPWMSetPercent(ledR1, 100);
SoftPWMSetPercent(ledG1, 100);
SoftPWMSetPercent(ledB1, 100);
SoftPWMSetPercent(ledR2, 100);
SoftPWMSetPercent(ledG2, 100);
SoftPWMSetPercent(ledB2, 100);
SoftPWMSetPercent(ledR3, 100);
SoftPWMSetPercent(ledG3, 100);
SoftPWMSetPercent(ledB3, 100);
delay(1000);
Serial.println("Off");
SoftPWMSetPercent(ledR0, 0);
SoftPWMSetPercent(ledG0, 0);
SoftPWMSetPercent(ledB0, 0);
SoftPWMSetPercent(ledR1, 0);
SoftPWMSetPercent(ledG1, 0);
SoftPWMSetPercent(ledB1, 0);
SoftPWMSetPercent(ledR2, 0);
SoftPWMSetPercent(ledG2, 0);
SoftPWMSetPercent(ledB2, 0);
SoftPWMSetPercent(ledR3, 0);
SoftPWMSetPercent(ledG3, 0);
SoftPWMSetPercent(ledB3, 0);
}
All channels work as expected, except for ledR2 (on pin #8) which has a persistent fully open gate (unfettered output, full blast) and ledB2 (pin #13, the rogue IRF-510), which has a markedly dimmer output than any of the other transistors in the circuit (which all have what appears to be an ideal and full output). I've verified all solder points, and checked for continuity and solder bridges but I just cannot seem to resolve these two issues. If anyone could suggest what may be causing this, I'd be very appreciative. Thank you in advance!
Picture #1:
Picture #2:
PS: I'm quite aware that my soldering work is rather sloppy... I hope to improve that, as time goes by. haha