Pin voltage problem

I need to activate an IRF530N from Arduino. I hooked the output pin through a 220 Ohm resistor and connected gate to source with a 10k one. For testing I connected an LED to the mosfet. When the output is set to high the LED doesn't light up, though if I connect the gate to the 5v rail everything works fine.
I tried connecting the output pin directly to the LED and the light is much dimmer that when connected to 5v.
I suppose the output voltage of the pin is much lower than 5v.
I don't explain myself why the voltage is so low... the nano board I'm using is brand new and the only other thing I have connected is an I2C LCD, though nothing changes if I try without it.
how can I work around this and make the mosfet work?

Thank you

davidoskky:
For testing I connected an LED to the mosfet.

How?

Cathode to drain, anode to 5v through 220 ohm resistor

Did you set the pin to OUTPUT with pinMode();

The IRF530N is not a logic level mosfet, and won't get in full saturation with 5volt at the gate.
It might just work with a light load.
Leo..

That's not a logic level MOSFET. It needs about 10V on the gate to switch on fully. You might have more luck with an IRL530 which is the logic level equivalent.

Steve

But with light load, like a single LED, it should work just fine.

I bed he did not set the pin to output :slight_smile:

Wawa:
Did you set the pin to OUTPUT with pinMode();

Thanks that was it... I made someone else write the code and I just assumed it was right!
Thanks to everyone for helping me out; now that it works I'll gladly go out and take an actual logic level mosfet.