Gorceag Victor
Published

UAV Arduino

This is one of my personal budget/project made for University to graduate. This Airplane (UAV) is made fully homemade using only Arduino.

ExpertShowcase (no instructions)Over 37 days69,761
UAV Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
Atmega328p
×1
Inertial Measurement Unit (IMU) (6 deg of freedom)
Inertial Measurement Unit (IMU) (6 deg of freedom)
×1
bmp180
×1
GPS ATtiny
×1
Geiger Counter
×1

Software apps and online services

Windows 10 IoT Core
Microsoft Windows 10 IoT Core
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Dremel
Homemade PCB

Story

Read more

Schematics

Transmitter circuit

Personal Design using EAGLE software

Code

Transmitter Code

C/C++
Modified Joystick, nRF24L01 and 3x buttors , 3x leds
/* ©Gorceag Victor / Domino60 2016 / Arduino 1.0.5
   Components/modules
   
   - Joystick 3 Potentiometers 
   - nRF24L01 PA 2db antenna
   - 3x Buttons 3x Leds 
   
*/

//-------------------------------------- nRF24
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>


RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;


int dataToSend[6];

//----------------------------------------POT's
int PotSpeed;
int PotY;
int PotX;

long nowP = 0;
long intervalP = 60;

void Potentiometers(){
    
    if(millis() - nowP >= intervalP){      
   PotSpeed = analogRead(A0);  
   PotY = analogRead(A1); 
   PotX = analogRead(A2);   
     nowP = millis();
    }
}

// ************************************************************ LED_BUTTON 1
int led1 = 3;
int button1 = 6;

long now1 = 0;
long interval1 = 1000;
int x1 = 0;
void Button1_Led1(){
   if(millis() - now1 >= interval1){
  int valofbutton1 = digitalRead(button1); //value of the button 0 or 1 (LOW or HIGH) 
   if(valofbutton1 == 1){ //if button HIGH
     x1++;  // x+1;  x=1
     if(x1 == 1){  //if x = 1 
        digitalWrite(led1, HIGH); //then led HIGH
     }
     if(x1 == 2){  // if we press again x=2  
        digitalWrite(led1, LOW); // if x = 2 led LOW
        x1 =0;   // making x = 0 for the next loop
     }
   }
   now1 = millis();
  } 
}

// ************************************************************ LED_BUTTON 2
int led2 = 4;
int button2 = 7;

long now2 = 0;
long interval2 = 1000;
int x2 = 0;
void Button1_Led2(){
   if(millis() - now2 >= interval2){
  int valofbutton2 = digitalRead(button2); //value of the button 0 or 1 (LOW or HIGH) 
   if(valofbutton2 == 1){ //if button HIGH
     x2++;  // x+1;  x=1
     if(x2 == 1){  //if x = 1 
        digitalWrite(led2, HIGH); //then led HIGH
     }
     if(x2 == 2){  // if we press again x=2  
        digitalWrite(led2, LOW); // if x = 2 led LOW
        x2 =0;   // making x = 0 for the next loop
     }
   }
   now2 = millis();
  } 
}

// ************************************************************ LED_BUTTON 3
int led3 = 5;
int button3 = 8;

long now3 = 0;
long interval3 = 1000;
int x3 = 0;
void Button1_Led3(){
   if(millis() - now3 >= interval3){
  int valofbutton3 = digitalRead(button3); //value of the button 0 or 1 (LOW or HIGH) 
   if(valofbutton3 == 1){ //if button HIGH
     x3++;  // x+1;  x=1
     if(x3 == 1){  //if x = 1 
        digitalWrite(led3, HIGH); //then led HIGH
     }
     if(x3 == 2){  // if we press again x=2  
        digitalWrite(led3, LOW); // if x = 2 led LOW
        x3 =0;   // making x = 0 for the next loop
     }
   }
   now3 = millis();
  } 
}

// -----------------------------------------SETUP
void setup() {                
  Serial.begin(9600);
  
   radio.begin();
  radio.setAutoAck(false);
  radio.setChannel(108); //108 - 2.508 Ghz //0-124 2.4gHz-2.5gHz
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_MAX);
  radio.openWritingPipe(pipe);
  
  pinMode(led1, OUTPUT);  
  pinMode(button1, INPUT);
  pinMode(led2, OUTPUT);  
  pinMode(button3, INPUT);
  pinMode(led3, OUTPUT);  
  pinMode(button3, INPUT);
}

// -----------------------------------------LOOP
void loop() {
  
  Button1_Led1();
  Button1_Led2();
  Button1_Led3();
  Potentiometers();

    dataToSend[0] = PotSpeed;     
    dataToSend[1] = PotY;    
    dataToSend[2] = PotX;     
    dataToSend[3] = x1;    
    dataToSend[4] = x2;    
    dataToSend[5] = x3;
    radio.write(dataToSend, sizeof(dataToSend));
}

Credits

Gorceag Victor

Gorceag Victor

5 projects • 75 followers
Optimist

Comments