Arduino UNO-Based Stepper Motor Control with Real-Time Clock and Limit Switch
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves two Arduino UNO microcontrollers, a 28BYJ-48 stepper motor, a ULN2003A breakout board, a limit switch, and a DS1307 RTC module. The circuit is designed to control the stepper motor using the Arduino UNO and the ULN2003A breakout board, with additional functionality provided by the limit switch and the RTC module.
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
28BYJ-48 Stepper Motor
- Description: A small, inexpensive stepper motor commonly used in various applications.
- Pins: BLUE, PINK, YELLOW, ORANGE, RED
ULN2003A Breakout Board
- Description: A driver board for controlling the 28BYJ-48 stepper motor.
- 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
Limit Switch
- Description: A mechanical switch used to detect the presence or absence of an object.
- Pins: C, NO, NC
DS1307 RTC (Wokwi Compatible)
- Description: A real-time clock module used to keep track of time.
- Pins: GND, 5V, SDA, SCL, SQW
Wiring Details
Arduino UNO (1)
- 5V connected to C of the Limit Switch
- D11 connected to In 4 of the ULN2003A Breakout Board
- D10 connected to In 3 of the ULN2003A Breakout Board
- D9 connected to In 2 of the ULN2003A Breakout Board
- D8 connected to In 1 of the ULN2003A Breakout Board
- D7 connected to NO of the Limit Switch
28BYJ-48 Stepper Motor
- BLUE connected to BLUE wire of the ULN2003A Breakout Board
- PINK connected to PINK wire of the ULN2003A Breakout Board
- YELLOW connected to YELLOW wire of the ULN2003A Breakout Board
- ORANGE connected to ORANGE wire of the ULN2003A Breakout Board
- RED connected to RED wire of the ULN2003A Breakout Board
ULN2003A Breakout Board
- In 1 connected to D8 of the Arduino UNO (1)
- In 2 connected to D9 of the Arduino UNO (1)
- In 3 connected to D10 of the Arduino UNO (1)
- In 4 connected to D11 of the Arduino UNO (1)
- BLUE wire connected to BLUE of the 28BYJ-48 Stepper Motor
- PINK wire connected to PINK of the 28BYJ-48 Stepper Motor
- YELLOW wire connected to YELLOW of the 28BYJ-48 Stepper Motor
- ORANGE wire connected to ORANGE of the 28BYJ-48 Stepper Motor
- RED wire connected to RED of the 28BYJ-48 Stepper Motor
Limit Switch
- C connected to 5V of the Arduino UNO (1)
- NO connected to D7 of the Arduino UNO (1)
DS1307 RTC (Wokwi Compatible)
- 5V connected to 5V of the Arduino UNO (2)
- GND connected to GND of the Arduino UNO (2)
- SDA connected to A4 of the Arduino UNO (2)
- SCL connected to A5 of the Arduino UNO (2)
Arduino UNO (2)
- 5V connected to 5V of the DS1307 RTC
- GND connected to GND of the DS1307 RTC
- A4 connected to SDA of the DS1307 RTC
- A5 connected to SCL of the DS1307 RTC
Documented Code
Arduino UNO (1) Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Arduino UNO (2) Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}