Project showcase

Pan-Tilt Controlled by Cell Phone © CC BY-NC-ND

This project is about a Pan-Tilt controlled by cell phone via Bluetooth and using 1Sheeld.

  • 1 comment
  • 40 respects

Components and supplies

Apps and online services

About this project


In this project I will introduce to you a pan-tilt controlled by cell phone.

All movements of the cell phone are reproduced in the pan-tilt device via Bluetooth. The assembly is very simple using an Arduino R3 (or similar) and two shields over it.

I started this project thinking about a device to support newbies in home astronomy giving them an easy way to indicate the right position for the telescope to find out in the sky any planet, star or constellation.

You just need use this device as a sky pointer together with apps like Sky Map.

Very easy and fun!


Material list

All you need is on the following list:

  • Arduino Uno R3 (or similar)
  • 1Sheeld - Android version (shield for connection to cell phone - Android)
  • Motor Driver Shield (for servo motors)
  • 02 x Micro Servo Motors SG90 (or similar)
  • Pan-Tilt SG90 kit
  • Power supply (9V x 1A) with plug P4
  • USB cable (connection between Arduino and your Computer)


The assembly is very simple with no soldering and few wirings.

Follow the next steps:

  • Put 1Sheeld board over the Arduino board.
  • Put the Motor Driver Shield over the 1Sheeld board.
  • Connect the cable of Tilt axis in the Motor Shield plug (Servo 1).
  • Connect the cable of Pan axis in the Motor Shield plug (Servo 2).


According with their developers, "1Sheeld turns your smartphone into 40 different Arduino shields".

This shield is very interesting because you can connect an Arduino board via Bluetooth to a cellular phone and use all its available sensors. The connection is simple and you have all necessary libraries available for Arduino. In this way you can reduce the time you need for your prototypes and decide if you want go ahead or if you need to update something.

After final results you can convert the prototype on a final product applying traditional components and sensors.

For the first use of 1Sheeld you need to download its library to the folder where the Arduino IDE is installed in your computer and in your cell phone you need to install the 1Sheeld App (for Android) or 1Sheeld App (for iPhone).


  • 1Sheeld can run in background and then you can run also another app simultaneously.
  • If you want more information about this shield, visit the 1Sheeld site.

Programming and Setup

The program is very simple.

With the library of Orientation of 1Sheeld, the Arduino program will read the axis X and Y of your cell phone and translate them to the angular position of each servo motor.

One important detail is each cell phone can have a different origin/reference for the axles X, Y, Z.

Due to this I have put an statement on setup routine of Arduino to make the "zero" reference according with the positioning of you cell phone.

At start, you need to put the cell phone on horizontal position aligned with the Pan-Tilt device and then press the reset button of Arduino (you also can press the reset button of the Motor Shield because it is on the top with an easier access).

After this step the Pan-Tilt is already referenced to follow the position of your cell phone!

Move the phone and see the corresponding movements into the servos.


  Project:    Pan-Tilt Controlled by Cell Phone
  Author:     LAGSILVA
  Hardware:   Arduino UNO-R3 / 1SHEELD
  Date:       14.Feb.2016
  Revision:   1.0
  License:    CC BY-NC-ND 4.0
              (Attribution-NonCommercial-NoDerivatives 4.0 International)
  1.  Application supported by 1SHEELD-Android for Arduino UNO
  2.  X-axis ranges from 0 to 360 degrees
  3.  Y-axis ranges from -180 to 180 degrees
  4.  Z-axis ranges from -90 to 90 degrees.


#include <OneSheeld.h>    // Include 1Sheeld Library
#include <Servo.h>        // Include Servo Library

Servo myservoX;           // Create servo object to control Orientation X
Servo myservoY;           // Create servo object to control Orientation Y

float angleX, angleXi, angleY;
float angleYi = -35;      // This value must be set with a trial to align the "zero" angle of your Tilt. In my case I used -35 for compensation.
boolean k = true;

void setup()


  myservoX.attach(9);    // Servo2 (in the Motor Shield) of Axix X (PAN)  - connected to Analogic Pin 09 of Arduino
  myservoY.attach(10);   // Servo1 (in the Motor Shield) of Axix Y (TILT) - connected to Analogic Pin 10 of Arduino


void loop()

  angleX = -OrientationSensor.getX();
  angleX = angleX - angleXi + 90;
  if (angleX < 0) {
    angleX = angleX + 360;
  if (angleX > 360) {
    angleX = angleX - 360;
  angleX = constrain(angleX, 0, 180);


  angleY = -OrientationSensor.getY();
  angleY = 180 - (angleY - angleYi);
  angleY = constrain(angleY, -30, 150);


void readAngleXi(float xAxis, float yAxis, float zAxis)
  if (k) {
    angleXi = -xAxis;
    k = false;



Similar projects you might like

Voice Controlled Robot using your Smart Phone

Project tutorial by Ahmed Yassin

  • 10 respects

Gesture Controlled Trainable Arduino Robot Arm via Bluetooth

Project tutorial by KureBas Robotics

  • 167 respects

Solar Panel Sun Tracker - Phone Charger

Project tutorial by FIELDING

  • 185 respects

Android Controlled 6DoF Robotic Arm

Project in progress by Team Mans

  • 24 respects

Control your Light System Using Smart Phone

Project tutorial by Ahmed Yassin

  • 63 respects
Add projectSign up / Login