Kurukshetra
+91 8813083500
robocircuits@gmail.com

How to Make Radio Controlled Arduino Car with FS-iA6 and Motor Driver Board

Learn Robotics

How to Make Radio Controlled Arduino Car with FS-iA6 and Motor Driver Board

Radio Controlled Arduino Car with FS-iA6 and Motor Driver Board

In this article i will guide you in detail how to Make Radio Controlled Arduino Car with FS-iA6 and LM298N Motor Driver Board so that you can make one of your own. This Arduino Project is easy to make and Fun to play with therefore read this article thorougly.

Components Needed

  1. Arduino UNO
  2. FlySky Transmitter Receiver
  3. L298N Motor Driver
  4. DC Motors
  5. Servo Motor
  6. Jumper Wires
  7. Wheels
  8. LiPo Battery
  9. LiPo Charger




 




FS-IA6

FS-IA6 6CH AFHDS 2A 2.4G Radio Receiver works great with the FlySky FS-i6 Controller.

This compact 6 channel receiver is great for any model using up to 6 channels and reliable, interference-free 2.4GHz AFHDS2A signal operation with a range exceeding 500 meters, it can be considered to be a full range for all but the most demanding of applications.

The receiver has end-on connectors to enable a neat installation in tight spaces. Dual antennas give the FS-iA6 excellent reception and interference rejection capability.

It comes with features such as Digital receiver system, Quick and extremely stable in performance and Ultra lightweight design. With easy binding, compact dimensions, and dual antennas!

We have a range of such transmitters and receivers which are can be used to fulfill your unmanned vehicle requirements.

LM298N

Motor1.JPG
L298N is an integrated monolithic circuit in a 15- lead Multiwatt and PowerSO20 packages. It is a high voltage , high current dual full-bridge driver de-signed to accept standard TTL logic level sand drive inductive loads such as relays, solenoids, DC and stepping motors. Two enable inputs are provided to enable or disable the device independently of the in-put signals .The emitters of the lower transistors of each bridge are connected together rand the corresponding external terminal can be used for the connection of an external sensing resistor. An additional Supply input is provided so that the logic works at a lower voltage.
Its schematic diagram is as shown in figure (a):


Motor2.png
(a)Schematic diagram for motor drive module

Features

1) High operating voltage, which can be up to 40 volts;
2) Large output current, the instantaneous peak current can be up to 3A;
3) With 25W rated power; 
4) Two built in H-bridge, high voltage, large current, full bridge driver, which can be used to drive DC motors, stepper motors, relay coils and other inductive loads. 
5) Using standard logic level signal to control.
6) Able to drive a two-phase stepper motor or four-phase stepper motor, and two-phase DC motors.
7) Adopt a high-capacity filter capacitor and a freewheeling diode that protects devices in the circuit from being damaged by the reverse current of an inductive load, enhancing reliability


Making Process

All the making process for Radio Controlled Arduino Car with FS-iA6 and LM298N Motor Driver Board is given in my YouTube Video. The video is given below. Check Out my YouTube Channel also. Kindly Subscribe if you like it for more “How to” and “DIY” videos.

Watch this Video For Full Tutorial

Code

int motor1Left = 5;// defines pin 5 as connected to the motor
int motor1Right= 6;// defines pin 6 as connected to the motor
int motor2Left = 7;// defines pin 7 as connected to the motor
int motor2Right = 8;// defines pin 8 as connected to the motor

int channel1 = 9; // defines the channels that are connected
int channel2 = 10;// to pins 9 and 10 of arduino respectively

int Channel1 ; // Used later to 
int Channel2 ; // store values

void  setup ()
{
   pinMode (motor1Left, OUTPUT);// initialises the motor pins
   pinMode (motor1Right, OUTPUT);
   pinMode (motor2Left, OUTPUT);
   pinMode (motor2Right, OUTPUT);// as outputs
   pinMode (channel1, INPUT);// initialises the channels
   pinMode (channel2, INPUT);// as inputs
   Serial.begin (9600); // Sets the baud rate to 9600 bps
}

void  loop ()
{
  Channel1 = (pulseIn (channel1, HIGH)); // Checks the value of channel1
  Serial.println (Channel1); //Prints the channels value on the serial monitor

  if (Channel1 > 1300 && Channel1 < 1500 ) /*If these conditions are true, do the following. These are the values that I got from my transmitter, which you may customize according to your transmitter values */
  {
    digitalWrite (motor1Left, LOW); // Sets both the
    digitalWrite (motor1Right, LOW);// motors to low
  }

  if (Channel1 < 1300) // Checks if Channel1 is lesser than 1300
  {
    digitalWrite (motor1Left, HIGH);// Turns the left
    digitalWrite (motor1Right, LOW); // motor forward
  }
  if (Channel1 > 1500) // Checks if Channel1 is greater than 1500
  {
    digitalWrite (motor1Left, LOW);// Turns the right
    digitalWrite (motor1Right, HIGH);// motor forward
  }
  Channel2 = (pulseIn (channel2, HIGH)); // Checks the value of channel1
  Serial.println (Channel2); //Prints the channels value value on the serial monitor

  if (Channel2 > 1300 && Channel1 < 1500 ) // If these conditions are true, do the following
  {
    digitalWrite (motor2Left, LOW);// Sets both the
    digitalWrite (motor2Right, LOW);// motors to low
  }

  if (Channel2 < 1300) // Checks if Channel2 is lesser than 1300
  {
    digitalWrite (motor2Left, LOW);// Turns the left
    digitalWrite (motor2Right, HIGH);// motor backward
  }
  if (Channel2 > 1500) // Checks if Channel2 is greater than 1500
  {
    digitalWrite (motor2Left, HIGH);// Turns the right
    digitalWrite (motor2Right, LOW);// motor backward
  }

/* NOTE – Check the values of the channels that you get in the serial monitor
           and adjust the values in the if statements accordingly. In my case when the stick
           was centered, my readings were 1400 to 1470. When the stick was raised, the readings were
           above 1470 and when it was lowered, the readings were below 1300.
*/

 

14 Responses

  1. Where can I find a link to the code for this wonderful project?

    • RoboCircuits says:

      Sorry for the late reply… I will send you code soon.
      Wait please

      • RoboCircuits says:

        /* This is the code for controlling any R/C car with an airplane transmitter written by Vishnu Chaitanya Karpuram. Enjoy!! */
        int motor1Left = 5;// defines pin 5 as connected to the motor
        int motor1Right= 6;// defines pin 6 as connected to the motor
        int motor2Left = 7;// defines pin 7 as connected to the motor
        int motor2Right = 8;// defines pin 8 as connected to the motor

        int channel1 = 9; // defines the channels that are connected
        int channel2 = 10;// to pins 9 and 10 of arduino respectively

        int Channel1 ; // Used later to
        int Channel2 ; // store values

        void setup ()
        {
        pinMode (motor1Left, OUTPUT);// initialises the motor pins
        pinMode (motor1Right, OUTPUT);
        pinMode (motor2Left, OUTPUT);
        pinMode (motor2Right, OUTPUT);// as outputs
        pinMode (channel1, INPUT);// initialises the channels
        pinMode (channel2, INPUT);// as inputs
        Serial.begin (9600); // Sets the baud rate to 9600 bps
        }

        void loop ()
        {
        Channel1 = (pulseIn (channel1, HIGH)); // Checks the value of channel1
        Serial.println (Channel1); //Prints the channels value on the serial monitor

        if (Channel1 > 1300 && Channel1 < 1500 ) /*If these conditions are true, do the following. These are the values that I got from my transmitter, which you may customize according to your transmitter values */ { digitalWrite (motor1Left, LOW); // Sets both the digitalWrite (motor1Right, LOW);// motors to low } if (Channel1 < 1300) // Checks if Channel1 is lesser than 1300 { digitalWrite (motor1Left, HIGH);// Turns the left digitalWrite (motor1Right, LOW); // motor forward } if (Channel1 > 1500) // Checks if Channel1 is greater than 1500
        {
        digitalWrite (motor1Left, LOW);// Turns the right
        digitalWrite (motor1Right, HIGH);// motor forward
        }
        Channel2 = (pulseIn (channel2, HIGH)); // Checks the value of channel1
        Serial.println (Channel2); //Prints the channels value value on the serial monitor

        if (Channel2 > 1300 && Channel1 < 1500 ) // If these conditions are true, do the following { digitalWrite (motor2Left, LOW);// Sets both the digitalWrite (motor2Right, LOW);// motors to low } if (Channel2 < 1300) // Checks if Channel2 is lesser than 1300 { digitalWrite (motor2Left, LOW);// Turns the left digitalWrite (motor2Right, HIGH);// motor backward } if (Channel2 > 1500) // Checks if Channel2 is greater than 1500
        {
        digitalWrite (motor2Left, HIGH);// Turns the right
        digitalWrite (motor2Right, LOW);// motor backward
        }

  2. Hi RoboCircuits

    I will wait with patience 🙂

  3. ZHENG says:

    Thanks for u share it bro, I am a Diy fans,i can’t find a new PCB board. i really want make a new project.
    My bro always take a newpcb from this site https://www.pcbgogo.com/?code=y,
    Pls tell me what kind of PCB that i need.If the borad is very expensive i can’t afford it.So maybe i can made a simple piano,Use the cheapest board.My bro said it only 5$ for 10pcs
    may be i will try it .

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.