Hey guys, In this post I’ll be showing you how to make a long range Arduino remote controller on a PCB for your robot.

Arduino Remote Controller PCB

If you are stuck somewhere feel free to come into your doubts below and I’ll try my best to clear it.

Arduino Remote Controller PCB Introduction

Here is the PCB I designed to make remote controllers for my robots.

Arduino Remote Controller PCB

These remote controller have joystick, buttons, accelerometer and extra pins to connect other analog sensors. I got these PCBs designed using EasyEDA and got it done from JLCPCB.

EasyEDA is an easier but powerful online PCB design tool which allows electronics engineers, hackers, educators, hobbyists, makers, and enthusiasts to design and share their projects’ schematics as well as PCB layout. This is a design tool integrated LCSC components catalog and JLCPCB PCB service that helps users to save time to make their ideas into real products. I will get back to it in detail.

Remote Controller PCB Video Tutorial

Making a PCB for Arduino Remote Controller

Getting Started with Robotics?

Want to learn Robotics from Scratch? Here is an awesome guide for you to get started with robotics (Free Video Tutorials Included).

Why Go for a PCB?

Here I have the joystick and an accelerometer, arduino nano and wireless module. Everything worked flawlessly. But the problem was the whole board looked really messy with all the jumper wires going here. So I decided to take you to next level. Designing my own PCB.

Steps

Arduino Remote Controller PCB – Components Needed

First we will take a look at the components needed to make your DIY Remote Controller for RC robot.

Step 1 – Designing the Circuit

Parts of the Remote Controller

We will divide our long range remote controller into 3 parts

  • Input
  • Processor
  • Transmitter

Input is the unit using which the remote controller gets data from the user. For example Joystick, Accelerometer, buttons, potentiometer etc. For this project, we will be using Accelerometer, Joystick and push buttons.

The Processor is the part that reads the data from the input unit, process/condition them for the Transmitting unit to send. Here we will be using Arduino Nano to process input.

The Transmitter is the part that sends the data from the remote controller to the robot’s receiving unit wirelessly. For our project, we will be using the HC12 Wireless module.

First connect all the components together on the breadboard so that I can troubleshoot easily if something goes wrong. This is how I assembled all the components on the breadboard.

Arduino Remote Controller in BreadBoard

Step 2 – Drawing Schematics using EasyEDA

To draw circuits and design PCBs, we have online PCB designing tools from EasyEDA, provides all the necessary capability for online PCB Design and PCB Printing of Circuit Boards with hundreds of components and multiple layers with thousands of tracks.

EasyEDA Online PCB Design

I drew a circuit in EasyEDA which included all the components on the breadboard – the joystick, accelerometer, Arduino Nano and HC12 module and 4 buttons which are connected to the digital pin of the Arduino. These buttons will be useful in the future.

I also added a 7805, regulator which will helped me to provide an input voltage between 7 volt and 35 volt in the input, so that I can use a 5 volt USB power supply, 9-volt battery or even a 12 volt lithium polymer battery without any issues.

EasyEDA Schematics

I also added some indicator LEDs that will let me know if something stopped working. You will find the circuit to my EasyEDA below.

Connections

Arduino – Joystick

  • 5 Vout – VCC Arduino
  • Gnd – Gnd
  • X – A2
  • Y – A3
  • Switch – D12

Arduino – HC12

  • 5 Vout – VCC Arduino
  • Gnd – Gnd
  • 10 – TX
  • 11 – Rx

Arduino – Accelerometer

  • 5 Vout – VCC Arduino
  • Gnd – Gnd
  • X – A0
  • Y – A1

Arduino – Switch

  • S1- D2
  • S2 – D3
  • S3 – D4
  • S4 – D5

Next, designing the PCB. PCB Layout is actually a significant part of PCB Design, we use PCB Layouts to make PCBs from schematics. I designed a PCB where I could solder all the components together.

For that, first save the schematics and from the top tool list, Click on the convert button and Select “Convert to PCB”. This will open up a window like this. Here, you can place the components inside the boundary and arrange them the way you want. The easy way route all the component is “auto-route” process. For that, Click on the “Route” Tool and Select “Auto Router”.

PCB Online Routing Options

This will open up an Auto Router Config Page where you can provide details such as clearance, track width, layer information etc. Once you have done that, click on “Run”.

Here is the link to EasyEDA Schematics of Remote Controller . Please feel free to dowload or edit the schematics/PCB layout.

Thats it guys, your layout is now complete. This a dual layer PCB which means the routing is there in both side of the PCB. You can now download the Gerber file and use it to manufacture your PCB from JLCPCB.

Step 3 – Getting the PCB Manufactured from JLCPCB

JLCPCB is a PCB manufacturing company with a full production cycle. Which means they start from “A” and finishes with “Z” of PCB manufacturing process. From raw materials to finished products, everything is done right under the roof.

Go to JLC PCBs website and create a free account. Once you have successfully created an account, Click on “Quote Now” and upload your Gerber File.

Adding Gerber File

Gerber File contains information about your PCB such as PCB layout information, Layer information, spacing information, tracks to name a few.

Gerber File Preview

Below the PCB preview, you will see so many options such as PCB Quantity, Texture, Thickness, Color etc. Choose all that are necessary for you.

PCB Options

Once everything is done, click on “Save To Cart”. In the next page, you can choose a shipping and payment option and Check Out Securely. You can either use Paypal or Credit/Debit Card to pay.

Thats it guys. Its Done. The PCB will be manufactured and shipped with in days and will be delivered to your doorstep within the mentioned time period.

Step 4 – Arduino Remote Controller Code

Once I got the PCB I checked all the connections and started soldering all the components onto it. Now it’s time to upload the code the coding part is exactly the same as the breadboard version. Simply download the code using the download link below and upload it to your arduino of the remote controller. 

Long Range Arduino Remote Controller Code

Code Explained

#include <SoftwareSerial.h> 
#include <Wire.h> 
SoftwareSerial HC12(10, 11); 

Basically what this code do is it will start a Software Serial connection at pin 10 and 11, where we connect the TX and our HC12 wireless module. 

digitalWrite(A0,0);
digitalWrite(2, HIGH);
x = analogRead(A0);
y = analogRead(A1);
lr = analogRead(A3);
bf = analogRead(A2);
sw = digitalRead(D12);

Arduino will read the analog voltage of the pins  A0 to A3 and D12 (switch of Joystick) where we connect the input units – the accelerometer and the joystick and store their values in different variables. 

If you are using buttons/switches, you can use 4 more variables to collect data from pins D2-D5.

HC12.print(x);
HC12.print(",");
HC12.print(y);
HC12.print(",");
HC12.print(lr);
HC12.print(",");
HC12.print(br);
HC12.print(",");
HC12.print(sw);
HC12.println("");

This will create a single long string by campaigning all the data together. This will then be sent to the remote control robot.

Once you’re done uploading, open up the serial monitor you will see all the sensor data that is being read by the Arduino as a single line separated by commas.

This is how our data will be sent to the remote robot.

Step 5 – Coding the Receiver

Now it’s time to receive the data from the remote controller. In the receiving unit I used an Arduino nano and another HC12 as the receiver. 

Code

include 
  String input;
  int x,sx;
  int y,sy;
  int lr;
  int bf;
  int sw;
  String input;
  int boundLow;
  int boundHigh;
  const char delimiter = ',';
  SoftwareSerial hc12(4, 5);
  void setup()
  {
  Serial.begin(9600);
  hc12.begin(9600);
  delay(2000);
  }
  void loop()
  {
  if(HC12.available())
    {
    input = HC12.readStringUntil('n');
    if (input.length() > 0)
        {
         Serial.println(input);
    boundLow = input.indexOf(delimiter);
    x = input.substring(0, boundLow).toInt();
    boundHigh = input.indexOf(delimiter, boundLow+1);

    y = input.substring(boundLow+1, boundHigh).toInt();
    boundLow = input.indexOf(delimiter, boundHigh+1);

    lr = input.substring(boundHigh+1, boundLow).toInt();
    boundHigh = input.indexOf(delimiter, boundLow+1);    

    bf = input.substring(boundLow+1, boundHigh).toInt();    

    sw = input.substring(boundHigh+1).toInt();    
    delay(10);  
    }
   }
  }

Simply upload this code and open up the serial monitor.

Code Explained

Here what exactly happening is, first we read the data coming from the receiver module to a variable named “input”.

if(HC12.available())
     {
     input = HC12.readStringUntil('n');

This “input” is a long string of numbers separated by commas. 

    boundLow = input.indexOf(delimiter);
    x = input.substring(0, boundLow).toInt();
    boundHigh = input.indexOf(delimiter, boundLow+1);

    y = input.substring(boundLow+1, boundHigh).toInt();
    boundLow = input.indexOf(delimiter, boundHigh+1);

    lr = input.substring(boundHigh+1, boundLow).toInt();
    boundHigh = input.indexOf(delimiter, boundLow+1);    

    bf = input.substring(boundLow+1, boundHigh).toInt();    

    sw = input.substring(boundHigh+1).toInt();  

This thing is broken down into smaller numbers and is then stored in separate variables. 

You can now use these variables to drive your robot the way you want you will find all the circuits, codes and instructions here.

I use this remote controller for almost all of my robot.

Whats Next?

Making an Arduino Robot

How about making cool Robot with this Remote Controller? Check out this Bad Boy – The Robotin6.

It is an Off Road 6 Wheel Drive Crawler which can be remotely controlled using an Arduino remote controller. Here also we will be using the same robot, only thing different here will be the code which we will upload to the robots Arduino. Click Here for Complete Tutorial.

Did you find this page useful? Help us to improve by rating this page.

[RICH_REVIEWS_FORM]

[RICH_REVIEWS_SNIPPET stars_only=”true”]

Similar Posts

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *