Controling the brightness of an RGBW LED stip with a potentiometer.

This is my first arduino project and I am trying to control a RGBW led strip using 4 potentiometers (1 for each color). I also want to add a 5th potentiometer to control the overall brightness. I do not want this 5th potentiometer to effect the colors of the lights just the over all intensity. Does anyone have any suggestions on how I can do this?

This is the LED strip I am using.

I have it connected using N-Channel MOSFETS; and the 4 potentiometers I have connected work. I just want to add a 5th potentiometer to adjust the overall brightness without having to turn each channel down if that makes since.(Similar to the way the brightness up and down buttons on the remote work).

I did not make this diagram; but this is what I have been using to connect the LED strip to the arduino.

Here is the code that I have writen so far:

#define RED_LED 11       //define what pin the red led is connected to
#define GREEN_LED 10     //define what pin the green led is connected to
#define BLUE_LED 9      //define what pin the blue led is connected to
#define WHITE_LED 6     //define what pin the white led is connected to
#define Knob_R 0      //Define what pin the knob for the red led is connected to
#define Knob_G 1      //Define what pin the knob for the green led is connected to
#define Knob_B 2      //Define what pin the knob for the blue led is connected to
#define Knob_W 3      //Define what pin the knob for the white led is connected to

void setup() {
 // put your setup code here, to run once:
Serial.begin(9600);
 pinMode(RED_LED, OUTPUT);
 pinMode(GREEN_LED, OUTPUT);
 pinMode(BLUE_LED, OUTPUT);
 pinMode(WHITE_LED, OUTPUT);  
}

void loop() {
 // put your main code here, to run repeatedly:
int val_R = analogRead(Knob_R);                   // Get value from Red knob
 val_R = map(val_R, 0, 1024, 0, 255);         // Translate from Red knob voltage (1-1024) to led brightness (0-255)
 analogWrite(RED_LED, val_R);                      // adjust Red Led brightness based on knob voltage
 Serial.print("RED LED VALUE IS ");
 Serial.println(val_R);         

 int val_G = analogRead(Knob_G);                   // Get value from Green knob
 val_G = map(val_G, 0, 1024, 0, 255);         // Translate from Green knob voltage (1-1024) to led brightness (0-255)
 analogWrite(GREEN_LED, val_G);                    // adjust green Led brightness based on knob voltage
 Serial.print("GREEN LED VALUE IS ");
 Serial.println(val_G);

 int val_B = analogRead(Knob_B);                   // Get value from Blue knob
 val_B = map(val_B, 0, 1024, 0, 255);            // Translate from Blue knob voltage (1-1024) to led brightness (0-255)
 analogWrite(BLUE_LED, val_R);                     // adjust Blue Led brightness based on knob voltage
 Serial.print("BLUE LED VALUE IS ");
 Serial.println(val_B);

 int val_W = analogRead(Knob_W);                   // Get value from White knob
 val_W = map(val_W, 0, 1024, 0, 255);         // Translate from White knob voltage (1-1024) to led brightness (0-255)
 analogWrite(WHITE_LED, val_W);                    // adjust White Led brightness based on knob voltage   
 Serial.print("WHITE LED VALUE IS ");                                
 Serial.println(val_W);
}

I am trying to control a RGBW led strip

What strip us this then? Please link to it. Also please post your schematic. While you are at it please post the code correctly using the icon in the top left of the reply box, edit your first post rather than posting it again.

Did you write that code or did you just find it?

Untested.
Leo…

unsigned int potValue[5]; // five pots: dim=A0 red=A1 green=A2 blue=A3 white=A4
const byte redPin = 11, greenPin = 10, bluePin = 9, whitePin = 6;
byte redValue, greenValue, blueValue, whiteValue;
byte prevRed, prevGreen, prevBlue, prevWhite;

void setup() {
  Serial.begin(115200);
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
  pinMode(whitePin, OUTPUT);
}

void loop() {
  for (byte i = 0; i < 5; i++) potValue[i] = analogRead(i) >> 2;
  redValue = potValue[0] * potValue[1] / 255;
  if (redValue != prevRed) {
    analogWrite(redPin, redValue);
    prevRed = redValue;
    printRGBW();
  }
  greenValue = potValue[0] * potValue[2] / 255;
  if (greenValue != prevGreen) {
    analogWrite(greenPin, greenValue);
    prevGreen = greenValue;
    printRGBW();
  }
  blueValue = potValue[0] * potValue[3] / 255;
  if (blueValue != prevBlue) {
    analogWrite(bluePin, blueValue);
    prevBlue = blueValue;
    printRGBW();
  }
  whiteValue = potValue[0] * potValue[4] / 255;
  if (whiteValue != prevWhite) {
    analogWrite(whitePin, whiteValue);
    prevWhite = whiteValue;
    printRGBW();
  }
}

void printRGBW() {
  Serial.print("Dim:");
  Serial.print(potValue[0]);
  Serial.print(" Red:");
  Serial.print(redValue);
  Serial.print(" Green:");
  Serial.print(greenValue);
  Serial.print(" Blue:");
  Serial.print(blueValue);
  Serial.print(" White:");
  Serial.println(whiteValue);
  delay(100);
}