V. Electronics and Software - SK

Electronics

I powered my mechanism using a servo motor. Since my mechanism only had a 120-degree range of motion, I had to assemble a circuit where I could control the motor's motion.

I used my ME 144L lab kit to assemble the circuit. I found that I could use the 10K Ω potentiometer to control the motor's motion. The circuit I used was adapted from this website. Below is a picture of the circuit I used:

Figure 1. Circuit used to control motor. Components include servo motor, breadboard, Arduino Uno 3, and potentiometer.

Figure 2. Circuit diagram borrowed from this website. In my circuit, I did not use the LEDs.


In my circuit, the potentiometer controlled the angular velocity of the servo motor. At rest, the potentiometer is set at 5K Ω, which is the halfway point. When I rotated the potentiometer clockwise, the motor would rotate clockwise. If I rotated the potentiometer farther, the motor would rotate faster. If I rotated the potentiometer in the opposite direction, the motor would rotate in the opposite direction.

This was very useful for my mechanism. Since my mechanism only had a 120-degree range, I was able to easily control how the links moved.

Software

I coded my circuit using the Arduino IDE. I have prior experience with Arduino code, so developing the code was very simple. The code I used is shown below:

Figure 2. Code used to control the motor's angular velocity using a potentiometer.