Servos are cool but you can only move them from 0 to 180 degrees, what if you want to have precise continuous rotation? Stepper motor is the answer.
A stepper motor is a very precise motor that you can instruct to rotate one step at a time. They are used in CNC machines, 3D printers and in robotics.
The big ones can be really expensive. In this tutorial, we are going to use a super cheap stepper motor with a stepper driver. You can find them online for as cheap as $2 (motor + driver).
The 28byj-48 is the one stepper we will work with and you can find lots of projects that use this motor just by googling it’s name. Thanks to its driver it’s super easy to connect it to the Arduino Uno board.
Arduino stepper motor control
What we need:
You will need 6 cables with female-male connectors, 4 of them from the Arduino digital pins to the stepper driver and 2 of them from the Arduino power pins to the stepper driver power pins.
You can simply connect the motor to the driver with its connectors. Here is an image that shows what is found on the stepper driver.
Here is how you should connect the whole.
This is what it looks like. My Arduino is in a 3D printed case that I built.
Last but not least the Arduino program.
It uses a the SWITCH CASE command to shorten the its length.
Arduino stepper motor code
I figured I should add a piece of tape on the rotating head of the motor to be able to easily see what is happening.
You might also like:
- Arduino hx711 tutorial
- Arduino magnetic switch
- Best Arduino Kits
- gifts for engineering students
- gifts for engineers
- mpu6050 Arduino projects
- Current sensor Arduino
- Soil Moisture Sensor With Arduino
- Arduino Count up Timer Using the Nokia 5110 LCD
- Arduino Yun: Integrating or Juxtaposing Arduino with Linux
- Arduino Projects: Line Follower Robot
- Arduino RFID Project for Beginners
- Arduino MOSFET Project
- Which Arduino Should You Buy
- What Can You Do With Arduino Boards?
- Great Alternatives to the Arduino Microcontroller
- Arduino Projects: Color Sensor
- Arduino IDE Alternatives
- Arduino Mega vs. Uno
- Arduino Projects: Arduino LCD Display
- Read Arduino Rotary Encoders
- A Selection of the Best Arduino Simulators
- Arduino Projects: IR Receiver
- Arduino Light Sensor Project
- Arduino Projects: Arduino Decibel Meter
- Arduino Stopwatch Project
- Arduino Bluetooth RC Car Project
- Arduino Temperature Logger Project
- Arduino Projects: Arduino 7 Segment Display
- Arduino Projects: Clap ON Clap OFF Light
- Arduino Relay Project
- How to install Arduino Library
- Arduino Projects: Rainfall Detector
- Arduino Projects: RGB LED Arduino
- Arduino Stepper Motor Project
- Arduino Projects: Arduino DC Motor Control
- The Top Affordable Arduino Robot Kit
- Arduino 3D Printed Case
- Arduino Projects: Asynchronous LEDs Blink
- Arduino Projects: Ultrasonic Distance Sensor
- Arduino Projects: LED – 4X4X4 LED Cube
- Arduino Car Projects: Build an Obstacle Avoiding Robot With Less Than $30
- Arduino Projects: Servo Potentiometer Control
- Arduino LED Project: Knight Rider
- Arduino Projects: PIR Motion Sensor
- The Difference between Arduino and Raspberry Pi
- Top 9 Books Every Engineer Should Read
- Top Used Sensors for Arduino
- First Hand on the Arduino Uno Board