1
\$\begingroup\$

This is scheme:

Transistors: BD912, PNP, 15A, 100V, 90W, TO220.

scheme

And this is color of "black":

black strip

and this is code:

const int redPin = 5;
const int greenPin = 6;
const int bluePin = 3;

void setup() {
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

void loop() {

  analogWrite(redPin, 255);
  analogWrite(greenPin, 255);
  analogWrite(bluePin, 255);

}
```
\$\endgroup\$
4
  • \$\begingroup\$ The question contains the text should be black but its red. From looking at the picture the actual LEDs appear to be white rather than red. It is the material of the strip which is showing as red. \$\endgroup\$ Commented Dec 2, 2023 at 23:18
  • \$\begingroup\$ There are white LEDs shown here, which is bizzarre if you really have a simple RGB chain as you claim (are you sure they aren't WS2812 or similar? if so, 12v may have caused damage) ... Do the white LEDs move around and/or flicker? Do you only see Red with occasional White? Can you clarify what you mean by "reversed colors"? (e.g: what happens if you try to show Red / Green / Blue?) ... don't forget to revise the use of transistors (as already mentioned in an answer). \$\endgroup\$
    – Attie
    Commented Dec 3, 2023 at 0:08
  • \$\begingroup\$ Reverse: AnalogWrite(red, 255) should be max value of color instead its minimum any led is flickering I dont know what is this strip this is first cheappest led strip i could find \$\endgroup\$
    – Adamoss
    Commented Dec 3, 2023 at 14:16
  • \$\begingroup\$ And this is not argb this is normal rgb strip \$\endgroup\$
    – Adamoss
    Commented Dec 3, 2023 at 14:26

2 Answers 2

7
\$\begingroup\$

Looks like you have a pictorial diagram that is intended to use N-channel MOSFETs and you've subsituted BD912 PNP transistors (without base resistors).

If accurate, that's not going to work and you may have damaged the Arduino.

\$\endgroup\$
7
  • \$\begingroup\$ Can you advise me which tranzistor i should buy? \$\endgroup\$
    – Adamoss
    Commented Dec 3, 2023 at 11:09
  • \$\begingroup\$ Can I use IRFZ44N IR N-MOSFET? \$\endgroup\$
    – Adamoss
    Commented Dec 3, 2023 at 12:07
  • \$\begingroup\$ No, IRLZ44 is suitable for 5V drive. IRFZ44 is not! \$\endgroup\$ Commented Dec 3, 2023 at 15:55
  • \$\begingroup\$ then which I should use? \$\endgroup\$
    – Adamoss
    Commented Dec 3, 2023 at 17:55
  • \$\begingroup\$ IRLZ44 is suitable from a drive point of view. There are many others but most are SMT so not easy to breadboard. \$\endgroup\$ Commented Dec 3, 2023 at 19:08
3
\$\begingroup\$
const int redPin = 5;     // Red is wired to pin 6.
const int greenPin = 6;   // Green is wired to pin 9.
const int bluePin = 3;    // Blue wired to pin 5.
\$\endgroup\$
4
  • \$\begingroup\$ I changed this on my board \$\endgroup\$
    – Adamoss
    Commented Dec 3, 2023 at 11:08
  • 2
    \$\begingroup\$ @Adamoss, then fix your question. We can only go on the information you have provided. \$\endgroup\$
    – Transistor
    Commented Dec 3, 2023 at 13:25
  • \$\begingroup\$ I changed pins and same issue, when i write normal colors like 255,0,0 - sea blue 0,255,0 it is purple \$\endgroup\$
    – Adamoss
    Commented Dec 3, 2023 at 14:19
  • 3
    \$\begingroup\$ Your question needs to be coherent and consistent. Fix the code to match the wiring cartoon and the photograph. \$\endgroup\$
    – Transistor
    Commented Dec 3, 2023 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.