top of page
  • kantakanvay

Introduction to Physical Computing - Week 3


Tone and Servo Motor



Lab 1. A: Tone Output Using An Arduino


In this lab, I (finally) learned how to use a speaker as the output device in a circuit. The circuit is prepared by powering the Arduino with a USB cable, placing it on a breadboard, and connecting the power pin to the positive sides and the ground pin to the negative sides of the breadboard. The 8-ohm speaker is connected as output to pin 8 of the Arduino. Then a Force Sensing Resistor (FSR) is connected as the analog input to impact the sound output. The idea being the more pressure we put on the FSR, the louder the sound will be. Then we use the given code to generate the sound output. Please find my completed circuit below:

Question: What are the parameters of the tone() function?



Lab 1. B: Play it Loud


Using the same circuit as Lab 1. A, we use a TP120 transistor to make the sound output louder. Thus the speaker is connected to the Arduino indirectly (via TP120) and not directly like in 1. A.

Question: The sound did become a little bit louder but it was still quite low. Tips to make the sound really loud?



Lab 1. C: Melody


In the last lab for tone, we created a complex (but still short) melody using the given code. The notes were defined in a separate header file (pitches. h), which we then imported into the file with the execution logic.



Lab 2: Servo Motor


For the second lab of the week, we learned how to use a servo motor as the output device of our circuit. We also learned how we can control its position with the help of Arduino and an FSR. Arduino was connected to the circuit as explained in 1. A. Once again, FSR was connected as the analog input device, and the motor was connected as the output device via three male header connecting wires. Then we coded the FSR input range to be mapped onto 180-degree movement for the servo motor. Please find my completed circuit below:



5 views0 comments

Recent Posts

See All
bottom of page