Circuit Documentation
Summary
This circuit is designed to control a 28BYJ-48 Stepper Motor using an Arduino 101 microcontroller and a ULN2003A breakout board. The Arduino 101 sends control signals to the ULN2003A, which in turn drives the stepper motor. The circuit is powered by a 5V supply, and the ground connections are shared between the Arduino and the ULN2003A board.
Component List
ULN2003A Breakout Board
- Description: A breakout board for the ULN2003A, a 7-channel Darlington array designed for driving high-current loads.
- 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 101
- Description: A microcontroller board based on the Intel Curie, which is capable of Bluetooth Low Energy communications and sensor integration.
- Pins: A5/SCL, A4/SDA, AREF, GND, D13/SCK, D12/MISO, D11 PWM/MOSI, D10 PWM/SS, D9 PWM, D8, D7, D6 PWM, D5 PWM, D4, D3 PWM, D2, D1/TX, D0/RX, AIN, ioref, RESET, 3V3, 5V, VIN, A0, A1, A2, A3, ICSP MISO, ICSP SCK, ICSP MOSI.
28BYJ-48 Stepper Motor
- Description: A small, 5-wire, unipolar stepper motor commonly used for precision control in projects.
- Pins: BLUE, PINK, YELLOW, ORANGE, RED.
Wiring Details
ULN2003A Breakout Board
- In 1: Connected to Arduino 101 D8
- In 2: Connected to Arduino 101 D9 PWM
- In 3: Connected to Arduino 101 D10 PWM/SS
- In 4: Connected to Arduino 101 D11 PWM/MOSI
- 0V: Connected to Arduino 101 GND
- +5V: Connected to Arduino 101 5V
- BLUE wire: Connected to 28BYJ-48 Stepper Motor BLUE
- PINK wire: Connected to 28BYJ-48 Stepper Motor PINK
- YELLOW wire: Connected to 28BYJ-48 Stepper Motor YELLOW
- ORANGE wire: Connected to 28BYJ-48 Stepper Motor ORANGE
- RED wire: Connected to 28BYJ-48 Stepper Motor RED
Arduino 101
- D8: Connected to ULN2003A In 1
- D9 PWM: Connected to ULN2003A In 2
- D10 PWM/SS: Connected to ULN2003A In 3
- D11 PWM/MOSI: Connected to ULN2003A In 4
- GND: Connected to ULN2003A 0V
- 5V: Connected to ULN2003A +5V
28BYJ-48 Stepper Motor
- BLUE: Connected to ULN2003A BLUE wire
- PINK: Connected to ULN2003A PINK wire
- YELLOW: Connected to ULN2003A YELLOW wire
- ORANGE: Connected to ULN2003A ORANGE wire
- RED: Connected to ULN2003A RED wire
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
Code Description
- The code includes the
Stepper.h
library, which is used to control stepper motors with the Arduino.
STEPS
is defined as 32, which is the number of steps per revolution for the 28BYJ-48 stepper motor.
- An instance of the
Stepper
class is created named stepper
, initialized with the number of steps and the pins connected to the ULN2003A inputs.
- In the
setup()
function, the serial communication is started at 9600 baud, and the stepper motor speed is set to 200 RPM.
- The
loop()
function continuously checks for available serial input. If a value is received, it is parsed as an integer, the stepper motor is moved by that number of steps, and the value is printed back to the serial monitor.