Knowledge Base‎ > ‎General Gyaan‎ > ‎Tutorials‎ > ‎

Beginning With Robotics

posted Sep 17, 2016, 6:33 AM by Rohit Bhaskar
I wrote this post here when I was in my first year  (last year) and had newly taken up Robotics ::

Well then, here I was : a newbie with no prior knowledge of Electronics ( having studied computers) and not knowing where to start...So I asked around,took a bit of help and chalked out a plan of action ..

Maybe this sounds a lot easier than it actually is..or maybe its even easier...But anyways,here it is :

1. What to make :

I decided to skip the first two levels of robotics (wired remote controlled and wireless remote controlled ) because I thought them to be easy ( arrogant,aren't I ?) . Well, I decided to make a computer controlled wired robot.

2. What I need :

I had to do a lot of asking and reading and deciding, partly because of my inexperience and partly because of the sheer variety of stuff available....But finally, I made it...The list was ready !!

3. Go get 'em :

This part was pretty easy... I asked my seniors and was told there was an entire road (can you believe it !! ) selling electronics stuff...I got recommendations on where to get the best stuff at the best prices and I went and got it....

4. The HOW :

This was slightly tricky...I tried to put it all together in parts,trying to make it work...but again, it wouldn't work...That was probably because, as my friend pointed out, I hadn't read the data sheets well (That actually means I hadn't properly figured out how my stuff works and how to get the best out of it..)..Well, I did that ( only the first page of the entire datasheet made sense, but it was enough..easy peasy) and finally put all of it together AND got it to work...Boy, what an achievement !!

Caution : You should probably read the presentation attached to the bottom of the page before you read my dissection of it 

Here's the scheme of my circuit :

Motor Driver : 

The L293D Motor Driver

(Courtesy :

Pins 8 and 16 get a 12V supply.
Pin 9 gets a 5v Supply.
Pins 4,5,12 and 13 are grounded.
Pins 10 and 15 act according to computer controlled signals,taken from the parallel port.
Pins 11 and 14 go to a DC motor.
All these are essential for running ONE motor.
If you want to use two motors simultaneously, you also need to make sure:
Pin 1 gets 5V Supply.
Pins 2 and 7 get input from the computer.
Pins 3 and 6 go to the motor.

Also, you will need to figure out how the L293D motor driver works...I had problems figuring it out...Click here to download the datasheet of the L293D .. Its also available freely on the Internet...

To take inputs from the computer, you will need to solder wires to a parallel port male connector ( DB-25 Male, its called) and plug the connector to the printer port (LPT1) of your computer.

You are going to use the pins D0 to D7,so you must learn how to program the computer to give proper signals on these pins. You can use any four of these pins for two motors.A powerpoint presentation of this robot can be found here.

Here's how the male connector looks after soldering :

The Computer programming :

I wanted my bot to be user controlled...i.e. the key pressed by the user determines where the bot I again scoured the internet, found a useful C function, and wrote a simple program.
This program will keep on taking user input till you press the q key (make sure CAPS lock is off, dunno if it will work otherwise), after which it will exit. I'm providing a sample program, however, you must change the ouportb commands to give outputs depending on your motor configuration, as the wiring will also play a part here. Fiddle a bit and figure it out. 

Click here to view the code I used for my bot.
Since I used the bioskey function,I needed to find the values of the various keys.
Here they are : (Make sure Num Lock is on)

1 ------------->20273
2 ------------->20530
3 ------------->20787
4 ------------->19252
6 ------------->19766
7 ------------->18231
8 ------------->18488
9 ------------->18745

5. The Niceties :

Well, I have never been good at this part... I am still working on it...But here's a rough look...

I know its not at all neat....Too much of crisscrossing wires and no clarity...But anyways...The fact that it moved exactly as I had intended too was a fact far too joy-giving to overlook ;)

Its fun to play with this bot for a few days...then you get tired and feel like doing something more fun...more interesting..more challenging...

Happy Roboting !!

Contributed by :
Ankit Daftery
ankitdaf [at] gmail [dot] com
Rohit Bhaskar,
Sep 17, 2016, 6:33 AM
Rohit Bhaskar,
Sep 17, 2016, 6:33 AM