Tuesday, October 2, 2012

Analog Output

     Analog output is a very useful tool when it comes to building things. Analog output is used when we need to change the range of the output value. For instance, if the brightness of a lamp needs to be changed, if the correct components were wired up to it, we could make this happen.
     In the first section of this lab, Cal and I wired up our breadboard and Arduino to begin working on the pulse-width modulation. This portion was used to control the speed of a motor, as well as the duty-cycle of the motor. The image below shows our final wiring of this motor. The potentiometer was used to determine the speed of the motor. Our motor would run for 50 msec and then stop for the same amount of time.
Final assembly of the PWM motor.
     After the PWM portion of the lab was completed, we moved on and began working with servos. Servos are motors, but servos make use of gears which gives them much more torque. A standard servo has a range of movement from 0 to 180 degrees. However, there are continuous servos which can rotate 360 degrees. The position of the servo is based on a timed interval. This means that some servos must be programmed differently than others. Below is a video of our servo in action!


    The final section of this lab dealt with a piezo element. In this part of the lab, Cal and I learned how the Arduino could control the notes of sound. A piezo elemnt makes a clicking sound each time it has current running through it. If the pulse is at a certain frequency, a note is played. In essence, different frequencies mean different notes. Cal and I wired up our piezo element and copied the sample code from the lab. Upon running this code, our piezo element played "Twinkle, Twinkle Little Star" as shown in the video below.



No comments:

Post a Comment