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

Christmas Gift Box
Intermediate
  • 3,679
  • 595

Full instructions

Christmas Gift Box plays music and sends an email when it is opened.

IoT Red Phone
Intermediate
  • 2,794
  • 15

Work in progress

The phone will ring if you have an alert in your AWS Cloudwatch. If you pick up the handset, it tells you whats wrong.

Real-Time Workspace Occupancy Sensing Based on AWS IoT
Intermediate
  • 2,258
  • 13

Sensor-based presence detection for individual workstations: capturing occupancy trends and space utilization in real-time.

AWS IoT Environment for Home Assistant
Intermediate
  • 2,217
  • 13

Work in progress

Home Assistant is an automation platform that can track and control all kinds of devices and automate actions, which fits well with AWS IoT.

Bible Bee
Intermediate
  • 54
  • 0

Full instructions

A wonderful skill called BibleBee which tells you amazing unknown facts about THE GREATEST MAN WHO EVER LIVED ON THE EARTH - JESUS CHRIST. L

Bible Bee

Team care world

DRS for Sanitization needs of Baby
Intermediate
  • 1,180
  • 22

Full instructions

My Idea is about designing Amazon DRS enabled vending box for sanitizing needs of baby (i.e. baby diapers, baby soap and baby wipes).

Add projectSign up / Login