So I have been posting on this colour organ that I've been working on that keeps giving me grief. The most recent problem is very similar to a response I gave in one of my previous posts, although I don't believe I provided sufficient documentation to provide the full picture. The current issue that I am faced with is whenever I power the Arduino with an external power source (12v), the colour organ (green and red LED) does not turn on at all but the LED strips worked (pulsing). This means there is no voltage reading above the threshold but that can't be since it works fine when it is powered by the USB cord. If we try powering the Arduino with the 9v battery, the colour organ just stays on and the LED strips barely turn on. The external power to the power jack (7v) works but really poorly. The lights are substantially less reactive and the colour organ light is very low. My question is this: Why does the performance of the system vary so much when I change power sources? How do I power my system without the USB port so that I can move my project around?
Any help at all would be much appreciated!!
If we try powering the Arduino with the 9v battery, the colour organ just stays on and the LED strips barely turn on. The external power to the power jack (7v) works but really poorly
I'd guess that you are not really powering the LEDs with a separate power supply.
And/or, make sure there is a common ground shared by the LED power supply and the Arduino circuitry.
The LED strip doesn't have a ground pin but the RGB pins are plugged into the Arduino. The external power (12v), as well as the 9v, are also hooked up to the Arduino as well. I'll edit the main post to try and get the pictures visible.
Your main problem may be that you're not using a "logic level" MOSFET. Your MOSFET has a VGS of 10V, but the Arduino's I/O pins only put-out 5V.
(And, The MOSFET grounds and the 12V power supply ground need to be tied to the Arduino ground.)
I'd recommend that you write some simple test code to turn on & off & dim the LEDs. That will allow you to test the LEDs separately from the software and independently from any inputs.
Do you have a multimeter to make sure the voltages are "holding up" when the thing is running?
You can also measure the voltage across the LEDs & MOSFETS. When the LED strip is fully-on (no PWM dimming), you should have the full 12V across the LED strip and almost nothing across the MOSFET.
Initially, I had the LED strips directly connected to the Arduino pins but still ended up with the same issue. As you have rightly pointed out, I am not using logic level MOSFETS. Would something like this work better?
Update:
So I found a solution to my power issue. I simply added a 10k resistor from the analog pin to ground to act as a pull-down resistor and now my circuit works fine with external power. Who knew one small thing could cause such a big problem! Thanks to everyone that gave suggestions on what to do!!