A Robotic Car Using Joystick, NRF24L01 Module and Arduino Nano

by rajeeviitkgp11 in Circuits > Arduino

3119 Views, 9 Favorites, 0 Comments

A Robotic Car Using Joystick, NRF24L01 Module and Arduino Nano

robotic_car.JPG

Rajeev Kumar, Basant Singh Tomar and Sukanya Barua

Indian Agricultural Research Institute, Pusa, New Delhi

Introduction

A remote controlled Robotic small car has been developed. The car consists of mechanical and electronic hardware parts mounted on the car and remote controller. The car is controlled remotely with remote controller. Mechanical Parts as Two rear wheel, one ball caster wheel and chassis are mounted on car. Electronics parts consist of one Arduino Nano board, L298N 2A motor driver, NRF24L01 2.4GHz Wireless Transceiver Module, 9V Lithium ion 18650 Battery. Remote controller consists of PS2 Joystick Module, 2.4GHz NRF24L01+PA+LNA SMA Wireless Transceiver module, 9 V Battery and DPDT switch. One NRF24L01 Transceiver mounted on the remote control act as a transmitter and another NRF24L01 Transceiver mounted on the car act a receiver. A joystick generates the analog values and this analog value send by transmitter and receives by NRF24L01 receiver mounted on the car. Speed and direction of car depends on the analog value generated by joystick. The NRF24 master library is required during development of programming cade to operate the NRF24L01 module in receiver as well as transmitter unit. The NRF24L01 is a wireless transceiver module; i. e. it can transmit and as well as receive the data. It is operated in the frequency of 2.4GHz, which falls under the ISM band and hence it is legal to use in almost all countries for engineering applications. The NRF24L01 module works with the help of SPI communications. The modules when operated efficiently can cover a distance of 100 meters which makes it a great choice for all wireless remote controlled projects.

Required Components:

Component Quantity

The components required for development of this robotic car is given below

Arduino Nano = 2

NRF24L01 2.4GHz Wireless Transceiver = 2

PS2 Joystick module = 1

Motor driver L298N, 2A = 1

Battery (9-12V, 2200 mAh) = 2

Battery Clip Connector = 2

60 RPM Single shaft BO DC Motor = 2

General purpose PCB = 2

The project is developed in three steps. First steps is to operate the DC motor using motor driver and Arduino Nano board at the different speed by putting different analog values in the programming code. Second step is setup the communication between receiver and transmitter of NRF24L01 Wireless module. Third steps is development of complete project.

First Step As the Operating of DC Motor:

Fig1.JPG
table1.JPG

Connection diagram for operating of motor is shown in Fig. 1. The diagram consists of Motor driver, two DC motors, Arduino Nano board and Battery.

Connection for operating motor with the help of Motor driver and Arduino Nano board and battery is also given the table 1.

Programming Code for Operating the DC Motor

motorP1.JPG
motor2P2.jpg

Programming has been written in the Arduino IDE compiler and it is uploaded on Arduino Nano microcontroller board. Screen shot is shown in this step. Programming code file can be downloaded from download button in this step. xAxis value is used for forward and backward speed control whereas yAxis used for left and right. Speed and direction of motor can be changed by changing this value.

Downloads

Second Step As Communication Setup Between Receiver and Transmitter Module

Fig2.JPG
table2.JPG

Development of Remote controller as a transmitter

Connection diagram of remote controller as a transmitter is shown in the Fig 2. It is consist of NRF24L01 transceiver module, Arduino Nano board, Joystick, DPDT switch and Battery.

Connection of developed remote controller as a transmitter is also given in the table 2. Connections points 1 of NRF24L01, Joystick and Battery with connection points 2 of Arduino Nano are also given the table 2.

Programming Code for Remote Controller As a Transmitter

senderP.JPG

Programming has been written in the Arduino IDE compiler and it is uploaded on remote controller Arduino Nano microcontroller board. Screen shot is shown in this step. Programming file can be downloaded and it can be used directly for operating the DC motor, Programming code is self explanatory in the programming code file.

Downloads

Development of Receiver

ReceiverD.JPG
ReceiverT.JPG

Connection diagram of receiver only is shown in the Fig 3. It is consist of NRF24L01 transceiver module, Arduino Nano board and Battery.

Connection of NRF24L01 receiver is also given in the table 3. Connections points 1 of NRF24L01 and Battery with connection point 2 of Arduino Nano are given the table 3.

Programing Code for Receiver

ReceiverP.JPG

Programming code has been written in the Arduino IDE compiler and it is uploaded on receiver Arduino Nano microcontroller board. Screen shot is shown in this step. Programming file can be downloaded and it can be used directly by uploading in the board. Programming code is self explanatory in the programming code file. During the development of this project, all should check the transmitted data and received data for further step. in my case almost same data is received as transmitted by the transmitter during the development of project. Data received by the receiver is used for conditional code (if and else if case) for operating the motor in the final code. all should write down the received data in different operating condition such as Neutral, forward, backward, left turn and right turn. This data is used for final operating the DC motor program section.

Downloads

Third Step As a Development of Small Robotic Car

Fig4.JPG
table4.JPG

Connection diagram of developed small robotic car as a receiver is shown in the Fig 4. Electronics parts consist of two DC Motors, Motor driver, Arduino Nano board, NRF24L01 transceiver and Battery.

Connection of developed small robotic car with NRF24L01 receiver is also given in the table 4. Connections points 1 of motor driver, NRF24L01 module with connection point 2 of Arduino Neno, Battery, and motors are given the table 4.

Previous motor and receiver programming has been combined and it is uploaded on receiver Arduino Nano microcontroller board. Programming file can be downloaded and it can be used directly in your project. Developed remote controller in the previous step has also been used for final project.

Downloads