In my previous post about NRF24, I set up the Transmitter and Reciever on a breadboard with jumper wires.
That was LEVEL 1
https://www.hackster.io/Oniichan_is_ded/nrf24-hookup-guide-97b240
LEVEL 2 would be a PCB which have buttons (or any INPUT Device/Module/Sensor) and LED(or any OUTPUT)
So I made these-
Black PCB is the Transmitter PCB which has 3 Buttons and one analog joystick and the white one is the Reciever PCB which has 6 servo/ESC port, One LED, 1 Button, and an MPU6050.
This PCB is made originally for a Future Drone Project which is in Progress.
I made these Two PCBs in OrCad Cadance and got them Manufactured by JLCPCB.
As you might know, JLCPCB is one of the best and well-known PCB manufacturers out there in the market, they offer great service for a very low price.
Crucial INFONow as we already know NRF24L01 module is not 5V Tolerant, so don't connect directly with any microcontroller's VCC or 5V port, instead, use 3.3V if available or a voltage regulator (3.3V AMS1117 perhaps) to regulate the 5V into 3.3V.
However, I used an Arduino Nano R3 which has 3.3V Output so I hooked NRF24 with it directly.
watch my video about NRF24 modules if you need to know the basics-
I'll just skip the foreplay and get straight to the main part, which is assembly.
Also,Thanks to UTSOURCE.net for offer electronic components for this project! you can check UTSOURCE.net they deal in all kinds of electronics components like for example all the Components used in this project!
Transmitter- Custom PCB x1
- Arduino Nano R3 x1
- NRF24L01 Module x1
- Analog Joystick THT x1
- Male Headers Pin
- Button x 2
- 1K Resistance 0805 x 1
- 10K Resistance 0603 x 2
- LED 0603 x 1
- Custom PCB x1
- Arduino Nano R3 x1
- NRF24L01 Module x1
- MPU6050
- LED 0603 x1
- 1K Resistance 0805 x1
- Button x1
- MPU6050 x1
- Male Header Pins
Assembly for both setups is pretty straight forward, first solder LEDs and Resistance on both setup and then add THT components like Buttons, Arduino Nano, NRF24, Joystick on both of the PCBs.
Schematic-
Receiver-
Transmitter-
So after the assembly, its time to TEST THESE Two, and for that, I will use two types of codes (LEVEL 1 and LEVEL 2)
LEVEL 1 Transmitter and Reciever code is nothing but a simple "sending message" Code. Transmitter side Transmit a Message and Reciever side will display that on the Serial Monitor.
So First upload the Transmitter Level 1 Code to the transmitter setup and power it from an outside source, like a power bank or 5V wall adaptor supply.
After that, hook Reciever to your computer and upload the Reciever Level 1 Code.
Result Level 1
The Serial Monitor will display the message which is transmitted via RF by Transmitter setup. If this works then we can move on to the next step, which is
LEVEL 2
In Level 2, we will change the code a little bit in order to toggle an LED on Reciever's Side with a Button on the Transmitter side.
Upload the Transmitter Level 2 Code and then Reciever Level 2 Code. this time we can power these two from an outside source as we don't need to use The serial monitor.
Result Level 2
LEVEL 3 would be to add a servo to this setup and control it with an analog joystick.
code for this is the same as before as in that code we already have defined the servo pin and analog joystick.
Now, because of this sketch, we can use both of these setups as transmitters and receivers at the same time.
LEVEL 4
at last, the goal of this project was to control a generic drone.
so I changed the code a little bit and this is how everything wents-
now, this definitely is not a final step, I still need to improve the code a lot and add mpu6050's code to this setup.
will do that soon.
Leave a comment if you need any help!
Comments