Circuit Documentation
Summary
This circuit consists of an Arduino UNO microcontroller connected to a Bipolar Stepper Motor (NEMA 17). The Arduino UNO controls the stepper motor by sending signals to its coils, allowing precise control over the motor's rotation.
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
- Purpose in Circuit: To control the Bipolar Stepper Motor.
Bipolar Stepper Motor (NEMA 17)
- Description: A type of stepper motor with two coils, allowing for precise control of rotation.
- Pins: A-, A+, B+, B-
- Purpose in Circuit: To be driven by the Arduino UNO for precise rotational movement.
Wiring Details
Arduino UNO
- D11: Connected to A- of the Bipolar Stepper Motor
- D10: Connected to A+ of the Bipolar Stepper Motor
- D9: Connected to B+ of the Bipolar Stepper Motor
- D8: Connected to B- of the Bipolar Stepper Motor
Bipolar Stepper Motor (NEMA 17)
- A-: Connected to D11 of the Arduino UNO
- A+: Connected to D10 of the Arduino UNO
- B+: Connected to D9 of the Arduino UNO
- B-: Connected to D8 of the Arduino UNO
Code Documentation
Arduino UNO Code
#include <Stepper.h>
const int stepsPerRevolution = 200; // Change this to match your motor's specifications
// Initialize the stepper library on pins 10, 11, 9, 8
Stepper myStepper(stepsPerRevolution, 10, 11, 9, 8);
void setup() {
myStepper.setSpeed(60); // Set the speed in RPM
}
void loop() {
myStepper.step(stepsPerRevolution); // Move one full revolution
delay(1000); // Wait for a second
myStepper.step(-stepsPerRevolution); // Move one full revolution in the other direction
delay(1000); // Wait for a second
}
This code initializes the stepper motor on pins 10, 11, 9, and 8 of the Arduino UNO. It sets the motor speed to 60 RPM and continuously rotates the motor one full revolution in each direction with a one-second delay between movements.
