Arduino/ Circuit Help

Hi, I was really hoping someone could help me with my project. (Full disclosure, I’m not an engineer or very knowledgeable about electronics/code so I’m certain there are basic concepts that I’ve totally missed)

What I want, is to control a bunch of LEDs using a website through an Arduino Yun. However the LEDs I need to use are high power ones and require more juice than the Yun can provide.

I’m currently using some MOSFET transistors that should be able to be turned on/off by the digital pins on the Yun.
But this is where I’m having trouble, I can’t get the LEDs to turn on/off (they just stay on but the arduino LED(pin13) can be turned on/off using my code) and I’m not sure if its the transistors I’m using, the way I’ve wired my circuit, the code or even something else.

If someone could help me with my circuit and code I would be really grateful. And If I’ve missed any important info please let me know and I’ll do my best to post it.

I’ve added a basic circuit diagram, my code and I’ll link the components I’m using.

MOSFET Transistors

Resistors (1) (2) (3)

White LEDs

Amber LEDs

Red LEDs

Green LEDs

Blue LEDs

LED_Code_v5.ino (5.08 KB)

Hi, PFETs are OFF when their gate is at source voltage, 12V in this case.

How are you connecting Arduino to them??

[u]Here is a schematic[/u] for a MOSFET driver. (You can skip the flyback diode since your load is non-inductive.)

  • You need an N-channel MOSFET (with the load on the +voltage side) because it’s the gate-source voltage that controls the MOSFET. (A P-Channel MOSFET would require 12V at the gate, for no voltage difference between the gate & source, to turn it off.) So, you can use a P-channel MOSFET, but you’d need another MOSFET or transistor to drive it…

  • You need a logic level MOSFET since you want to switch it with 5v.

DVDdoug:
[u]Here is a schematic[/u] for a MOSFET driver. (You can skip the flyback diode since your load is non-inductive.)

  • You need an N-channel MOSFET (with the load on the +voltage side) because it’s the gate-source voltage that controls the MOSFET. (A P-Channel MOSFET would require 12V at the gate, for no voltage difference between the gate & source, to turn it off.) So, you can use a P-channel MOSFET, but you’d need another MOSFET or transistor to drive it…

  • You need a logic level MOSFET since you want to switch it with 5v.

DVDdoug, thanks for the link. In it, and few other guides, it shows the load between the +ve and the MOSFET. All my LEDs are on a PCB and connect to a single ground before leaving the PCB. Is there any way to have the MOSFET before load? or way of wiring it so there are 6 separate signals going to the LED PCB and then leaving from the single ground?