PWM Not working? Answered
I have a circut with the following wiring and it works for what I have been doing, but I wan't to be able to dim the LED with PWM on the arduino. Right now the light is running at about 50 for the length on the analogWrite. There is really no difference between 50 and 255 in my opinion so I think something may be wrong. When the length drops below 20 the light doesn't even come on. This is for a bike light project and electronics aren't my strongest area. I am guessing there is some period of time the MOSFET needs to switch on and off and the arduino's PWM is just too fast for this but I am not sure. I have access to an oscilloscope so I can test to see if everything is working correctly as well. I just get meaningless jitter with an inner oblong sine wave when I have attempted to use it, so where would be the best points to attach the scope to get some meaningful data.
(anywhere I wrote PMW i meant PWM).
I would like to point out that the LED is Rated for 13V and I am running it on 11.1 V, so no problems there.
Aslo I got it working using a 10k resistor between the gate and ground, the arduino, on PWM mode doesn't sink the current very well.
I have included the correct diagram.