NANO DRONE EP3 : Connect +BARO+GYRO+GPS

 

Wiring

 

6DOF MPU-6050 3 Axis Gyro With Accelerometer Sensor Module For Arduino

MPU6050 :   https://www.banggood.com/custlink/3mvK5s3Gz8

 

GY-68 BMP180 Digital Barometric Pressure Sensor Board Module for for RC Drone FPV Racing Multi Rotor

BMP180 baro meter :  https://www.banggood.com/custlink/mvDvFNKK1d

GY GPS Module Board 9600 Baud Rate With Antenna For Arduino

GPS Module : https://www.banggood.com/custlink/DKvK5QKDfH

Code

This code not professional code for flight controller just example for learn how to add all sensor please under stand !!

Download from link below

https://drive.google.com/drive/folders/1LJNr3Zmuv7MkJ4mpGKmBya4CeUyqdhKT?usp=sharing

NANO DRONE EP1 : Hook up Flysky to Arduino NANO

 

FlySky FS-i6 2.4G 6CH AFHDS RC Radion Transmitter With FS-iA6B Receiver for RC FPV Drone

https://www.banggood.com/custlink/KKK3FoBbUO

Manual : https://drive.google.com/file/d/1pOiHj9m0HxIeDRs6IpjiTVY0ntMojYiw/view?usp=sharing

Wiring

Bind Remote ( Connect Transmitter and receiver )

 

 

Code for read data from Flysky receiver
int channel1 = 2; //   Pitch
int channel2 = 3;//    
int channel3 = 4; //  Throttle
int channel4 = 5;//    YAW
int SWA = 6;// SWA

int Channel1 = 0 ; // Used later to 
int Channel2 = 0 ; // store values
int Channel3 = 0 ; // Used later to 
int Channel4 = 0 ; // store values
int SWAstate = 0 ; // store values


void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
   pinMode (channel1, INPUT);// initialises the channels
   pinMode (channel2, INPUT);// as inputs
   pinMode (channel3, INPUT);// initialises the channels
   pinMode (channel4, INPUT);// as inputs
   pinMode (SWA,INPUT);// Switch A 


}

void loop() {
  // put your main code here, to run repeatedly:

   
  Channel1 = (pulseIn (channel1, HIGH)); // Checks the value of channel1
  Serial.print ("Channel1 :");
  Serial.println (Channel1); //Prints the channels value on the serial monitor

Channel2 = (pulseIn (channel2, HIGH)); // Checks the value of channel1
  Serial.print ("Channel2 :");
  Serial.println (Channel2); //Prints the channels value value on the serial monitor

Channel3 = (pulseIn (channel3, HIGH)); // Checks the value of channel1
    Serial.print ("Channel3 :");
  Serial.println (Channel3); //Prints the channels value value on the serial monitor

Channel4 = (pulseIn (channel4, HIGH)); // Checks the value of channel1
    Serial.print ("Channel4 :");
  Serial.println (Channel4); //Prints the channels value value on the serial monitor
int SWAState = (pulseIn (SWA,HIGH)); // Checks the value of channel1
    Serial.print ("SWAState :   ");
  Serial.println (SWAState); //Prints the channels value value on the serial monitor

delay(2000);
}

Quad copter Arduino NANO : Test and Calibration ESC

https://en.wikipedia.org/wiki/Aircraft_principal_axes

 

https://en.wikipedia.org/wiki/Quadcopter

 

Remote control FlySky   FS-I6C  TX , FS-IA6B RX

 

500px-FlySky_IA6B_pinout-f89eed4f

https://www.dronetrest.com/t/connecting-a-matek-f405-ctr-to-fs-ia6b-receiver/7081

Flysky FS-I6 TX   remote control manual

https://drive.google.com/file/d/1pOiHj9m0HxIeDRs6IpjiTVY0ntMojYiw/view?usp=sharing

 

reference

http://www.electronoobs.com/eng_robotica_tut5_3.php

 

 

Test ESC and MOTOR and Direction

 

 

 

/*
        Arduino Brushless Motor Control
     by Dejan, https://howtomechatronics.com

and Modify by A-Arduino  :    www.a-arduino.com

*/
#include <Servo.h>
Servo ESC1;     // create servo object to control the 4 ESC
Servo ESC2;
Servo ESC3;
Servo ESC4;
int potValue;  // value from the analog pin
void setup() {
  // Attach the ESC on pin 9
  ESC1.attach(A1,1000,2000); // (pin A1, min pulse width, max pulse width in microseconds) 
  ESC2.attach(A2,1000,2000); // (pin A2, min pulse width, max pulse width in microseconds) 
  ESC3.attach(A3,1000,2000); // (pin A3, min pulse width, max pulse width in microseconds) 
  ESC4.attach(A4,1000,2000); // (pin A4, min pulse width, max pulse width in microseconds) 
}
void loop() {
  potValue = analogRead(A0);   // reads the value of the potentiometer (value between 0 and 1023)
  potValue = map(potValue, 0, 1023, 0, 180);   // scale it to use it with the servo library (value between 0 and 180)
  ESC1.write(potValue);    // Send the signal to the ESC
  ESC2.write(potValue);    // Send the signal to the ESC
  ESC3.write(potValue);    // Send the signal to the ESC
  ESC4.write(potValue);    // Send the signal to the ESC
}