Motors, or “Why does it sound like a dog barking?”

The motor lab introduced us to working with a simple, low-powered motor that spins in circles (instead of just moving back and forth between given position, as the servo motor did).

First, gathering all the materials:

Next, I wired the Arduino to the breadboard, connecting power and ground. I added a potentiometer, connecting its power and ground wires to the red/blue rails respectively and connecting the output wire to pin A0 on the Arduino.

Finally, I added the motor following the instructions in the lab. This required a transistor (TIP120 transistor) and and a diode (LED in this case). The diode, which only allows current to flow in one direction, was there in order to prevent the spinning motor’s blowback current from shorting out the circuit. To date I’m still not sure what a transistor does. The motor was connected to the Arduino’s pin 9 via a 1k Ohm resistor. Also, I used a 10µF capacitor plugged near the motor’s wires (to reduce the noise in the circuit, called “decoupling.”)

I attached a popsicle stick to the motor so that we could see it spinning. (We hammered a nail through the middle of the popsicle stick to make the hole.) I marked some stripes on mine so we could see it spinning more clearly.

Watch out! Once you complete the circuit it will start to spin VERY FAST without warning and thwack any appendages in its way. Ow ow ow ow ow ow ow ow

Below is the whole assembly in action:

For the next portion, you can load a bit of code into Arduino and then you’ll be able to control the speed of the whirring blades of doom:

For the next portion, I added a switch and an H-bridge to control the direction of spinning. (Unlike the instructions implied, I did have to remove the motor from the board because its wires get have to get moved in order to connect to the H-bridge.) Other than this, things went along smoothly by following the steps in the lab. Here is a still photo of the finished thing:

And here is a video:

This was one of those labs that actually went according to plan. I did not shock, burn or otherwise hurt myself or anyone around me. I did not melt any components. I did not lose a chunk of finger. Am I actually getting better at this stuff? Only time will tell.