Dimming ledstrip issue

I'm new so I don't really know where to post this, feel free to move it to where it belongs.

I'm having a small issue when I set the analogWrite to less than 20, my led strip starts to flash/flicker etc..
Above 20 works fine (can provide a video if needed). So I'm just wondering what causes this issue.

I'm basically using these schematics with an arduino nano:
(gray cable is connected to 12v pw supply, not 9v from arduino)

The power supply I'm using is 12V 2A. And for the transistor/fet I'm using IRF840 (pdf)

The IRF840 that you used was not logic level MOSFET, it need about 10V to fully conduct.
The 1 K ohms resistor was too high, so the current will be a-lot less when the analogWrite to less than 20, so led strip starts to flash/flicker.

You need to use logic level MOSFET and have the gate resistor with value from 150 to 220 ohms and 10K ohms resistors from MOSFET gate to ground.

BillHo:
The IRF840 that you used was not lo…

Thanks for the quick reply. Kind of suspected it to be the mosfet. Could you link to a mosfet that would be suitable for the project? I really have no idea what to look for.

Try this
FQP30N06L a logic level mosfet

BillHo:
Try this
FQP30N06L a logic level mosfet

Thanks, will check it out.
Just want to add that I get the same result using a BC337 transistor (pdf) and no resistors. (I'm really new to this so I don't really know what I'm doing). Maybe my arduino is broken?

I wonder if there's anything "odd" about your LED strip... Is it just LEDs and resistors?

Or, maybe it's your power supply. Try putting an LED & resistor between power to the LED strip (white in your diagram) and ground to see if it flickers when the LED strip flickers.

DVDdoug:
I wonder if there's anything "odd" about your LED strip... Is it just LEDs and resistors?

Or, maybe it's your power supply. Try putting an LED & resistor between power to the LED strip (white in your diagram) and ground to see if it flickers when the LED strip flickers.

Thanks for the suggestion, might give it a try.

I was able to remove the flickering by adding a 10 Ohms resistor from source to ground (don't know why this works?), but this only gives me about 50-60% of the light. This might be because of the mosfet I'm using.