FT232RL, ATMega328P and MOSFET

Hello,

I'm working on a small 10x10 led controler, connected by USB, and able to be used also in 'stand alone'.
My problem is I'm not completely sure about the way i'm using a MOSFET to control if I need to connect USB VCC to the 5+VCC of the Atmega (when I plug an external source of curent, I should cut. When the USB go into idle mode, I should also cut the connection, and all that is managed by one mosfet).

I'm using a tension dividor (I expect the input tension to be between 9V and 12V +-1V, and that's why there is a 5V regulator). Because of that, I should also use some diode to prevent the current to flow from the external source to the FT232 or VUSB, and then burn a lot's of things.

But I'm not sure about the voltage drop resulting from using this diode, and if I should use an other one (I mesured 0.20~0.30V of drop using 9V).

The mosfet datasheet says I should have less than 0.40V drop (http://www.irf.com/product-info/datasheets/data/irlml6402.pdf) to block completely the current. I hope the voltage drop resulting from the diode is smaller than 0.4V :confused: (Vgs(th) = 0.40 -> 1.2)

Here the mosfet datasheet : http://www.irf.com/product-info/datasheets/data/irlml6402.pdf
The FT232 documentation : http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf

And here my schematic I would like you look to : http://i50.tinypic.com/10hlrpg.png

If you have any advice, idea, correction, pleese tell me. I'm a newbe and I'll like to learn more :slight_smile:

Thanks,