Design a site like this with
Get started

Physical Computing · Week 3

Lab: Tone Output

Preparing my breadboard and speaker: Connected Arduino’s power and ground, and connected my speaker to alligator clips

Adding analog input and output: Added two force sensing resistor as analog inputs, and a 8ohm speaker as the output.

Arduino code + video of analog input and output playing tones:

Arduino Code
Play Video with Sound On | Analog Input (Force sensors) and Output (Speaker) Working

Arduino code + video of speaker playing specific pitches and notes:

Arduino Code
Play Video with Sound On | Playing Specific Pitches and Notes

Musical instrument: Setting note constants to make a simple keyboard (I only have two force sensing resistors and thus only included 2 instead of 3)

Arduino code + video of simple musical instrument / keyboard:

Arduino Code
Play Video with Sound On | Musical Instrument Controlled by Force Sensing Resistors

Reflection: I used LEDs as my output in my previous labs and thus enjoyed switching to a speaker with audio output this week. I was able to get all three parts of this lab to work, but I sometimes hear a humming/buzzing sound coming out of my speaker despite not pressing onto any of the force sensing resistors. However, pressing onto the force sensing resistors does successfully control the various tone outputs that my speaker produces. In addition, I also find it interesting to be able to define specific pitches and notes for the speaker to produce a specific melody or serve a a keyboard like musical instrument, and think it would be fun to experiment with more resistors controlling more pitches/notes at the same time with the musical instrument in the future.

Lab: Servo Motor Control

Connecting analog input and a servo motor: Added a force sensing resistor as the analog input, and a servo motor as the output.

Arduino code + video of force sensing resistor controlling servo:

Arduino Code
Play Video with Sound On | Servo Motor Controlled by Force Sensing Resistor

Reflection: I was able to get my force sensing resistor to control my servo motor, but I feel like the speed of my motor turning only changes slightly depending on how hard I press onto my resistor. However, I do hear the soft buzzing sound of the motor increasing and decreasing based on how much force I apply, so I wasn’t really sure if its due to the sensor range value or its simply how my servo motor works. I’ve also tried decreasing my sensor range value even more in the code, but I don’t think this was the right thing to do as my servo doesn’t turn after lowering the value.

Project 1 Idea

For project 1, I am working with Alan, and we’ve decided on creating a combination lock that lights up a green LED if the user pressed a series of buttons in the correct order, and a red LED if the user makes a mistake. We’ve started out by planning out our idea through visualizing the circuit and also searched up some references to guide our code.

Visualizing our Circuit with Fritzing

We have planned out our idea in Fritzing, and also started working on the programing. We plan to finish our code, test it out to make sure its working, and then create a holder for our combination lock in the next week.

Note: I have also updated my week 1 blog post after figuring out the issue I had and re-worked on the labs to get LEDs and switches in both series and parallel circuits to work.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s