VK 2WD Electric Car with Arduino

Have you ever wanted to build yourself a 2WD Electric Car and control it wirelessly especially through your Android application? In this post, I am going to share some concepts and simple working details on how you could get your own 2WD Electric Car controlled through android application.

Video presentation of the 2WD Electric Car

Below is the block diagram for the whole project:

2wd car block diagram

Required Parts

  • 1 x ATMega8
  • 1 x L293D motor driver
  • 1 x HC-05 Bluetooth module
  • 1 x 16MHz Crystal
  • 1 x AMS 1117 5V linear voltage regulator
  • 2 x DC motor
  • 2 x 3.7V Battery
  • 1 x Battery holder
  • 1 x LCD 16×2 blue backlight
  • 6 x LEDs
  • 1 x 660Ω resistor
  • 2 x 0.1µF cap
  • 2 x 10µF cap
  • 2 x 22µF cap
  • 1 x Buzzer
  • 1 x SPDT Switch
  • 1 x 2.1mm DC power jack

The Schematic for hardware

2WD Electric Car schematic

As you can see from the schematic, it is divided into few section:

Section 1: Power supply using the AMS1117-5V voltage regulator with lower drop out voltage as compared to common LM7805. Datasheet AMS1117-5V

Section 2: Microcontroller( Atmega8/Atmega 328) to control the whole operation of the car. Atmega 328 Datasheet/Atmega 8 Datasheet

Section 3: L293D Motor Controller IC. The purpose of using this IC is to control the direction for the motor and also the speed of rotation of the motor. L293D Datasheet

Section 4: LCD Display to display the current state for the car. For example, “Forward” , “Reverse” and any informations that you would like to display.

Section 5: Bluetooth module where this module will receive serial data transmitted from mobile phone and tells what should the microcontroller do in respond.

Now, I would like to further explain a little on the L293D IC and how to use it to control a motor in bi-directional. Please refer to the datasheet of L293D for better understanding on the pin configurations.

L293D pins

High ~+5V, Low ~0V, X = either high or low.

In the above truth table you can observe that if Pin 1 (E1) is low then the motor stops, irrespective of the state of Pin 2 and Pin 7. Hence is essential to hold E1 high for the driver to function, or simply connect enable pins to 5 volts.

With Pin 1 high, if Pin 2 is set high and Pin 7 is pulled low, then the current flow from Pin 2 to Pin 7 driving the motor in an anti-clockwise direction. If the states of Pin 2 and Pin 7 are flipped then current flows from Pin 7 to Pin 2 driving the motor in clockwise direction.

The above concept holds true for other side of the IC too. Connect your motor to Pin 11 and Pin 14; Pin 10 and Pin 15 are input pins, and pin 9 (E2) enables the driver.

Next, below are simple explanation on how you should connect your Bluetooth module to your microcontroller.

bluetooth to arduino

Now I am introducing you a simple yet easy to use platform to develop your first android application – MIT App Inventor.

You can read on how to get started with app inventor by visiting my friend’s post – How To Use App Inventor With Arduino.

This is how the interface of the android applications developed by me using this online software:

interface of the android application

Download the android application:

download Car.apk

If you would like to edit my developed application, just download the zip file below and upload the source at the MIT App Inventor online software. Note that I am using MIT App Inventor V1.0

download source code download Arduino code

This Arduino code basically based on serial communication concept.
When the microcontroller receives a serial data, then it will perform a specific task pre-programmed by the user. For example when serial data ‘1’ is received, then the car will move forward.

Now, you can have your own 2WD Electric Car controlled wirelessly from your Android phone! Any comments and suggestions are welcome. Thank you for reading!