Circuit Documentation
Summary
The circuit in question is designed to control a 28BYJ-48 Stepper Motor using an Arduino UNO microcontroller and a ULN 2003 driver module. The circuit is powered by a 9V battery, which is regulated by an Mtiny Power module to provide the necessary voltages to the components. A pushbutton is included in the design, although its specific function is not detailed in the provided code. The Arduino UNO is programmed to drive the stepper motor in alternating directions with a specified number of steps and speed.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.
Pushbutton
- A simple switch mechanism for controlling some aspect of a machine or a process. It is composed of simple electric switch mechanism which controls some aspect of a machine or a process.
9V Battery
- A standard 9V battery used to provide power to the circuit.
Mtiny Power
- A power module designed to regulate voltage from a battery or external power source to levels suitable for small electronics.
28BYJ-48 Stepper Motor
- A small and inexpensive stepper motor with a 5.625° step angle (64 steps per revolution in full-step mode).
ULN 2003
- A 7-channel Darlington array which is used to interface between low-level logic circuitry and multiple peripheral power loads.
Wiring Details
Arduino UNO
- GND connected to the common ground net.
- D11 connected to ULN 2003 IN4.
- D10 connected to ULN 2003 IN3.
- D9 connected to ULN 2003 IN2.
- D8 connected to ULN 2003 IN1.
Pushbutton
- Pin 3 (out) connected to Pin 4 (out) (wiring details for the pushbutton are incomplete).
9V Battery
- + connected to Mtiny Power VIN.
- - connected to the common ground net.
Mtiny Power
- GND connected to the common ground net.
- 5V connected to ULN 2003 +.
- VIN connected to 9V Battery +.
28BYJ-48 Stepper Motor
- BLUE connected to ULN 2003 COIL1.
- PINK connected to ULN 2003 COIL2.
- YELLOW connected to ULN 2003 COIL3.
- ORANGE connected to ULN 2003 COIL4.
- RED connected to ULN 2003 COIL5.
ULN 2003
- GND connected to the common ground net.
- + connected to Mtiny Power 5V.
- IN1 to IN4 connected to Arduino UNO D8 to D11 respectively.
- COIL1 to COIL4 connected to 28BYJ-48 Stepper Motor BLUE to ORANGE respectively.
- COIL5 connected to 28BYJ-48 Stepper Motor RED.
Documented Code
Arduino UNO Code (sketch.ino)
#include<Stepper.h>
int stepsPerRevolution=2048;
int motspeed;
Stepper Mystepper(stepsPerRevolution,8,10,9,11);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Mystepper.setSpeed(motspeed);
}
void loop() {
// put your main code here, to run repeatedly:
Mystepper.step(stepsPerRevolution);
delay(500);
Mystepper.step(-stepsPerRevolution);
delay(500);
}
This code configures the Arduino UNO to control the stepper motor using the Stepper library. The motor is set to perform 2048 steps per revolution, which corresponds to the motor's specifications. The setSpeed function is called with an uninitialized variable motspeed, which should be set to a desired speed value. The loop function then moves the stepper motor one full revolution in one direction, pauses for half a second, and then moves it one full revolution in the opposite direction.
Note: The motspeed variable is not initialized in the provided code, which may cause the motor to not function as expected. It should be assigned a value representing the speed at which the motor should turn.
Other Microcontrollers
The provided code for the other microcontrollers is either empty or contains only template setup and loop functions without any operational code. Therefore, no additional documentation is provided for these microcontrollers.
