'Recognizing the need is the primary condition for design.'

Charles Eames

'To design is to communicate clearly by whatever means you can control or master.'
Milton Glaser

Simple DC motor control, one button start / stop

Components Required: 

 

1X DC motor 3.5-5V

1X DC motor controler MosFet board

1X Push button switch

1X 10k resistors

1X 9V battery

1X 9V battery connector

(1 X small X head electrical screw driver) 

Wiring Instructions:

Use the instructions below with the image gallery to connect the components as follows:

 

 

5V + and - GND power from micro controller board to breadboard

1: Connect the 5V+ on the mega board to the + red rail on the breadboard, then connect the GND on the mega board to the - blue rail on the breadboard. 

 

DC motor and Mos Motor Controller (the mos controller has 2 terminal blocks, one for the DC motor, one for the Battery input and one for the microcontroller connections.)

 

Motor and Battery -> Mos controller (do not touch the battery wires togeather)

2: Connect the Left termial block on the mos motor controller V+ to DC motor + wire then connect the V- on the mos motor controller to the - wire on the DC motor.

Then, connect the Right terminal block on the mos motor controller to VIN + to battery + wire, then connect the GND on the mos motor controller to the - battery wire. 

 

Micro controller -> Mos controller

2.1: Connect the SIG input on the mos motor controller to Pin 9 on the micro controller board, then connect the VCC and GND on the mos motor controller input pins to 5V + and 0V- on the breadboard power rails. 

 

Switch
3. Connect one terminal of the switch to digital pin 2 of the Arduino Mega. Connet the other terminal to 5V+ on the breadboard power rail. Then, connect a resistor between the switch digital pin connection and the - (GND) rail on the breadboard. (see pictures) This protects the switch from overload.

 

Simple LED indicator Expansion:

You could try to add a LED light indicator in series with the pull up resistor on the switch circuit to indicate when the motor is running. This would add an additional safety feature to the circuit. (See images) 

 

Gearbox (optional)

4: If you want to take the power from the DC motor pin and connect it into a gear box or other device this can add additional mechanical speed and power to your DC motor system. 

 

Add the code below with the Arduino IDE compiler to your microcontroler:

const int switchPin = 2;
const int motorPin = 9;
int switchState = 0;
void setup() {
  pinMode(motorPin, OUTPUT);
  pinMode(switchPin, INPUT);
}
void loop() {
  switchState = digitalRead(switchPin);
  if (switchState == HIGH) {
    digitalWrite(motorPin, HIGH);
  } else {
    digitalWrite(motorPin, LOW);
  }
} //end of loop()

 

Code for DC motor control on switch
Code for DC motor control on switch.rtf
Text document [50.0 KB]
Print | Sitemap
© Julian Kupper