How to control a 12v motor with a momentary switch

I'm trying to use an Arduino nano or similar sized board to control a 12v motor with a mosfet and momentary switch.

The behavior I would like is as follows:

When switch is open, turn motor on.
When switch is closed, turn motor off.

I found this example for the button component

https://docs.arduino.cc/built-in-examples/digital/Button/

But I'm having a difficult time figuring out how to connect that to the mosfet.

From your description, I don't see the need for an Arduino or a MOSFET.

So long as your momentary switch can handle the motor current.

1 Like

Except the behavior of the switch is reverse. Normally, when closed, the motor would be on. I want the motor off.

The motor is also 12v dc and i belive the power off the arduino is only 5v. So I need the arduino to send a signal to the mosfet to send power from a 12v battery to the motor when the switch is opened.

NC momentary buttons are considerably cheaper than an Arduino.

1 Like

Is this what you really meant?

When switch is not pressed, turn motor on.
When switch is pressed, turn motor off.

Solution: use a normally closed switch. No arduino or MOSFET required, but check the switch is rated for the motor current.

Correct, the Arduino is only 5V, and even if the motor was 5V, the current would be too high for Arduino.

But even if you truly need the motor to be on when the switch is open, you still don't need an Arduino.

Just pull the MOSFET gate up to 12V with a 10K resistor and connect the switch between the MOSFET gate and ground.

1 Like

I'm having a hard time wrapping my head around this. How does simply adding a resistor and mosfet reverse button function?

I guess I should add that i don't want any of the battery current to pass through the switch. The switch is more of a capacitive sensor than a simple switch.

So I will have two leads, that when closed, or shorted by a conductive material, will send a signal to the motor to turn off.

The resistor pulls the MOSFET gate up to 12V, turning the MOSFET and the motor on.

When you push/close the button, this will pull the MOSFET gate down strongly, overcoming the pull-up resistor and switching the MOSFET and motor off.

Does this thread help?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.