2
\$\begingroup\$

I am following this schematic: http://www.electronoobs.com/eng_arduino_tut13_sch2.php

It uses a BD140 PNP transistor. I checked the wiring was correct. Basically, the transistor boosts the current when I set the Arduino PWM pin to 0 and should dim the LEDs when I set it to a value of 255. (PWM pins connect to a resistor and then to the body of transistor)

However, I noticed the blue is almost off, while the red and green are just sorta dim when I set all three pins to 255 (turn off or almost off). I'm guessing the blue just uses more current and that explains why I should use more resistance values on the red and green LEDS.

I also want to simulate this on LTSpice to explain what is going on but I'm not quite sure how to simulate a PWM voltage or the RGB LED strips.

I was thinking of just adding 500 ohms to the blue, and 1k to red and 1k to green, based on the brightness I see.

Any advice on how I can accurately determine the resistance needed to turn these LEDs almost off without just incrementally guessing?

Additional info: when the arduino is off but the power supply still supplies 12v to the rgb led strip, it is in full brightness for all 3 colors.

\$\endgroup\$
1
  • \$\begingroup\$ Blue LEDs normally require a higher forward voltage than red or green, that's why they're almost off while the other two are still dim. You will indeed need different resistor values to get the same current through them all. You could also use different PWM values for each to get the brightness the same. \$\endgroup\$
    – Finbarr
    Apr 4, 2018 at 8:17

1 Answer 1

4
\$\begingroup\$

You need a LOW side switch. Use NPN transistors instead of PNP.

Use a 10 K pull-down resistor at base to prevent false turn ONs due to noise.

schematic

\$\endgroup\$
3
  • \$\begingroup\$ isn't that just dividing the voltage of the pwm pin to the base? also, does the transistor characteristics suppose to allow high amps? I have some npn that are rated maximum at around 1A. the BD140 I believe is rated at -1.5A. \$\endgroup\$
    – Cit5
    Apr 4, 2018 at 6:38
  • \$\begingroup\$ also thank you for the answer, you're not the first to mention the switch to npn. \$\endgroup\$
    – Cit5
    Apr 4, 2018 at 6:42
  • \$\begingroup\$ Unless you share LED strip details, I can't suggest on max current ratings. But I can tell you how to select the part. Connect the 12V directly across each line one by one. You will get the peak current your strip is drawing (assume 1.2 A). Select a transistor which can handle more than this. Ex - a transistor which can carry 2 A or higher. Figure out the power dissipation in transistor - Major power will be Vce X Ic. Assume 0.6 V x 1.2 A = 0.72 watts. Pick a package that can handle this much power dissipation comfortably (ex - TO220 package should do it). \$\endgroup\$ Apr 4, 2018 at 6:56

Your Answer

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

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