Sorry if this topic is already discussed, I couldn't find anything.
(Also I am very new to the arduino world. )
I am trying to control an LED light panel. For the most part the controls seem to be working, however I am not able fully turn the panel off. It goes from about 10% to 100%. I was mostly trying PWM to have a very slow dim but it never fully went off. Also tried just having the panel turn on and off every couple seconds to make sure, still no.
Setup:
AC/DC adaptor from the wall ~ 12V, 2A output
connected to my bread board
using a Mosfet transistors [IRF520] to split the ground
I attached a photo of the arduino setup, and a video of the panel (the auto exposure is affecting the brightness, however you should be able to get the idea)
I am thinking it is likely the MOSFET being improperly sized, but am not sure where to look to get that information, or how to properly read it.
The end goal for the project will hopefully be painting on the panel and having an illuminated painting, possibly which changes lighting with the time of day. Or at least this is my starting idea.
Double-check which pins are the drain, gate and source on the mosfet, it looks to me like it might be wrong.
If you have trouble with not being able to turn it "off" :
You need to make sure that the voltage of the gate terminal of the mosfet goes to zero, when you want to turn it off.
Try this:
Instead of just running the pwm to a low frequency, stop doing pwm on the output pin, set it as a digital output, and then set it to digital low. This should drive the gate of the mosfet low, and turn the lights off. The problem I am expecting here, is that when you turn the pwm down , you are not turning it off. It is still running on a low frequency or low duty cycle which is keeping the light running.
Another thing you can do, is connect a resistor between the gate terminal of the mosfet, and the ground. You do this, so that when the arduino switches off, the charge in the gate terminal of the mosfet has somewhere to discharge to. A resistor maybe 20k would be appropriate. This also helps to ensure that the gate voltage of the mosfet goes to zero, when you want the light to be off.
it looks like you are not on pin5 or pin6, but just in case:
The PWM outputs generated on pins 5 and 6 will have higher-than-expected duty cycles. This is because of interactions with the millis() and delay() functions, which share the same internal timer used to generate those PWM outputs. This will be noticed mostly on low duty-cycle settings (e.g 0 - 10) and may result in a value of 0 not fully turning off the output on pins 5 and 6.
Thanks for all your help!
I went back into it for the past hour or so and kept rewiring it to see what it could have been taking all of your advice into play. So as it turns out I did have the drain and source backwards which didn't help, however the main problem was that I had the positive and negative switched on both the light panel and wall plug. So it was doing all sorts of strange things. Sorry, total dumdum move.