0
\$\begingroup\$

I'm working on a project to control a white LED strip (SMD5630) with an Arduino Mega (ATmega2560) using N-Channel MOSFETs (IRL530). The goal is to dim the lights using PWM signals through the digital pins on the Arduino. The problem is the LEDs don't reach anywhere near the same brightness as when directly connected to a 12V power source.

This is the circuit setup:

arduino breadboard circuit

This is the Arduino code I'm using:

// digital pin being used
#define PIN 2

void setup() {
  // put your setup code here, to run once:
  pinMode(PIN, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  analogWrite(PIN, 255);
}

The LED strips draw approximately 1A of current per meter.

The MOSFET is designed for a 5V gate voltage, so it should be compatible with the Arduino.

I've verified the connections, but the LEDs just aren't usable at the max brightness the Arduino is able to achieve. Not sure where to go from here, so any insights or suggestions on what might be causing this discrepancy in brightness would be highly appreciated! Thanks in advance for all the help.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Is that a 220 ohm on the gate to ground? If you have a 5 V Arduino board that's nearly 23 mA being wasted. Some 5 V Arduino boards claim a 40 mA source/sink max but also say it should be limited to 1/2 that value for a continuous output (20 mA). With the maximum duty cycle the output is basically continuous. While that may not be the main problem try using a resistor 3x or 4x that value. \$\endgroup\$
    – Nedd
    Nov 10, 2023 at 2:02
  • \$\begingroup\$ @Nedd you are a saviour! I swapped the resistors in the circuit with some 10K ohm resistors I had lying around and that solved the brightness issue immediately. Turns out the voltage across the 220 ohm resistor was only 2V (below the gate voltage required) compared to the 5V I now get across the 10k ohm resistor. Thanks again for the help, I was starting to loose my mind. \$\endgroup\$
    – TheEshan
    Nov 15, 2023 at 23:03
  • \$\begingroup\$ Glad to help, keep on designing. \$\endgroup\$
    – Nedd
    Nov 15, 2023 at 23:07

1 Answer 1

2
\$\begingroup\$

The contact resistance in cheap solderless breadboards can range from a few tenths of an ohm to almost one ohm. So about 100 mA is the practical maximum current. You have 6 contacts in your LED path so the voltage drop could be significant. Measure some of the voltage drops yourself and see.

\$\endgroup\$

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.