If you are looking to make Android app to control a servo motor, this is a perfect blog post for you, here you can follow a step by step procedure video to know how to make an android app using MIT app inventor and to control a servo motor. This app sends the angle for the servo from your android phone to your bluetooth connected to the Arduino. where the Arduino receives the angle and executes the program and set the angle to the servo motor.
What components that you need to make this?
Arduino Uno or any other microcontroller.
servo Motor
Bluetooth Module (HC-05)
Android phone :)
After completing the Program in MIT app inventor, go to Build and select App( save .apk to my computer)
Transfer the file to your android mobile phone or tablet.
if your mobile not allowing to install the app from unknown sources.
go to setting in your android mobile select security and move to Device administration and give access to allow install app from unknown sources.
Arduino Program:
___________________________________________________________________________________
#include <SoftwareSerial.h>
#include <Servo.h>
Servo myservo;
int bluetoothTx = 10;
int bluetoothRx = 11;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
myservo.attach(9);
//Setup usb serial connection to computer
Serial.begin(9600);
//Setup Bluetooth serial connection to android
bluetooth.begin(9600);
}
void loop()
{
//Read from bluetooth and write to usb serial
if(bluetooth.available()> 0 )
{
int servopos = bluetooth.read();
Serial.println(servopos);
myservo.write(servopos);
}
}
___________________________________________________________________________________
Hello...interesting project...I wonder how to control DC motor replacing the servo motor...to make the dc motor forward or backward or stop...using android phone..
ReplyDeleteI hope you could help me about that...thanks
my email..appyfire@gmail.com
http://learnhowtomakerobot.blogspot.in/2014/11/arduino-and-android-control-bluetooth.html
Deleteplz tell me how to add a sequence
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHello Sir.
ReplyDeleteYou've used Soft Serial communication by defining Tx,Rx pins. Can I do this by simple serial communication?
Please reply back. I'm waiting for your reply
Hi, i wanna do this usin the HC-06 , how many changes i have to do?
DeleteI have produced the Android app and run the code exactly as shown on this page (plus some tweaks when I couldn't get it to work), but no matter how I have fooled with things, the servo won't budge. I have scoped the signal going to the servo, and there's nothing but trash that appears momentarily when I use the app. The servo checks fine, and the LED that indicates bluetooth communication flickers when I use the app-any tips?
ReplyDeleteLke your detailed video of how to program MIT app inventor for this problem. I am new to this problem, but am interested in controlling a robot with about 5 or 6 degrees of freedom using DC and stepper motors.
ReplyDeleteI need to use my own power supply for the motors, but haven't seen much discussion on how to do this. I will be using L298N driver boards to provide power to DC and stepper motors.
Any thoughts on how to make a circuit for arduino to do this???
Jim S.
I have built this project.But in seriel monitor it only shows 255.....
ReplyDeletehow can I tackle this problem
This comment has been removed by the author.
ReplyDeletei want to make an application android control servo motor by slider 1 and control DC motor by slider 2 (forward or stop speed) . help me pleas
ReplyDeleteThis comment has been removed by the author.
DeleteThis comment has been removed by the author.
DeleteSeopoly is a main incorporated programming, Apps, site improvement and computerized advertising corporate. We have practical experience in SEO-accommodating site building, app inventor, spot Net framework outlines and open source arrangements. Our group is committed to giving you predominant quality items and benefit and our consumer loyalty record are our reward.
ReplyDeleteI have a Bluno Beetle V1.0.I copied your code to control a servo. I changed the pin numbers and left everything else the same.
ReplyDeleteShould this code work?
#include // TX RX software library for bluetooth
#include // servo library
Servo myservo; // servo name
int bluetoothTx = 1; // bluetooth tx to 1 pin
int bluetoothRx = 0; // bluetooth rx to 0 pin
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
myservo.attach(2); // attach servo signal wire to pin 2
//Setup usb serial connection to computer
Serial.begin(9600);
//Setup Bluetooth serial connection to android
bluetooth.begin(9600);
}
void loop()
{
//Read from bluetooth and write to usb serial
if(bluetooth.available()> 0 ) // receive number from bluetooth
{
int servopos = bluetooth.read(); // save the received number to servopos
Serial.println(servopos); // serial print servopos current number received from bluetooth
myservo.write(servopos); // roate the servo the angle received from the android app
}
}
i need a code that move two server and use app as a before video that six control serv, i treated adapting these tutorial and i cant move nothing
ReplyDeleteplz tell me how to add a sequence
ReplyDeletehttps://youtu.be/9rT69NA6Yec
ReplyDeletePlease do subscribe my channel on youtube to learn more on controlling android with app created in MIT aPpp inventor 2
Advance Programing of AC Drives with Practical Machines on V/F Method Vector Control & Sensor-less Vector. Expertise your skills on AC Drive. Call Now +91- 9953489987.
ReplyDeleteCan I use 8051 with MIT APPS INVENTOR 2??
ReplyDeletehey there
ReplyDeletedo you take on projects, are you on fiverr?
Follow your audience so that you can understand how they respond to your campaign. 芸能
ReplyDelete