Controlling the Motors with a Microprocessor: Arduino

PART I

You have a mechanical system with push buttons that moves a pen in two dimensions. The next step is to have the controller operated by a microprocessor so that it can draw by itself. In this step you will connect the H bridge to an Arduino (a microprocessor).  

Here are some basics to know before your start working with the Arduino:

When you have time or interest, you can learn more about Arduino here: http://forefront.io/a/beginners-guide-to-arduino/ 

For now, you just need to know that the Arduino will have the instructions for controlling the motor.  For our purposes, locate 5 pins on the board: GND, 13, 12, 11, 10.  (In the picture below these are along the top edge.) These will be the pins you want to use as outputs of the Arduino.

Your board will look similar to this one.

Examine the diagram below to set up a test of your Arduino. Use the directions below to check your wiring. (Just remember, the LED has a short leg and that is always connected toward the negative side or blue!)

1) On a breadboard, install 4 LEDs (red or orange, yellow, green and white) so that the short lead on the LED is attached to the blue power rail or ground. This blue ground line should be connected to the Arduino board labeled GND.

2) On pin 13 of the Arduino, connect a red/orange wire to resistor (220 ohms red-red-brown) leading to the red LED.

3) On pin 12 of the Arduino, connect a yellow wire to resistor leading to the yellow LED.

4) On pin 11 of the Arduino, connect a green wire to the resistor leading to the green LED.

5) On pin 10 of the Arduino, connect a white wire to the resistor leading to the clear LED.

Testing

Double check your wiring. If you are not sure, ask for assistance. Once your wiring is double-checked, you can attach the 9 volt power supply to the Arduino board. The Arduino you have should have been pre-programmed with a simple output program. Pins 13 through 10 should become positive 5 volts in sequence once the Arduino is powered. Turn on the slide switch on the power supply and check the LEDs.  They should light sequentially 10 times and then end.  If you are not getting this output, get some help to troubleshoot. It might be:

• Your wiring is incorrect

• The Arduino battery is dead or not connected

• LEDs are backwards

• The Arduino was not programmed correctly

PART II

When the Arduino tests correctly with your LEDs, it is time to connect the Arduino to your motor controller.  This next step is a little more complicated, so follow the directions carefully.

Diodes

In your kit find 4 diodes.  These are small glass devices with two leads.  Note one end has a black band:

These will be installed on the motor control board as shown:

1) The black band end of the diode will connect to the following pins on the chip. 

Pin 15

Pin 10

Pin 7

Pin 2

Notice that the un-banded end of the diode is connected to a different pin row.  Pin 15 to row 1, Pin 10 to row 2.  On the other side of the board, pin 2 to row 1 and pin 7 to row 2. This will allow you to connect an Arduino wire to these ends of the diodes.

Have your instructor check your work at this point so you have the diodes placed correctly.

When ready, you can make the final connections. Here is where you have to pay close attention!

1) The GND of the Arduino is connected with a blue wire to the blue power rail on the motor controller breadboard.

2) Connect pin 13 of the Arduino board with a red wire to the diode connected to pin 15 of the motor controller chip

3) Connect  pin 12 of the Arduino board with a yellow wire to the diode connected to pin 7 of the motor controller chip

4) Connect  pin 11 of the Arduino board with a green wire to the diode connected to pin 10 of the motor controller chip

5) Connect  pin 10 of the Arduino board with a white wire to the diode connected to pin 2 of the motor controller chip

Have your instructor check your work.  When ready, turn on your power supply and turn on the 9 volt Arduino supply.  If everything is working correctly, you should experience a 2 D plotter making a box:

Once you have your model working, you can now control the microprocessor by adjusting the software commands.  Next Step.

RETURN TO LIFE in 3D