Arduino UNO Controlled Stepper Motor with Pushbutton Interface
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller, a pushbutton, an A4988 stepper motor driver, a bipolar stepper motor (NEMA 17), and a resistor. The Arduino UNO controls the stepper motor driver, which in turn drives the stepper motor. The pushbutton is used to provide input to the Arduino, and the resistor is used for current limiting.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
Pushbutton
- Description: A simple pushbutton switch.
- Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
A4988 Stepper Motor Driver Carrier
- Description: A carrier board for the A4988 stepper motor driver.
- Pins: ENABLE, MS1, MS2, MS3, RESET, SLEEP, STEP, DIR, GND, VCC, 1B, 1A, 2A, 2B, VMOT
Bipolar Stepper Motor (NEMA 17)
- Description: A bipolar stepper motor.
- Pins: A-, A+, B+, B-
Resistor
- Description: A resistor with a resistance of 200 Ohms.
- Pins: pin1, pin2
- Properties:
- Resistance: 200 Ohms
Wiring Details
Arduino UNO
- D11: Connected to Pushbutton Pin 4 (out), A4988 MS2, A4988 DIR
- 5V: Connected to Pushbutton Pin 4 (out), A4988 MS2, A4988 DIR
- D10: Connected to Resistor pin2
- GND: Connected to Resistor pin2
Pushbutton
- Pin 4 (out): Connected to Arduino D11, Arduino 5V, A4988 MS2, A4988 DIR
- Pin 1 (in): Connected to A4988 STEP
- Pin 2 (in): Connected to Resistor pin1
A4988 Stepper Motor Driver Carrier
- MS2: Connected to Pushbutton Pin 4 (out), Arduino D11, Arduino 5V
- DIR: Connected to Pushbutton Pin 4 (out), Arduino D11, Arduino 5V
- STEP: Connected to Pushbutton Pin 1 (in)
- RESET: Connected to A4988 SLEEP
- SLEEP: Connected to A4988 RESET
- 1B: Connected to Bipolar Stepper Motor B-
- 1A: Connected to Bipolar Stepper Motor B+
- 2A: Connected to Bipolar Stepper Motor A+
- 2B: Connected to Bipolar Stepper Motor A-
Bipolar Stepper Motor (NEMA 17)
- B-: Connected to A4988 1B
- B+: Connected to A4988 1A
- A+: Connected to A4988 2A
- A-: Connected to A4988 2B
Resistor
- pin2: Connected to Arduino D10, Arduino GND
- pin1: Connected to Pushbutton Pin 2 (in)
Documented Code
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
digitalWrite(10, LOW);
digitalWrite(11, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
}
This code sets up the Arduino UNO by configuring pins 10 and 11 as outputs. In the setup function, pin 10 is set to LOW and pin 11 is set to HIGH. The loop function is currently empty and can be filled with the main logic to control the stepper motor based on the pushbutton input.