How to operate Stepper Motor With android App

0
7982
stepper motor using android app
stepper motor using android app

Stepper Motor with Mobile App

After a long period without publishing articles, I returned to resume my Arduino projects , this time I want to share with you this little android application that allows to control a stepper motor 360 degrees using the famous AppInventor .

stepper motor using android app
stepper motor using android app

[nextpage title=”Introduction” ] The mobile application have a central image that represents a knob that rotates 360 degrees, move this knob the stepper motor rotates to the angle you want. To control the stepper motor must have present how you are going to activate each of the coils , in this case I applied power to two coils by step as follows :

stepper motor using android app1

How the stepper motor is controlled with mobile App ?


In step A the coils 1 and 2 are activated , in the B coils 2 and 3 are activated , in step C the coils 3 and 4 are activated , in step D the coils 4 and 1 are activated , so the rotation of the rotor is completed . So we can program the function that will control this movement and you can do repetitive for the complete movement of the stepper motor.

Rotating a stepper motor through an Arduino board is really simple and does not require extensive code to achieve it and you can find much information on the web. The materials that I used in this application are, a stepper motor with ULN2003 Driver, you can get a board ready to connect to an Arduino module, an HC-06 Bluetooth module, an Arduino Uno R3 card and an additional source to deliver more than 1 Amp to deliver necessary current for the stepper motor can move.

[sam id=”2″ codes=”true”]

Remember that the current that USB port can provide is not enough and if we provide current from the USB port to stepper motor this can damage the USB port, can potentially damage the port of the computer or if you have connected a source to Arduino input connector module can damage the digital ports of Arduino if you connect directly from the engine control pins, so the best way to make a connection of a stepper motor is providing separate power to the motor driver ULN2003A with the same GND.

[/nextpage]

[nextpage title=”Stepper Motor Android Application” ]

In the download section you can find files with the Arduino programming for this application. App Inventor application to describe it below :

App for stepper motor
Appinventor

In the main panel of the application I used a imageSprit , Canvas , label 1 and 2, ListPicker , TextBox1 , Button1 and Bluetooth , with these elements we can start coding our application as shown in the following images:

apinventor for stepper motor app
apinventor

[sam id=”2″ codes=”true”]

Here 3 blocks of code are shown . In the first ListPicker1 module is used for the application to display a list of devices available for bluetooth , the second block is to make the Bluetooth connection to the device and display the “Connected ” label, the third module determines which point is the head of the image when we moved our finger slide on the screen, to rotate the image of the circular knob and displays the value in degrees of the position of the head of the image, the blocks appearing in Part right of the image are blocks where the counter variable is declared and other normalizing the value of the image address between 0 and 360 degrees.

Bloques-4-5-StepperApp

The fourth block determines when the user has stopped touching the screen and sent through the Bluetooth module the position of the head of the image multiplied by 1.42, because the stepper motor requires 512 steps to complete a 360 degrees, and the fifth block, I put it to send either a number or text through the bluetooth module , so if you put 512 and click send, the motor will turn 512 steps. The Files of this application you can also download in the download section of this page .

This makes it possible to control very easily stepper motor from your mobile phone and use this application to use it in many of your upcoming projects.

[/nextpage]

If you enjoyed this article please share it .