Now that we understood how to use the USB-1208LS interface, it’s time to start actually building up our wiring and  schematics based on that knowledge.

First, lest find out what is going to be needed for building this project:

  •  dc motors: you could use two motors on each side, so you will need 4 in total BUT you also could use 2 motors – one in each side.                                  In this project i used gear motors, they are really strong because of the gears that increase the torque. they operate on 9 to 12 volts, but different brands differ in the current required.
  • breadboard and hook up wires.
  • toggle switch(optional): connected to the battery to turn the robot NO and OFF
  • H-bridge integrated circuit: here I used the L293d.
  • chassis: it’s pretty straight forward, get a wooden board and mount everything on it!
  • LEDs(optional):  for indication purposes.

for controlling a DC motor direction, you must flip the flow of the current. This task is handled by a circuit called: “H-bridge”. This site explain it well.
However, instead of building a circuit like this, you could easily buy an already made  integrated circuit(IC) that could controls 2 motors separately.
this IC is called L293d, there are different kinds, but they all work the same.

Now, let’s learn about the pin configuration for this chip:

  • Pin 1 and 9: those are the ‘Enable’ pins, which mean, if we  set them to 0 volts – Low, the motors will not operate, even if they were connected to the power source.
    Also, each one of those pins responsible for one motor (Remember, this IC can control 2 motors.).
  • pins 2,7 and 15,10: those are the inputs for the motors, pins 2,7 belong to one motor and 15,10 for the second motor. One pin of each pair connects to the negative pole of the motor and the other to the positive:
    if pin 2 was connected to the negative pole for one motor, then pin 7 must be connected to the positive pole of the same motor and vice verse. Also, same with pins 15,10. Pay attention that this IC supports input voltage for the motors between 6-30 volts, again, read the data sheet for different brands.
  • pins 3,6 and 14,11: those pins which control the motor rotation direction. Same as with the input pins; each pair(3,6 and 14,11) controls a different motor. In order for those pins to function, they must be connected to 5 volts.
    For each pair of those pins(3,6 and 14,11)connecting one pin to 5 volts and the other to ground, makes the motor rotate to a specific direction, but connecting both of them to ground or to 5 volts will not make the motor move!
  • Pin 8: this is the motor voltage supplier.
  • Pin 16: this pin should be connected to 5 volts, this pin is essential for the IC to operate.

Robt schematics and wiring:
With the knowledge we already have regarding connecting and using each part(the interface and the H-bridge circuit) let’s put them together:

Port A0 to A7, are the Digital output.
1 Logic = 5 volts

The next post should present the final product and a demo for the software and hardware!