Introduction: Wireless Controlled Omani Directional Soccer Robot Using NRF 24L01+ and Arduino

Hey everyone

Welcome to my first instructable. 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's quit easy to communicate between two arduino's using nRF 24L01+ module.there are few simple steps to make Omani directional wireless controlled 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.
See the following Link For Complete Arduino code and Design sketch files

Step 1: Getting Started

Components Required:


  • An acrylic or aluminium chassis
  • 4x DC Geared motors
  • 4x omani wheels


  • 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 aluminium 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 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 or in any other instruct able..

The sketch files of base plates are attached.

Step 2: Pin Out Configuration Making Transmitter(TX) and Receiver(RX)

The second step is the pin out configuration of nRF24L01+ with arduino. we have to make one one nRF module TX and other Rx.

Here is the pin out of nRF24l01+ as you can see in the figure.









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 recieve.

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 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.

Step 3: Assembling and Coding

Once you complete assembling of parts there comes the main part that is programming.start with initializing as according to your pin out arduino board with nRF and h-bridge.don't forget to add the library for nRF.The library file is attached.

  • #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("ok\n\r");
  • else Serial.println("failed\n\r");
  • if(data[0]=='6') data[0]='1'; } }
  • void radio_initialize(void)
  • { radio.begin();
  • radio.openWritingPipe(pipes[1]);
  • radio.openReadingPipe(1,pipes[0]);
  • radio.startListening(); }

Receiving (RX)

In receiving part start with initializing motor pins.

  • RF24 radio(0,10);
  • const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
  • int m1e = 3;
  • int m11 = A2;
  • int m12 =A3;
  • int m2e = 5;
  • int m21 = A4;
  • int m22 = A5;
  • int m3e = 6;
  • int m31= 7;
  • int m32 = 8;
  • int m4e = 9;
  • int m41 = A1;
  • int m42 = A0;
  • void setup(void) {
  • pinMode(m1e, OUTPUT);
  • pinMode(m11, OUTPUT);
  • pinMode(m12, OUTPUT);
  • pinMode(m2e, OUTPUT);
  • pinMode(m21, OUTPUT);
  • pinMode(m22, OUTPUT);
  • pinMode(m3e, OUTPUT);
  • pinMode(m31, OUTPUT);
  • pinMode(m32, OUTPUT);
  • pinMode(m4e, OUTPUT);
  • pinMode(m41, OUTPUT);
  • pinMode(m42, OUTPUT);
  • Serial.begin(9600); radio_initialize();
  • Serial.println("RADIO STARTED");
  • }

The pin m1e is the enable pin of motor 1 and as it is for other 3 motors.
now start with radio read command it will read the serial and if it received then it will transfer it to the is the code for only forward function.

  • char data[1] = "";
  • void loop(void) {
  • if(radio.available()){, 1);
  • Serial.print("RECEIVED = ");
  • Serial.println(data[0]);
  • if(data[0]=='1'){ Serial.print("Came");
  • forward();
  • void radio_initialize(void){ radio.begin();
  • radio.openWritingPipe(pipes[1]);
  • radio.openReadingPipe(1,pipes[0]); radio.startListening(); }
  • void forward()
  • { analogWrite(m1e,230);
  • digitalWrite(m11, LOW); // motor2
  • digitalWrite(m12, HIGH);
  • analogWrite(m2e,250);
  • digitalWrite(m21, LOW); // motor 3
  • digitalWrite(m22, HIGH);
  • analogWrite(m3e,250);
  • digitalWrite(m31, LOW); // motor1
  • digitalWrite(m32, HIGH);
  • analogWrite(m4e,230);
  • digitalWrite(m41, HIGH); // motor4
  • digitalWrite(m42, LOW);
  • }

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 adruino's is the sample code for both Tx and open the serial monitor in both Tx and Rx side and send 1 from Tx and it will receive on Rx serial monitor it is for other number we initialize 1 in the code for forward function now initialize 2 for back and so on.

Step 4: Testing

Here is the testing video of wireless communication between two arduino's using nRF. it's without assembling of complete parts.just the test after execution of code.

Step 5: Kicking Mechanism and Boost Converter Circuit

I used boost converter circuit for kicking we can also use actuators etc. see the figure for solenoid.the front part of rod will be of aluminium and the back side made of iron.the length of rod is 8 can modify the sketch here is just the concept of solenoid. i will explain the whole boost converter project in another instruct able.

See the circuit diagram of boost converter.This one i got from my friend with the following instructions and explanation.

Transformer Base Boost Circuit
CAUTION: High Voltage DC handle carefully and don't work alone. this is the simple as possible boost circuit, operate at low frequency (<500hz) this circuit made with regular components available in market. that's a reason i do not go for high frequencies for which you need special type transformer mosfet and diode which is not easily available in market .


2 X irf740

1 Small Transformer 12:220

1 variable resistor 200k

1 zener diode 5.1 volts

1 shockley diode HER 307

1 capacitor 200uF or greater @400volts

2 10K resistor

3 2-Pin terminal

2 1k resistor

In this circuit one end of low side is connected with 12v battery and the other at the drain of mosfet and gate of mosfet is isolated via optocoupler 817 . J2 is the 2 terminal connector from where you apply PWM signal and duty must be less then 80 % on the other side (secondary side) here we have shockley diode (HER 307 or better of your choice) and a polar capacitor 200uF of 400 volts or you can increase your capacitance for good results and make sure your voltage should not exced from 250 volts you might increase capacitance for better kick the feed back resistor is acutally a pot of 200k and zener diode of 5.1 volts is grounded to protect controller from high voltage this pin is connected with analog channel of controller or any other pulse generator to trace output voltage. when it reach to desire voltage it turn off PWM at that point boost is completed connect kicker solenoid at J1 which is trigger from optocoupler 817 at right side but one thing you should have to care about its trigger time ,it must me less then 100ms .

Step 6: Finishing...

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 kicker,dribbler or whatever you we can use it in many ways...have fun...!!!

See the full post for Complete arduino Code and Sketch files:


DIY Hacks and How Tos made it! (author)2016-05-22

Great robot design. Do you have any videos of it in action?

Muhammad Ahtsham made it! (author)Muhammad Ahtsham 2016-05-23

Thanks..Well i don't have competition day video but have one during testing...

About This Instructable




Bio: A Mechatronics Engineer , Public Speaker and writer.
Add instructable to: