Motor: 28BYJ-48
H-bridge: L293
Arduino: UNO
Hi everyone,
I am trying to use an h-bridge with my Arduino and the motor which is rated at 5 V. I found an earlier post that had a similar issue however I did not understand the binary numbers that were spoken about in that post.
In the first attachment, I have shown the circuit for the h-bridge and then the truth table based on which switches are closed so the motor can turn. Therefore, I know I would need 1001 to turn right and 0110 to turn left.
I have also attached the schematic which I have followed but I think my issue is the wiring with the motor and the Arduino.
Could someone help me with the understanding of the proper wiring? I have followed this schematic exactly along with the code but it just appears to vibrate inside without any physical turning.
// Include the Arduino Stepper Library
#include <Stepper.h>
// Number of steps per output rotation
const int stepsPerRevolution = 48;
// Create Instance of Stepper library
Stepper myStepper(stepsPerRevolution, 12, 11, 10, 9);
void setup()
{
// set the speed at 20 rpm:
myStepper.setSpeed(20);
// initialize the serial port:
Serial.begin(9600);
}
void loop()
{
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}