Circuit Documentation
Summary
This circuit is designed to control a small Adafruit gear-reduced stepper motor using an Arduino UNO microcontroller and a ULN2003A breakout board. The Arduino UNO sends control signals to the ULN2003A, which in turn drives the stepper motor. The circuit is powered by the Arduino's 5V output, and the ground is shared across the components. The stepper motor's steps are controlled by digital pins D8 to D11 on the Arduino UNO, which are interfaced with the input pins of the ULN2003A breakout board.
Component List
Adafruit Gear-Reduced Stepper Motor (small)
- Description: A small stepper motor suitable for a wide range of applications.
- Pins: RED, ORANGE, YELLOW, PINK, BLUE
ULN2003A Breakout Board
- Description: A breakout board for the ULN2003A Darlington transistor array, used for driving stepper motors.
- Pins: In 1, In 2, In 3, In 4, In 5, In 6, In 7, 0V, +5V, ON/OFF jumper switch, BLUE wire, PINK wire, YELLOW wire, ORANGE wire, RED wire
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, widely used for building digital devices and interactive objects.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0 to A5, SCL, SDA, AREF, D0 to D13
Wiring Details
Adafruit Gear-Reduced Stepper Motor (small)
- RED connected to ULN2003A RED wire
- ORANGE connected to ULN2003A ORANGE wire
- YELLOW connected to ULN2003A YELLOW wire
- PINK connected to ULN2003A PINK wire
- BLUE connected to ULN2003A BLUE wire
ULN2003A Breakout Board
- In 1 connected to Arduino UNO D8
- In 2 connected to Arduino UNO D9
- In 3 connected to Arduino UNO D10
- In 4 connected to Arduino UNO D11
- 0V connected to Arduino UNO GND
- +5V connected to Arduino UNO 5V
- RED wire connected to Stepper Motor RED
- ORANGE wire connected to Stepper Motor ORANGE
- YELLOW wire connected to Stepper Motor YELLOW
- PINK wire connected to Stepper Motor PINK
- BLUE wire connected to Stepper Motor BLUE
Arduino UNO
- D8 connected to ULN2003A In 1
- D9 connected to ULN2003A In 2
- D10 connected to ULN2003A In 3
- D11 connected to ULN2003A In 4
- GND connected to ULN2003A 0V
- 5V connected to ULN2003A +5V
Documented Code
#include <Stepper.h>
#define STEPS 32
Stepper stepper(STEPS, 8, 9, 10, 11);
int val = 0;
void setup() {
Serial.begin(9600);
stepper.setSpeed(200);
}
void loop() {
if (Serial.available() > 0) {
val = Serial.parseInt();
stepper.step(val);
Serial.println(val);
}
}
Filename: sketch.ino
Description: This Arduino sketch is designed to control the stepper motor via the ULN2003A breakout board. It initializes the stepper motor with a predefined number of steps and sets its speed. The loop function listens for serial input, which determines the number of steps the motor should take. The received value is then used to control the stepper motor's movement, and the value is echoed back to the serial monitor for confirmation.
