Raushan Kumar
Published © Apache-2.0

Android Control Servo Motor

Build a smartphone-controlled servo motor.

IntermediateFull instructions provided1 hour4,839
Android Control Servo Motor

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit

Code

Code

Arduino
// SmartPhone control Switch 
                // Code Created By Electronics4you (Romeo Hackster)
   //Hello Friends Subscribe My youtube Chnnel :-Electronics4you 

                          //Contact for any help :- lovecpr3@gmail.com
   

#include<SoftwareSerial.h>
#include <Servo.h> // install Servo libarary
Servo myservo;
SoftwareSerial mySerial(2, 3);   //HC05 RX pin connect To arduino Pin 2 and TX Pin connetct To Arduino Pin 3
// RX, TX
int Position ;
 void setup() 
    { 
    myservo.attach(11);  // ServoPin Connect to Arduino Pin 11
    mySerial.begin(9600); // serial print
    Serial.begin(9600);}
 void loop()
    {
     if(mySerial.available()>0) { Position = mySerial.read(); Position = map(Position, 0, 180, 180, 0); myservo.write(Position); }}
// servo position 
                      // ex. 30°,60°,90°,120°,180° etc.

//End Code

Credits

Raushan Kumar
32 projects • 71 followers
Contact

Comments

Please log in or sign up to comment.