Things used in this project

Hardware components:
A000066 iso both
Arduino Arduino UNO & Genuino UNO
×2
11812 02
SparkFun SparkFun XBee Explorer USB
×2
XBee 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
09939 01
Rotary potentiometer (generic)
4.7k
×1
11026 02
Jumper wires (generic)
×1
Amazon Web Services Selfie Stick with Bluetooth Remote
×1
Needle Roller Pin Bearing
×2
5040 Drone Prop
×1
Software apps and online services:
Ide web
Arduino Arduino IDE
XBee XCTU
Hand tools and fabrication machines:
Metal Lathe
Cordless Drill
Pillar Drill
Metal Mitre Saw
Tig Welder
Waterjet Cutter

Schematics

Receiver Setup
6660741 orig yjzfv6v3ju
Transmitter Setup
7694908 orig 8s5odoha7o

Code

Receiver CodeArduino
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 CodeArduino
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

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Direction Indicators for Bikes
Intermediate
  • 177
  • 5

Full instructions

Riding bike is a little dangerous. With the Direction Indicators for a bike, car's know if you want to turn right or left. Make biking safe!

UK Treasure Hunt
Intermediate
  • 67
  • 4

Full instructions

Find Precious Treasures from across the United Kingdom..!

Starry Night Prom
Intermediate
  • 1,593
  • 12

How did I stand out at prom? In a light up dress of course!

Run Google Assistant on Your Amazon Echo
Intermediate
  • 1,185
  • 10

Full instructions

This is an implementation of the Google Assistant API wrapped as an Alexa skill.

Home Automation Using Wiscore and OpenHab
Intermediate
  • 104
  • 2

Protip

This project will help you setup your very own Alexa controlled Home Appliances using the wonderful Wiscore Module from RAK Wireless.

The Trump Button
Intermediate
  • 844
  • 7

Full instructions

The famous connected button to order your favorite drink using Sigfox network.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login