Wednesday, November 18, 2009

Lab8-Motors

Connect Power from Arduino to Breadboard:
Using the conventional red and black wires, the Arduino power and ground pins were connected to both sides of the breadboard.

Add a Potentiometer:
A potentiometer was hooked up to power and ground, and the middle wire was connected to Arduino analog pin 0.

Add a Motor:
Wires were soldered to the 2 contacts of a small motor. One wire was then connected to power, and the other to the center collector pin of a TIP120 transistor. The output leg of an LED was hooked up to the same TIP120 collector pin to prevent "blowback" current from causing a short circuit.

The base pin of the TIP120 was connected to a 1K ohm resistor, which was then connected to Arduino digital pin 9. The emitter pin of the TIP120 was connected to ground. To reduce circuit noise, a 10µF capacitor was placed between the power and ground rails of the breadboard.


Controlling Speed:
The provided code was uploaded to the Arduino board, and the motor spun according to the potentiometer's input value.

Add a Switch:
All components were removed except the power wiring and the motor. An SPST switch was connected to power and a 10K Ohm resistor going to ground. Arduino digital pin 2 was then wired to the node where the resistor and switch are connected.

Add an H-Bridge:
The H-Bridge was connected as follows:
Pin 16 to power
Pin 8 to power
Pin 1 to power
Pins 4, 5, 12, 13 to ground
Pin 2 to Arduino digital pin 3
Pin 7 to Arduino digital pin 7
Pin 3 to motor pin
Pin 6 to other motor pin
Pin 9 to Arduino digital pin 9


Controlling Direction:
The provided code was uploaded to the Arduino board. The switch toggled the direction the motor spun.

No comments:

Post a Comment