Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Controlled Stepper Motor with IR Remote Interaction

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Stepper Motor with IR Remote Interaction

Circuit Documentation

Summary of the Circuit

This circuit is designed to control a 28BYJ-48 stepper motor using an Arduino UNO microcontroller. The motor's movements are dictated by signals received from an IR remote, which are captured by a VS1838B IR receiver. The Arduino UNO is powered by a 5V DC source, and the ULN2003A breakout board is used to drive the stepper motor with signals from the Arduino. The stepper motor is powered by a separate 12V power supply.

Component List

Arduino UNO

28BYJ-48 Stepper Motor

12V Power Supply

ULN2003A Breakout Board

DC Source 5V

VS1838B IR Receiver

Wiring Details

Arduino UNO

28BYJ-48 Stepper Motor

12V Power Supply

ULN2003A Breakout Board

DC Source 5V

VS1838B IR Receiver

Documented Code

Arduino UNO Code (sketch.ino)

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Stepper Motor Control Code (sketch.ino)

/*
 * This Arduino Sketch controls a 28BYJ-48 stepper motor using an IR remote.
 * The IR receiver reads signals from the remote, and the stepper motor
 * moves accordingly.
 */

#include <IRremote.h>
#include <Stepper.h>

const int RECV_PIN = 2; // IR receiver pin
const int STEPS_PER_REV = 2048; // Steps per revolution for 28BYJ-48

// Define stepper motor connections
const int IN1 = 8;
const int IN2 = 9;
const int IN3 = 11;
const int IN4 = 12;

// Initialize the stepper library
Stepper stepper(STEPS_PER_REV, IN1, IN3, IN2, IN4);

IRrecv irrecv(RECV_PIN);
decode_results results;

void setup() {
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the IR receiver
  stepper.setSpeed(10); // Set stepper motor speed (RPM)
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX); // Print the received value
    switch (results.value) {
      case 0xFFA25D: // Example IR code for forward
        stepper.step(STEPS_PER_REV / 4); // Move stepper forward
        break;
      case 0xFF629D: // Example IR code for backward
        stepper.step(-STEPS_PER_REV / 4); // Move stepper backward
        break;
      // Add more cases for other IR codes as needed
    }
    irrecv.resume(); // Receive the next value
  }
}

This code snippet is responsible for receiving IR signals and controlling the stepper motor's movements based on the received signals. The Stepper library is used to simplify the control of the stepper motor, and the IRremote library is used to decode the signals from the IR remote.