Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Stepper Motor Speed and Direction Control Using Arduino and Bluetooth HC-06 Module through an Android App

By EG Projects

​This is a simple tutorial on how to control speed and direction of stepper motor using arduino uno and bluetooth module hc-06 through an android phone app. The motor which i am using is Uni directional stepper motor. Their are two types of stepper motors unidirectional and bidirectional. Uni directional has four phases and bidirectional has 6 phases. Phases must be controlled properly other wise desired output can not be obtained. Before going further i assume that you are aware of the steeper motor phases and know how to control them effectively in order to get the maximum output.

Arduino stepper motor Bluetooth control project – Working principle

The user pairs its android phone with the hc-06 bluetooth module. After paring user can start the motor, can move the shaft in either direction clock or anti clock wise, can change the speed of motor rotation, can stop the motor with the commands that are embedded in side the code. The commands can be changed according to the user need. We will come to the code portion later in the tutorial.

Arduino stepper motor control circuit

Circuit diagram of the project is given below. The stepper motor which i am using works on 12 v DC. Stepper motor coils consumes about 80 mA to 250 mA, so we an not drive the steeper motor directly from arduino pins. We need some driver for this purpose and ULN2003 a darling-ton array ic is a good fit-in.  ULN2003 is capable of sourcing 500 mA of current at 50 v, it can easily source 25 0mA current at 12 v.
​
Stepper coils are controlled through arduino digital pins 2,3,4 and 5. The pins are directly connected to inputs of uln2003. The corresponding outputs of the uln2003 is supplying power to motor coils. Arduino is powered through external 12v adopter and uln2003 is powered through the same adopter. Hc06 is powered through the 3.3v supply output of arduino.
Note: The ground of the arduino must be grounded with ULN2003 ground. Both the ic’s must be at same potential to become  functional. If not grounded properly the circuit floats and the output is unpredictable.

Stepper Motor Speed and Direction Control Using Arduino and Bluetooth HC-06 Module through an Android AppPicture

Stepper Motor Speed and Direction Control Using Arduino and Bluetooth HC-06 Module through an Android App

Level shifters requirement

Arduino talks with hc06 bluetooth module on serial communication protocol. The baud rate for serial communication can be changed. I am working on default baud rate which is 9600 bps. Bluetooth module hc06 works on 3.3 v and can be powered from the 3.3 v source output of arduino uno. Since the hc06 bluetooth works on 3.3 v it outputs the data in the form of TTL signal rated at 3.3 v. Where as arduino uno operates on 5 v and its pins output data in the form of TTL signal rated at 5 volt. To balance the TTL level voltage. Voltage level sifters are inserted between the pins. Arduino TX is transmitting a 5 v signal which is shifted to 3.3 v by just a simple voltage divider circuit. The hc06 TX is transmitting a 3.3 v signal which is level shifted to 5 v.

Commands to run and control stepper motor from Bluetooth

Sending following commands from android app after it is paired with the hc06 Bluetooth module will make arduino to perform functions on stepper motor.

s or S = Starts and stops the stepper motor. First s starts motor and the coming next stops it.
f or F  = Rotates stepper motor in clockwise direction.
b or B = Rotates stepper motor in anticlockwise direction.

Speed rotation for stepper motor embedded in the code

0 = —————————————————– Rotation Speed=1000;
1 = —————————————————– Rotation Speed=900;
2 = —————————————————– Rotation Speed=800;
3 = —————————————————– Rotation Speed=700;
4 = —————————————————– Rotation Speed=500;
5 = —————————————————– Rotation Speed=400;
6 = —————————————————– Rotation Speed=300;
7 = —————————————————– Rotation Speed=200;
8 = —————————————————– Rotation Speed=100;
9 = —————————————————– Rotation Speed=50; 
Android app which i used can be found HERE. Its great and works efficiently on all the baud rates. I checked the pairing and working of motor on all baud rates and all works fine.
​

The function Move_Backward() rotates the motor in anticlockwise direction. The function StartMotor() rotates the motor in clockwise direction. User can change the commands according to his need. User can also insert the new rotation speeds.
More embedded microcontroller projects involving stepper motors in them are present in tutorials section. Each project contains free source code and circuit diagram of the project. In each project stepper motor speed and direction is controlled using microcontrollers. Visit the tutorials below. 

Stepper motor control over WiFi with nodemcu

Stepper motor with 32 bit stm32f103 microcontroller

Stepper motor controlled with 8051(89c51, 89c52) microcontrollers

Download the project code written in arduino ide 1.6. Code is free and opensource. Please give us your feed back on the project.

Watch the Project Video Here..

Arduino Project Files Code

Filed Under: Arduino, Electronic Projects, Microcontroller Projects

 

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)
  • An Embedded Developer’s Perspective on IOT (Internet of Things)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Dynamic power consumption.
  • Limits of duty cycle for ICM7555 IC?
  • pmos folded cascode vs nmos folded cascode for LDO
  • Pic 16f877A Hex file
  • Need help to choose accelerometer

RSS Electro-Tech-Online.com Discussions

  • Need help working with or replacing a ferrite tube
  • Help wanted to power an AC120v induction motor ( edited from Brushless motor - thank you @SHORTBUS= )
  • Funny Images Thread!
  • How does a NOAC work?
  • How to designing a battery charging indicator circuit for 18650 battery pack
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering