Monday, October 1, 2012

Oct 2-Analog Output

Introduction:
This week lab, we were dealing with Analog Output. First we used a basic motor, then we used a servo motor, and lastly we used a piezo buzzer.

Procedure:
With the basic motor, we hooked up a basic circuit with the motor plugged into analog pin 0 on our Arduino. We also incorporated a potentiometer. Since our Arduino does not have true analog output, only pulse-width modulation (also called PWM), rather than having a way to only power the motor at half speed, we had to use periods. Our periods were designed to turn the motor off and on so quickly that it seemed like the motor was running at half speed. Next we implemented the potentiometer. By allowing the potentiometer to control the duty cycles, the turn of the knob makes the motor seem like its running faster or slower by decreasing or increasing the amount of time that it is turned off. Here's a video of our results:

Next we were supposed to experiment using a servo motor. Servo motors are motors with gears and consequently are often much stronger than a basic motor like we used for the last exercise. Their arm can rotate up to 180 degrees. The first use of the servo motor was to get it to rotate using pulses that are sent through the analog pin. Here's a video of our servo motor rotating to the full 180 degrees and then back to 0.

The next element to incorporate was a potentiometer. The code for this set up was designed to allow the potentiometer to change the direction of the motor based on the resistance from the potentiometer. Here are our results from that portion:

Lastly was implementation of the piezo buzzer. Piezo buzzers work through playing quick pulses of sound at different frequencies to create a melody. Our video didn't turn out very well since my partner was playing dj, but here is a brief sample of what it sounds like:






Conclusion:
I was once again pleasantly surprised by how well our lab went. We really didn't encounter any errors with our circuits or with our codes. I'm looking forward to finishing up our analog kitchen project and working more with analog output in the future.


No comments:

Post a Comment