Nrf and Arduino based robot project is based upon nrf wireless module. The project is about how to make a robot at home with remote control wireless. Nrf is a wireless module used for two way wireless communication. It is used for engineering robot projects and for many other nrf applications. We will discuss robotics projects using Arduino and nrf in this post.
Arduino Wireless Remote control Robot
A wireless controlled Omani directional robot. A wireless controlled robot can be used in many ways. I made this for playing a soccer because there was an event of soccer playing robots in my Institute. It’s quite easy to communicate between two Arduino’s using nRF 24L01+ module.
There are few simple steps to make Omani directional wireless controlled the robot. First thing is to make it wireless controlled then turn it to soccer, pick and place, cleaning or any other purpose whatever you want.
01: Components Required
Mechanical:
- An acrylic or aluminum chassis
- 4x DC Geared motors
- 4x Omni wheels
Electronics:
- 2x Arduino Uno
- 2x nRF 24L01+ module
- 2x L298 H-bridge module
- jumper wires
- battery
There are three components in mechanical section. First thing is to make a base I used four aluminum sheets (28cm diameter) and these were much costly. We can also use two acrylic sheets. We can use already made robotics kits but for making soccer robot we need a little much bigger size so I will prefer you to make it your own. Make a sketch design in solids works or sketch up. These are the best software in 3D designing.
The four DC Geared motors needed I used around 350 RPM, and 4 Omani wheels these were I bought from online store. I used 12 volt 5A battery. Two Arduino Uno boards will be used for wireless communication with each other.
nRF24lo1+ is the best choice for wireless communication and it has a very good range. But remember it works on 3-volt.i will not explain much about the components here but you can read about it on google or Wikipedia etc.
02: Pin out Configuration making transmitter(TX) and receiver(RX)
See the figure about Pinout configuration of Nrf with Arduino and the H-Bridge pin configuration.
The second step is the pin out configuration of nRF24L01+ with Arduino. we have to make one one nRF module TX and other Rx.
First, make the Transmitter part (TX):
Before connecting with Arduino don’t forget to add a capacitor at both the ends of TX and RX of nRF between the pin VCC and GND. Connect a 50 Uf or higher Capacitors with both modules because sometimes they will not work properly. The TX will send but RX will not receive. Connect CE and CSN in 7 and 8 SCK and MOSI in 11 and 12 MOSI in 13 GND and VCC in 3V
See the photos for the pinout of RX and H-bridge:
Connect the h-bridge with motors and enable pins in PWM pins on Arduino and others with any digital pin of Arduino.
03: Assembling and Coding
04: Arduino Code
#include #include "nRF24L01.h" #include "RF24.h" const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL }; // 13 is SCK on nRF // 12 is MISO on nRF // 11 is MOSI on nRF // 10 is CSN on nRF RF24 radio(9,10); // 9 is CE on nRF
After initialization there is a pipeline between two Arduino’s it should be the same on both transmitter and receiver. now initialize the radio and it will begin the conversation between two pipelines.
void setup(void) {Serial.begin(9600); radio_initialize(); Serial.println("RADIO STARTED");} Now in loop function it checks if receiving serial available then it will start sending data. char data[] = "1"; void loop() { if(millis()%1000==0) { data[0]++; Serial.print("Sending: "); Serial.print(data[0],DEC); bool ok = radio.write( data, 2 ); if (ok) Serial.println("oknr"); else Serial.println("failednr"); if(data[0]=='6') data[0]='1'; } } void radio_initialize(void) { radio.begin(); radio.openWritingPipe(pipes[1]); radio.openReadingPipe(1,pipes[0]); radio.startListening(); }
Don’t just copy and past .it will only work according to your connections. I hope you will understand the code easily if you are aware about the Arduino’s coding. Here is the sample code for both Tx and Rx. Now open the serial monitor in both Tx and Rx side and send 1 from Tx and it will receive on Rx serial monitor window.as it is for other number we initialize 1 in the code for forward function now initialize 2 for back and so on.
I hope you understand how to communicate between two Arduino’s. the main purpose is to make the wireless controlled once it’s done add whatever you want. Now we can use it in many ways…have fun…!!!
I have covered this topic in another post of making soccer robot so you can get the additional information from it. See the similar posts on how to make a robot for RoboCup and how to control it from keyboard or joystick. If you have any query then comment below and subscribe to our YouTube channel for Video Tutorials.