Using push button switch to turn on motor driven by transistor suggestions

I have a DC Motor (6-12V, 0.8amps) connected to my arduino driven by a transistor (speed control using pwm analogWrite()). Now I am planning to connect a 2 pin reset push button switch (https://sharvielectronics.com/product/push-button-red-steel-switch-reset-spst/ ) to run the motor directly whenever the switch is pressed.

Since already one end (+ve) of the motor is connected to +12V of the supply and the other end connected to the collector of the transistor, I intend to connect the -12V of the supply to one pin of the switch and the other pin of the switch to the collector (which has the other end (-ve) of the motor connected). So that when the switch is pressed, the motor will run irrespective of transistor being on or off. Any precautions to be taken while connecting this way?

Your switch needs to be able to handle the required load current.


You can also make the transistor circuit into an OR gate then use the switch with the base side to control the collector.

larryd:
Your switch needs to be able to handle the required load current.


You can also make the transistor circuit into an OR gate then use the switch with the base side to control the collector.

Small correction. It is a 5V dc motor (200mA).

Thanks for your inputs. Also I have 12V solenoid connected to a mosfet which is being driven by the same arduino by a different digital pin. The whole system is powered by a 12V adapter which is connected to a LM2596 DC DC booster. The LM2596 converts the 12V to 5V. 12V input is used to power the solenoid and 5V output is used to power arduino and the motor. The 12V- and 5V- are shorted together on the board itself. So can I connect the same switch to run the motor and solenoid together ?

My switch can handle 3 amps of current.

Picture attached of the transistor (2n2222a) and mosfet (P90nf03l) configuration in my circuit.

So, if one end of the switch is connected to 12v- and 5v- pins and other end of the switch is connected to both the negative pins of the motor and solenoid (collector of transistor and drain of mosfet), will it be a problem when I run my normal code (where i turn on/off solenoid and motor) when not using the switch ?


Placing a switch from Collector to Emitter OR Drain to Source in these circuits is okay.

Call it a manual on switch :slight_smile:

Just remember, when the Arduino sends a HIGH to the transistor, the switch will not be able to stop the motor ;).

Keep in mind, the motor will be running at top speed when the switch is engaged.

aarg:
Keep in mind, the motor will be running at top speed when the switch is engaged.

Yes that is what I want it to do. Otherwise in my program it is usually running only at about 75% of its speed.

I recommend using the alternate approach mentioned in reply #1. It will allow you to use any switch, and the switch contacts will last longer.

larryd:


Placing a switch from Collector to Emitter OR Drain to Source in these circuits is okay.

Call it a manual on switch :slight_smile:

Just remember, when the Arduino sends a HIGH to the transistor, the switch will not be able to stop the motor ;).

Yes I get that. But I just wanted to make sure connecting the same switch for both the motor and solenoid which operate at different voltages wont cause any issues.

Yes, it will cause an issue. If you connect the solenoid and motor terminals, current from the 12V circuit will conduct through the motor, through the protection diode on the solenoid, and into the 5V supply. This will permanently energize the motor.

aarg:
Yes, it will cause an issue. If you connect the solenoid and motor terminals, current from the 12V circuit will conduct through the motor, through the protection diode on the solenoid, and into the 5V supply. This will permanently energize the motor.

I am only connecting the negative together. Not the positive ends. Like the image attached below.

My intention is to turn on the solenoid and motor together, when the switch is pressed. And turn off when not pressed.
Motor is rated for 6 volts maximum.

would this setup in the image work ?

The operative word was “OR”.

Use a DPST or DPDT switch.