Documentation 03

//Labs Tone Output Using an Arduino

I started with soldering the speaker and the wire. The first soldering I’ve done at ITP yet I noticed that I forgot to take a video to record it...It was way easier than I thought though.

Check the Sensor Range
I started with checking the sensor range, and found it is between 5-990.


fig 3.1 check the sensor range
Play tones
When actually doing the set up, I replaced the force sensing resistor with a photoresistor because it is more stable. Yet, the sound played from the speaker is really low. Maybe it is because of the resistance is too high?


video 3.1 play tones

Play it Loud
The first time I connected the transistor to the breadboard, it did not work. I checked all connections and they all looked fine. After revisiting the introduction of transistor, I recalled that its base, collector and emitter has specific locations. I connected it reversedly. I flipped the transistor to the other way, used the multimeter to test the continuity between its collector and emitter, and it finally worked.
//[some notes on reviewing the transistor’s functionality]
Transistors
-bipolar transistors
-field-effect transistors
three connectors: base, collector and emmitter
small voltage and current between the base of a transistor and the emitter,
-large current flow from the collector to the emitterNP

NPN transistor: apply positive voltage to the base, turns on the collector-emitter connection
PNP transistor: by contrast, turns of the collector-emitter connection

Darlington transistor (the one we’re using here)”
-2 transistors in one, combined with a diode protects the transistors from damage in case the load’s current runs reversely

Current can only flow through one direction


video 3.2 Play It Loud

Playing the melody
The first time when I tried, the volume was pretty low so I replaced the resistor to a 10-ohm one.

video 3.3 playing the melody
A Musical instrument
The first time I played it none of them worked and I noticed that I have connected all of the force sensing resistor to the wrong analog pin so I rewired it. After doing so, it did played, but it is very fluctuated in the second and third one. I used serial monitor to print their status and it showed that it was really fluctuating between the second and third analog input. This is how it worked initially. I noticed that the fluctuating may because the threshold is too low so the sensor is constantly reacting. I edit the threshold to 200 and add some delay to the note and it finally worked!


(left) video 3.4 a musical instrument that didn’t work
(right) fig 3.2 changed the threshold from 10 to 200 and added some delay


video 3.5 A musical instrument that finally worked


//Labs Servo Motor Control with An Arduino

Initially the servo turned really weirdly. It constantly turned back so I assume it was the range I put in the map is not that correct for this force sensing resistor. I retested the force sensing resistor’s range and remapped it to 200-990 and it turned more fluently.

video 3.5 servo motor control with an arduino


//Get Creative: a light sensing “telephone” instrument

For the part of building something creative, I did a simple telephone-like tone control using 2 photoresistors. The thing I want to achieve here is using the range of the each photoresistor to control the different pitches the speaker would play. Here is the overview of the final code:
fig 3.3 final code for the light sensing telephone instrument
Final outcome:

video 3.6 a light sensing “telephone” instrument

Process: 
I started with connecting only one photoresistor to the circuit and use mapping to map its range to the tone the speaker would play. Here is the initial idea:

video 3.7 initial idea
But I felt this may be too simple, so I progressed by adding a LED to the circuit and use the conditional statement to control the LED. My idea was that when the photoresistor is covered by hand, the LED would light up while the tone pitch is also changing by the sensor reading of the photoresistor. Here is what it looks like:

video 3.8 progress: adding a LED
fig 3.4 the code for the LED(s) and the speaker
I then added another LED to the circuit, but somewhat it did not work that successful, ideally one LED would go off while the other go up, but only one worked.

video 3.9 2LEDs and a speaker

Finally when I tried connecting 2 photoresistors to the circuit, controlling two different range of notes the speaker would play. I first tried connecting 2 digital output pins to the speaker, imagining the two notes can be played at the same time controlled by the two phototransistors, but it seams like the speaker can only be connected to one digital pin...If I want to do that, I will need 2 speakers. So I made them play through one speaker subsequently. Initially it did not work, because the mapping range is too low. I adjusted the mapping range, and added a constrain to it. This is because the serial monitor stopped once and I guess it was because the frequency range is too high and it kind of created a short circuit? Anyway I added constrain, and added a delay between the two tones playing so the second one would not overwrite the previous one. It finally worked as show above at the very top.

Questions:
1. This time because I did not have a header pin so I connected the wires directly to the servo motor. Is it ok to do so?
2. When should we use a servo motor and when a DC motor?
3. Tried with playing two notes at the same time in the same speaker by connecting the speaker with two digital pins and it seems like it didn’t work. Are there any possible ways to make it work except for using 2 speakers?
4. Is pitches.h that we created and saved a library?
5. I am still a little confused about the differences between frequency, note and pitches.

Questions regarding the readings:
6. How can designer evaluate and incorporate humans’/users’ agency when doing the implicitly interactive designs? When doing implicitly interactive designs, does it further fortify the permeability of technology to our daily life, only in a seemingly harmless disguise?


//Some notes when reading this week’s introductions on Analog Output

Electrical devices controlled by a changing voltage
arduilno and other digital micro controllers cannot produce a varying voltage
-only high or low
-fake an analog voltage through PWM
(pseudo-analog voltage)

turn the pin on and off really fast
-ration of the on and off time creates an average voltage


Duty: 0-255
0- 0 volts
255- 5 volts

the motor does not work very well when change the voltage directly
PWM


Filter circuits

Servomotors
-combination of gears and an embedded potentiometer
-set their position fairly precisely within a 180-degree range
three wires:

-power >> 5V power source
-ground >> same ground as the micro controller
-control >> output pin on the micro controller


Changing the frequency

-changing the duty cycle, not the period of the signal
-frequency won’t change

*So if use the PWM to change the frequency, only one steady pitch?
the tone command
-turns the selected pin on and off at a frequency set

DC motor speed control
the transistor turns on and off at a rate faster than the motor can stop and start
-so the motor appears to smoothly speed up and slow down
(does it mean that the DC motor’s high speed enables an ease effect for the motor’s speeding up?)


When spinning a wire in an existing magnetic field
-induces a current in the wire
-the coil generate a current in the wire when spinning
-the current comes back in the reverse direction of the flow
-when connected to another power source, back voltage, cause damage to electronics
solutions: put a diode in parallel to route the back voltage through the diode

Current
-stall current: current it draws when stopped by an opposing force
-stall current is greater than running current

Speed
-revolutions per minute

Torque
-the force a motor can pull when the opposing force attached to a shaft attached to its center rod
(motor)
-on their own, DC motors are high speed, low torque
reverse direction: reverse applied voltage


Also the notes for the 3 readings for this week is here {google doc}
notes taken at class {google doc}