I just have issues with the RGB LED flickering under low duty-cycle like 10% on time with 780 Hz. I tried changing the PWM frequency to lower and higher rate but I still see flickering at low duty-cycle (on time). This flickering only happens when I connect a bunch of MCU (PIC18F87J11 with 8 MHz oscillator) to a single voltage source (15 volts). I need some feedback so I can understand what's causing the problem since I don't know a lot about electronics. Here is a quick summary about the issue.

With 1 MCU connected to 12 volts , regardless of the PWM frequency or the duty-cycle, there is no flickering at all.

The more MCU I add, the more flickering I would see. In my case, I have 15 MCU connected to 15 volts power supply. At low duty-cylce I see flickering of the RGB lights. However, at high duty-cycle there is no flickering at all. Also lowering the PWM frequency a little bit helps with flickering on low duty-cycle but overall the flickering is visible and annoying.

Some questions ..

  1. What is the best-recommend PWM frequecny for RGB lights?
  2. Can I still avoid this flickering without any hardware changes just software?
  3. Can you help me understand how and what's causing the flickering?


enter image description here

  • \$\begingroup\$ Can you show us the schematic for one "MCU"? Without this sort of detail, we'd only be guessing. Also, you used the "Arduino" tag. Is that at all relevant, or did you just throw that in to confuse us? \$\endgroup\$
    – Dave Tweed
    May 12, 2014 at 18:40
  • \$\begingroup\$ It could be some kind of "beat" frequency, but we won't be able to tell without more information. \$\endgroup\$ May 12, 2014 at 18:41
  • \$\begingroup\$ @DaveTweed, I added Ardunio tag since some folks from that world had similar issues and I thought any information/feedback would relate to PIC Microcontrollers. I can't really post the schematics for work reasons (I am not the one who designed the board) but I posted something that might/might not help. If you can come up with some answers of what you would suspect that would be appreciated. Let me know for further questions. \$\endgroup\$
    – Ammar
    May 12, 2014 at 18:56
  • \$\begingroup\$ Hopefully, this is a pointless question, but how fast are your LEDs flickering? I've seen something similar but the problem turned out to be that the LEDs themselves were built to blink. I'm not sure how those things behave under PWM. \$\endgroup\$
    – user30997
    May 12, 2014 at 21:19
  • \$\begingroup\$ Please! Please remove the Arduino tag. This has nothing to do with it. It is like trowing a tag air-conditioning, because someone that have air conditioner have similar problem. \$\endgroup\$
    – zzz
    May 12, 2014 at 21:20

2 Answers 2


Quick answer - no, you can't make this work without some hardware changes.

I certainly hope you're not connecting your PICs to 15 volts. They're only rated for 3.6 volts.

Your MOSFET is not an IRL734. It might be an IRF734. In which case, I don't see how you're getting any output at all from the LEDs. What you want to do is connect the top of the LED chain to +12, and the bottom to a resistor. The other end of the resistor goes to the drain of the MOSFET, and the source goes to ground. If you know the operating current and voltage of the LEDs (and I hope you do), then the value of R is

R = (12 - (3 x Vf)) / i, where i is in amps.

Your driver would work (very briefly) if the PIC output were 12 volts, but it's not. I say briefly, because in very short order at least one of the LEDs would burn out. That's why you need a current limiting resistor.

Even with these changes, the circuit may not work well. The problem is that the PIC runs off 3.6 volts (max), while the threshold voltage for an IRF734 is two to four volts. And besides, the IRF734 is a 450 volt MOSFET, which is way overkill.

Given your obvious errors in circuit description (PIC voltage and MOSFET model), I suggest you go back to your source and provide a more complete (and accurate) description.

For what it's worth, 780 Hz is about 10 times faster than you need, but it ought to work just fine.

  • \$\begingroup\$ I am using IRLZ34 and I do have a voltage regulator, but again I am not the designer of the board. I am just trying to see if I can fix this issue with software (if possible). Once I rule out its not software, I will shift to hardware, but for now any answers are welcomed. At least the feedback should help me understand more about the problem. Thanks! \$\endgroup\$
    – Ammar
    May 12, 2014 at 22:17
  • \$\begingroup\$ OK. IRLZ34. Your handwriting is even worse than mine (ha!). The driver still won't work. Put it this way - the gate has to be higher than the source by about 2 volts, right? Well, for a 3.3 volt PIC output, if it is to be turned on the source must be less than about 1.3 volts. And that won't turn on one LED, let alone 3 in series. \$\endgroup\$ May 13, 2014 at 0:55

Here's a quick schematic of an LED driver, using part numbers for the LEDs found in the schematic editor. And I thought my handwriting was bad.


simulate this circuit – Schematic created using CircuitLab

And I still don't understand the flickering, since I don't see how they get turned on in the first place.

  • \$\begingroup\$ Let's assume the way I turn them on is correct, can you help me understand why at low duty-cycle I see the flickering compared to high duty-cycle? With 1 MCU connected to 12 volts, everything works perfectly fine whether the duty-cycle is low or high. Adding more MCUs and connecting all of to one single power source works without flickering at high duty-cycle. Why does it flicker on low duty-cycle? I just need to understand that part if you could elaborate. Thanks! \$\endgroup\$
    – Ammar
    May 13, 2014 at 17:48

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.