|
nRF24Lo1+ |
x 1 | |
|
L298D Motor driver IC |
x 1 | |
|
7805 Voltage Regulator |
x 1 | |
|
ARDUINO UNO REV3 |
x 1 |
|
arduino IDEArduino
|
How to Make Gesture Control Robot || #MadeWithArduino (Receiver PCB)
Hey, Welcome back to a new project. So today we will learn to create a Gesture Control Car using Arduino.
Here I am going to share the detailed tutorial of the Receiver part of the project, I have also shared another tutorial on the Transmitter part of the project. Here is the link to see it: https://bit.ly/3z9FzZQ
Check out the project tutorial video on YouTube:
First, let's talk about the materials that we require:
~ Arduino Uno
~ L298D Motor Driver IC
~ nRF24Lo1+
~ Male and Female Headers
~ 7805 5V Voltage Regulator
~ 18650 Battery
Get started with Mounting the components:
After arranging the above components we will need to solder the female and male header pins to the PCBs as shown in image.
Now one by one we will need to mount the components to the PCB. In the following pattern:
Now mount the PCB into the Arduino Uno. As shown below:
Now we need to mount the Arduino Uno into the Chassis using a double-sided tape.
After this, we need to connect the motor wires to PCB Motor output pins.
Now mount the battery Holder to the Chassis and connect it positive wire to the Vin pin of the PCB and the Negative wire to the GND pin of the PCB.
After being done mounting the components we will need to upload the code which is given as an attachment to this article.
Note: Before uploading the code make sure to connect the Arduino Uno with your computer and include the required libraries.
After connecting it, open Arduino IDE and upload the code.
When you are done with the uploading of the code simply disconnect the Arduino Uno with the computer.
So that is all for this project. Make sure to check out the Transmitter project tutorial (https://bit.ly/3z9FzZQ) and also Check our YouTube Tutorial Video: https://youtu.be/h1LBA7dPYe0
Thank you.
//Arduino Gesture control Receiver Code
//Created By DIY Burner
//Contact me here https://www.instagram.com/diy_burner/
//You need to include RF24.h library before uploading the sketch, otherwise you'll get compilation error message.
#include <SPI.h> //SPI library for communicate with the nRF24L01+
#include "RF24.h" //The main library of the nRF24L01+
//Define enable pins of the Motors
const int enbA = 2;
const int enbB = 7;
//Define control pins of the Motors
//If the motors rotate in the opposite direction, you can change the positions of the following pin numbers
const int IN1 = 3; //Right Motor (-)
const int IN2 = 4; //Right Motor (+)
const int IN3 = 5; //Left Motor (+)
const int IN4 = 6; //Right Motor (-)
//Define variable for the motors speeds
//I have defined a variable for each of the two motors
//This way you can synchronize the rotation speed difference between the two motors
int RightSpd = 130;
int LeftSpd = 150;
//Define packet for the direction (X axis and Y axis)
int data[2];
//Define object from RF24 library - 9 and 10 are a digital pin numbers to which signals CE and CSN are connected
RF24 radio(8,9);
//Create a pipe addresses for the communicate
const uint64_t pipe = 0xE8E8F0F0E1LL;
void setup(){
//Define the motor pins as OUTPUT
pinMode(enbA, OUTPUT);
pinMode(enbB, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
Serial.begin(9600);
radio.begin(); //Start the nRF24 communicate
radio.openReadingPipe(1, pipe); //Sets the address of the transmitter to which the program will receive data.
radio.startListening();
}
void loop(){
if (radio.available()){
radio.read(data, sizeof(data));
if(data[0] > 380){
//forward
analogWrite(enbA, RightSpd);
analogWrite(enbB, LeftSpd);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
if(data[0] < 310){
//backward
analogWrite(enbA, RightSpd);
analogWrite(enbB, LeftSpd);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
if(data[1] > 180){
//left
analogWrite(enbA, RightSpd);
analogWrite(enbB, LeftSpd);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
if(data[1] < 110){
//right
analogWrite(enbA, RightSpd);
analogWrite(enbB, LeftSpd);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
if(data[0] > 330 && data[0] < 360 && data[1] > 130 && data[1] < 160){
//stop car
analogWrite(enbA, 0);
analogWrite(enbB, 0);
}
}
}
How to Make Gesture Control Robot || #MadeWithArduino (Receiver PCB)
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by DIY Burner
- How to Make Gesture Control Robot || #MadeWithArduino (Transmitter) Hey, Welcome back to a new project. So today we will learn to create a Gesture Control Car using Ard...
- How to Make Gesture Control Robot || #MadeWithArduino (Receiver PCB) Hey, Welcome back to a new project. So today we will learn to create a Gesture Control Car using Ard...
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
156 1 1 -
-