Arduino-Remote-Controller-using-HC12-Wireless-Module
I will give you the complete schematics, codes and complete layout of all the boards used in this Arduino RC robot to make one yourself. So stay tuned!
6-Wheel Drive Rough Terrain Robot Chassis
The whole off-road robot chassis is built using 2 mm aluminum alloy and the surface is coated with aluminum.
Even though the material is lightweight, it is very strong and can carry all the; components - microcontroller, sensors and motors without any hassle.
It has 6 high-speed DC motors, with an RPM of 17, 000 combined with 1:34 full metal gearbox, enabling your 6-wheeled robot to obtain amazing speed and off-road performance. The use of six hydraulic spring dampers ensure adaptive driving experience even on rough terrains and uneven surfaces.
Arduino Off-Road Robot Components
Robot Chassis
Arduino Pro Mini
HC12
Remote Controller
VNH2SP30 Motor Driver
LiPo Battery
Making Arduino RC Robot
HC12
Here, we will be using HC 12 wireless module for transmitting data from the DIY Remote Controller to the RC Robot.
They are commonly used in remote controlled robots and other wireless communication projects. This wireless module works under 433 megahertz frequency.
When combined with an external antenna, this wireless module can transmit and receive data from a distance
of up to 1 Kilometer line of sight and due to this reason we will be using this wireless module for our robot.
This wireless module can be easily connected to arduino or Raspberry Pi, and start using it for your project right away.
Another advantage of using HC12 wireless module for your RC robot is, this module requires only two pins – TX and RX, for data transfer.
You can save the rest of the pins of your arduino or Raspberry Pi for other things.
High current Motor Driver
As I mentioned earlier this robot chassis have 6 high speed DC Motors with a speed of 17000 RPM combined with 1:34 metal gear box.
Each motor draws a current of about 350 milli ampere. As you might know, for almost all of my Robots, I use either L293D motor driver or L298N motor driver.
Here also I tried L293D and L298N Piggybacked. Even though it worked fine, too much energy was wasted as heat after 5 minutes of continuous usage.
So I decided to go for another high current motor driver, named VNH2SP30, that can provide a peak current of 30 amperes.
If you are not familiar with this VNH2SP30 High Current DC Motor Driver, please click this link you know more about it.
This motor driver board can control only one motor at a time. So here we will be using two motor driver boards to control both DC motors.
Powering up the Off Road Robot
For this project I’ll be using a 12 volt Lithium polymer battery as a power source.
This can provide enough power to drive all the six DC Motors, power up the arduino, HC12 module and the motor drivers without any issues.
That's all you need to know about all the components used in this off road RC robot. started with making the robot.
Want to make one yourself? Complete code and circuit are available Arduino RC Robot
Arduino Remote Controlled Robot – The Remote controller
Basically what this remote controller does is, it reads analog and digital data from sensors such as accelerometer buttons joystick and store them in separate variables. These variables will be combined together to form a single long string and this string will be sent to our robot using the HC12 wireless module.
Circuit
I made a circuit which included all the components: the joystick, accelerometer, arduino nano and hc12 module connected to the GPIO pin of the arduino and assembled it on a breadboard.
t worked flawlessly but the problem was, the whole board looked really messy with all the jumper wires going here and there. So I decided to go with PCB.
In the PCB version, I added 4 switches which I will be using for the next project.
I also added a 7805 regulator which will help me to provide an input voltage between 7V and 35V so that I can use a 5V USB power supply, 9V battery or even 12 V Lipo battery without any issues. I also added some indicator LEDs that will let me know if something stopped working. You will find the circuit in the link below.
If you guys planning to order PCB I will suggest you to go with JLCPCB.com
First I was also hesitate to try custom PCB my belief was they are much expensive.
but then I came to know about JLCPCB.com and I was totally surprised how low price PCB's are they offering not only PCB JLCPCB.com is one-stop service from PCB design and PCB prototype to PCB assembly to PCB enclosures,
SMT Assembly service of JLCPCB.com is cherry on top now get your PCB fully assembled and save your time and money Select components for your PCB from there Parts Library of 200k+ in-stock components they are offering $27 valued New User coupon & $24 SMT coupons every month $8.00 setup fee, and $0.0017 per joint
Now no need to order components separately for you PCB and get free from stress of soldering them on PCB just try PCB SMT assembly service and get you PCB with components pre assembled and ready for the project
For more detials & offers please visit JLCPCB.com
After downloading the Garber file you can easily order the PCB
- Visit JLCPCB.com and Sign in / Sign up
- Click on the QUOTE NOW button.
3 Click on the "Add your Gerber file" button. Then browse and select the Gerber file you have downloaded.
- Set the required parameter like Quantity, PCB masking color, etc
- After selecting all the Parameters for PCB click on SAVE TO CART button.
- Type the Shipping Address.
- Select the Shipping Method suitable for you.
- Submit the order and proceed with the payment. You can also track your order from the JLCPCB.com.
My PCBs took 2 days to get manufactured and arrived within a week using the DHL delivery option.
PCBs were well packed and the quality was really good at this affordable price.
Coding
Now it’s time to upload the code. This is the code. I will share the link in the description, you can simply copy and paste the code and upload it to your controller.
Basically, what this code do is, it will start a software serial connection at pin 10 and 11 where we connect the Tx and Rx pins of HC12 wireless module.
Arduino will read the analog voltage of the pins A0 – A4 where we connect the sensor inputs (accelerometer and joystick) and store their values in different variables.
Then it will create a single long string by combining all the data which will then be send to the Remotely Controlled Robot.
Once you are 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.
The Robot
Now it’s time to receive the data from the remote controller. In the receiving unit, I used an Arduino nano clone and another HC12 as receiver.
ou can use any motor driver board to drive the motors in the robot. This robot chassis have 6 high speed DC Motors with a speed of 17000 RPM. Each motor draws a current of about 350 milli ampere. As you might know, for almost all of my Robots, I use either L293D motor driver or L298N motor driver.
Since we have 6 DC motors, I decided to go for another high current motor driver, named VNH 2SP30, that can provide a peak current of 30 amperes.
If you are not familiar with this VNH2SP30 High Current DC Motor Driver, please click this link to know more about it.
This motor driver board can control only one motor at a time. So here we will be using two motor driver boards to control all the DC motors.
The Circuit
Next step, Connecting all the components together. We will connect the HC12 module to the Arduino, which will process the data coming from the HC12 module of the Remote controller.
Once the data is processed, we will drive the motors using the high current DC motor driver connected to the Arduino. The whole circuit will be powered using the LiPo battery.
Connections for the Circuit of RC Robot
Arduino —— HC12
5 Vout – VCC Arduino
Gnd – Gnd
10 – TX
11 – Rx
Arduino —– Motor Drivers
Pin 12 – Motor Driver 1 In1
Pin 13 – Motor Driver 1 In2
Pin 3 – Motor Driver 1 PWM
Pin 8 – Motor Driver 2 In1
Pin 7 – Motor Driver 2 In2
Pin 5 – Motor Driver 2 PWM
Motor Drivers —– Motor
Motor Driver 1 Out 1 – Motor 1 Terminal 1
Motor Driver 1 Out 2 – Motor 1 Terminal 2
Motor Driver 2 Out 1 – Motor 2 Terminal 1
Motor Driver 2 Out 2 – Motor 2 Terminal 2
Motor + – 12 V
Motor – – 0 V
Vcc – 5 V
Gnd – 0 V
Arduino Code
#include <SoftwareSerial.h> #include <Wire.h> SoftwareSerial HC12(10, 11); int x; int y; int lr; int bf; int sw; void setup() { HC12.begin(9600); Serial.begin(9600); pinMode(A0, INPUT); pinMode(A1, INPUT); pinMode(A2, INPUT); pinMode(A3, INPUT); pinMode(A4, INPUT); pinMode(2, OUTPUT); } void loop() { digitalWrite(A0,0); digitalWrite(2, HIGH); x = analogRead(A0); y = analogRead(A1); lr = analogRead(A3); bf = analogRead(A2); sw = analogRead(A4); 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(""); delay(100); }