user59963: I have the following circuit
It has a simple dc motor that is OFF, and switches ON once a day for 2 seconds.
I use MOSFET IRF540N as a switch
I use L7805CV as a voltage regulator
I would like to have a review and to ask whether it is safe to connect this circuit to a 9v 1A (center+) DC wall plug.
I have measured the dc motor and it takes 60 mA when it is on with 5V.


user37523: The "Arduino" part of your schematic looks OK. 9 VDC to VIN on the Uno is OK. Connecting the MOSFET directly to the Arduino is OK.
Personally, I would connect a 1000 ohm resistor in series between the Arduino pin and the gate of the MOSFET. If you like to live dangerously like I do, and change wiring connections with power supplied to your Arduino, then a 1k resistor will limit the maximum current flow to around 5 mA. This is not going to "fry" anything if you inadvertently connect an output to power or ground.
The question about the L7805CV is off-topic, but a quick look at the datasheet suggests an input and output capacitor should be used.
I’m sorry to be the bearer of bad news, but the IRF540N is a poor choice as a MOSFET to use with a micro-controller. While it’s true that you are only drawing 60 mA, the VGS specified for this MOSFET is at 10 VDC, not the 5 VDC supplied by the Uno. A "logic level" MOSFET would be better suited for your application.
For more information regarding MOSFETs, please read: How to control a 12V solenoid valve with a mosfet?

59963: <p>I have the following circuit</p>

<p>It has a simple dc motor that is OFF, and switches ON once a day for 2 seconds.</p>

<p>I use MOSFET IRF540N as a switch</p>

<p>I use L7805CV as a voltage regulator</p>

<p>I would like to have a review and to ask whether it is safe to connect this circuit to a 9v 1A (center+) DC wall plug.</p>

<p>I have measured the dc motor and it takes 60 mA when it is on with 5V.</p>

<p><a href="https://i.stack.imgur.com/CTfKO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CTfKO.png" alt="enter image description here"></a></p>
 37523: <p>The "Arduino" part of your schematic looks OK. 9 VDC to VIN on the Uno is OK. Connecting the MOSFET directly to the Arduino is OK.</p>

<p>Personally, I would connect a 1000 ohm resistor in series between the Arduino pin and the gate of the MOSFET. If you like to live dangerously like I do, and change wiring connections with power supplied to your Arduino, then a 1k resistor will limit the maximum current flow to around 5 mA. This is not going to "fry" anything if you inadvertently connect an output to power or ground.</p>

<p>The question about the L7805CV is off-topic, but a quick look at the datasheet suggests an input and output capacitor should be used.</p>

<p>I’m sorry to be the bearer of bad news, but the IRF540N is a poor choice as a MOSFET to use with a micro-controller. While it’s true that you are only drawing 60 mA, the VGS specified for this MOSFET is at 10 VDC, not the 5 VDC supplied by the Uno. A "logic level" MOSFET would be better suited for your application.</p>

<p>For more information regarding MOSFETs, please read: <a href="https://electronics.stackexchange.com/questions/29065/how-to-control-a-12v-solenoid-valve-with-a-mosfet">How to control a 12V solenoid valve with a mosfet?</a></p>
