Hello guys my self pankaj and welcome to
our blog THE ELECTRONICS CREATOR
Todays we are starting the drone making series.
In todays video we make drone receiver. For that we need
some components and a useful circuit systematic diagram.
Needed components
Ardiuno Nano
NRF 24Lo1 RF module.
2 X 25volt 10uf Capacitor
AMS1117 3.3v regulator IC
Male heeder pins.
Small PCB
Connecting wires
male and female heeder pins and veroboard
Procedure
1st
we can solder an Arduino nano and the NRF24L01 module on vero board.
Connect
10uf capacitor between VCC and GND pin of RF module.
Here
we use AMS1117 3.3v regulator IC because guys the RF MODULE working on 3.3volt,
Now
guys you can said if the 3.3v pin is already available on Arduino so why you
are use this IC, because guys that arduino 3.3volt pin cannot provide efficient
current to this RF MODUL so directly we use this external IC that is AMS1117.
Now
guys make connection by following this diagram.
Or guys after making this CIRCUIT we need
the upload program for that you can download this program file and open it in
your ARDUINO IDE software
Before uploading this program you need to download
sum libraries that you can download from here.
Now guys our receiver circuit is ready….
Now guys our 1st circuit is
ready
So byy byy and tack care. We will meet in
another video…….
if you not geting code you ca copy this code directly
/*A basic 4 channel transmitter using the nRF24L01 module.*/
/* Like, share and subscribe, ELECTRONOOBS */
/* http://www.youtube/c/electronoobs */
/* First we include the libraries. Download it from
my webpage if you donw have the NRF24 library */
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
/*Create a unique pipe out. The receiver has to
wear the same unique code*/
const uint64_t pipeOut = 0xE8E8F0F0E1LL; //IMPORTANT: The same as in the receiver
RF24 radio(9, 10); // select CSN pin
// The sizeof this struct should not exceed 32 bytes
// This gives us up to 32 8 bits channals
struct MyData {
byte throttle;
byte yaw;
byte pitch;
byte roll;
byte AUX1;
byte AUX2;
};
MyData data;
void resetData()
{
//This are the start values of each channal
// Throttle is 0 in order to stop the motors
//127 is the middle value of the 10ADC.
data.throttle = 0;
data.yaw = 127;
data.pitch = 127;
data.roll = 127;
data.AUX1 = 0;
data.AUX2 = 0;
}
void setup()
{
//Start everything up
radio.begin();
radio.setAutoAck(false);
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipeOut);
resetData();
}
/**************************************************/
// Returns a corrected value for a joystick position that takes into account
// the values of the outer extents and the middle of the joystick range.
int mapJoystickValues(int val, int lower, int middle, int upper, bool reverse)
{
val = constrain(val, lower, upper);
if ( val < middle )
val = map(val, lower, middle, 0, 128);
else
val = map(val, middle, upper, 128, 255);
return ( reverse ? 255 - val : val );
}
void loop()
{
// The calibration numbers used here should be measured
// for your joysticks till they send the correct values.
data.throttle = mapJoystickValues( analogRead(A0), 13, 524, 1015, true );
data.yaw = mapJoystickValues( analogRead(A1), 1, 505, 1020, true );
data.pitch = mapJoystickValues( analogRead(A2), 12, 544, 1021, true );
data.roll = mapJoystickValues( analogRead(A3), 34, 522, 1020, true );
data.AUX1 = digitalRead(4); //The 2 toggle switches
data.AUX2 = digitalRead(5);
radio.write(&data, sizeof(MyData));
}