Circuit for RGB Led strip not working

So I’m trying to set up the following circuit to make the led strip change colors when sound levels change. I’m using 3 2N551 transistors instead of the ones in the picture. A 12 adaptor powers up the breadboard and I’m using 4 resistors in a potential divider circuit to supply the arduino with a 9V supply from the breadboard.

My problem is that the led strip does not change colors. When I plug it in directly to the 12V supply,all 3 colors light up and when I connect it the potential divider circuit it only shows red. It is supposed to change colors as sound detected by the sensor changes (I’m using the KY038 Module), but so far nothing happens. I can see the detected sound changing on the serial monitor and a previous circuit for a rgb bulb was working fine. Any suggestions?

This is the sketch I’m trying to run:

int red_light_pin= 11;
int green_light_pin = 10;
int blue_light_pin = 9;

int soundSensorPin = A0;        // Sound Sensor is connected to
int analogValue = 0;
int minVal = 1000;
int maxVal = 0;

void setup() {
  pinMode(red_light_pin, OUTPUT);
  pinMode(green_light_pin, OUTPUT);
  pinMode(blue_light_pin, OUTPUT);

void loop(){
  int diff = 472 - analogValue;
  analogValue = analogRead(soundSensorPin);

  if(abs(diff) <= 2){ 
    RGB_color(0, 255, 0); //Green
  else if(abs(diff) <= 5 ){
    RGB_color(255, 255, 0); // Yellow
  else{ //522
    RGB_color(255, 0, 0); //Red

void RGB_color(int red_light_value, int green_light_value, int blue_light_value)
  analogWrite(red_light_pin, red_light_value);
  analogWrite(green_light_pin, green_light_value);
  analogWrite(blue_light_pin, blue_light_value);

The OPs image

Let us see your ‘actual’ circuit wiring.

You use a proper transistor, you need a ‘logic level’ MOSFET IRL540 will do; notice the letter L in the part number.

Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu.
[code]Paste your sketch here[/code]

Thank you for your response! I’ve edited the original post to include the sketch I’m trying to run, will incorporate the IRL transistors into my circuit once I’ve bought them from the local electronics store.

When you say ‘actual’ circuit wiring, do you mean pictures of the actual breadboard circuit?

“ When you say 'actual' circuit wiring, do you mean pictures of the actual breadboard circuit?”


Your pin assignments don't match the schematic image.