Hi,
I am generally new to arduino programming. I was given the task of making an LED strip that needs to change color using an Arduino. (In this case I use Arduino Uno ATMEGA 328P).
The scheme I used for connecting everthing:
The differences between the scheme and what I connected is that instead of 12V, I put 5V directly on the arduino and ports red,green and blue that are connected to the arduino are different. In sheme it is 5,6,9 but I connected them in 3,5,6 .
For the LED strip, I use 5V 50cm RGB with 4 ports (R, G, B, 5V).Here is a link to the strip:
I read that MOSFETs should also be used, so I bought these on the professor's recommendation:
https://www.ad-electronic.hr/index.php/poluvodiči%20-%201085/tranzistori%20-%201086/irf9520-p-fet-100v-6,8a-60w-0,6r-to-2206291426-detalji
Since the tape uses 4 ports, which are R, G, B, 5V, and I don't know how to weld, I decided to connect it to the board. Here's a picture of what it looks like:
All the way to the right is that white cable that is connected to the breadboard is from strip and split into 4 ports as I said. The first red (left) wire is 5V, the green wire is G, the second red is R and the blue wire is B(written up on the strip).
When i connect the arduino to the computer the bar lights up white. I made the code so that instead of white it is only red and the color does not change (just for testing):
const int redPin = 3; //it is also physically connected
const int greenPin = 5; //it is also physically connected
const int bluePin = 6; //it is also physically connected
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
analogWrite(redPin, 255);
analogWrite(greenPin, 0);
analogWrite(bluePin, 0);
Serial.begin(9600);
}
void loop() {
}
When the code is sent to the arduino nothing changes(still white). I thought it was because maybe there is no other color but when you unplug one of the R,G,B ports the color changes. I use that code because I think this tape is analog. Any help or instructions on what to do next, I'm stuck and I don't know what to do next?











