kfernandesign
Published © GPL3+

Drone Powered 360º Circular Smartphone Camera Rig

This Arduino & XBEE connected camera rig shoots flat 360º degree round video/footage using only one smartphone camera/recording device.

IntermediateShowcase (no instructions)12,174
Drone Powered 360º Circular Smartphone Camera Rig

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×2
SparkFun XBee Explorer USB
SparkFun XBee Explorer USB
×2
XBee Series 2 Wireless Chip
×2
UNIKEL A2212 1000KV Brushless Outrunner Motor+30A Brushless ESC for DJI F450 550
×1
FLOUREON® 11.1V 2200mAh 3S 25C Lipo RC Battery Rechargeable RC Battery with XT60 Plug
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
4.7k
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Selfie Stick with Bluetooth Remote
×1
Needle Roller Pin Bearing
×2
5040 Drone Prop
×1

Software apps and online services

Arduino IDE
Arduino IDE
XBee XCTU

Hand tools and fabrication machines

Metal Lathe
Cordless Drill
Pillar Drill
Metal Mitre Saw
Tig Welder
Waterjet Cutter

Story

Read more

Schematics

Receiver Setup

Transmitter Setup

Code

Receiver Code

Arduino
Code from the Arduino Uno attached to the receiver chip which is on the Camera rig arm. I did not write this code.
/*   ~ Simple Arduino - xBee Receiver sketch ~

  Read an PWM value from Arduino Transmitter to fade an LED
  The receiving message starts with '<' and closes with '>' symbol.
  
  Dev: Michalis Vasilakis // Date:2/3/2016 // Info: www.ardumotive.com // Licence: CC BY-NC-SA                    */

//Constants
const int ledPin = 3; //Led to Arduino pin 3 (PWM)

//Variables
bool started= false;//True: Message is strated
bool ended  = false;//True: Message is finished 
char incomingByte ; //Variable to store the incoming byte
char msg[3];    //Message - array from 0 to 2 (3 values - PWM - e.g. 240)
byte index;     //Index of array

void setup() {
  //Start the serial communication
  Serial.begin(9600); //Baud rate must be the same as is on xBee module
  pinMode(ledPin, OUTPUT);
}

void loop() {
  
  while (Serial.available()>0){
    //Read the incoming byte
    incomingByte = Serial.read();
    //Start the message when the '<' symbol is received
    if(incomingByte == '<')
    {
     started = true;
     Serial.print("true");
     index = 0;
     msg[index] = '\0'; // Throw away any incomplete packet
   }
   //End the message when the '>' symbol is received
   else if(incomingByte == '>')
   {
     ended = true;
     break; // Done reading - exit from while loop!
   }
   //Read the message!
   else
   {
     if(index < 4) // Make sure there is room
     {
       msg[index] = incomingByte; // Add char to array
       index++;
       msg[index] = '\0'; // Add NULL to end
     }
   }
 }
 
 if(started && ended)
 {
   int value = atoi(msg);

   
   analogWrite(ledPin, value);
   Serial.println(value); //Only for debugging
   index = 0;
   msg[index] = '\0';
   started = false;
   ended = false;
 }
}

Transmitter Code

Arduino
Code for the Arduino on the remote transmitting the change in position of the potentiometer.
/*   ~ Simple Arduino - xBee Transmitter sketch ~

  Read an analog value from potentiometer, then convert it to PWM and finally send it through serial port to xBee.
  The xBee serial module will send it to another xBee (resiver) and an Arduino will turn on (fade) an LED.
  The sending message starts with '<' and closes with '>' symbol. 
  
  Dev: Michalis Vasilakis // Date:2/3/2016 // Info: www.ardumotive.com // Licence: CC BY-NC-SA                    */

//Constants: 
const int potPin = A0; //Pot at Arduino A0 pin 
//Variables:
int value ; //Value from pot

void setup() {
  //Start the serial communication
  Serial.begin(9600); //Baud rate must be the same as is on xBee module
}

void loop() {
  //Read the analog value from pot and store it to "value" variable
  value = analogRead(A0);
  //Map the analog value to pwm value
  value = map (value, 0, 1023, 0, 255);
  //Send the message:
  Serial.print('<');  //Starting symbol
  Serial.print(value);//Value from 0 to 255
  Serial.println('>');//Ending symbol
}

Credits

kfernandesign

kfernandesign

0 projects • 8 followers

Comments