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:
The Schematic for hardware
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 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.
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.
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:
Download the android application:
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 http://beta.appinventor.mit.edu
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!