Assignment 5: Treat for a Trick (Currently Fixing)

As shown through the prototype, this project is designed to simulate a common horror movie scene, where the background music plays faster with higher pitch as a character approaches closer to a subject.

Likewise, in this project, the user will be hearing a shrill sound that plays faster as he/she reaches his/her hand closer to a candy (I changed my  initial music choice from harmonic minor scale to a violin screech sound effect).

(picture of the final product)

(picture of the final product close-up)

(picture of interaction)

For the final product, I decided to use an ultrasonic distance sensor instead of an IR distance sensor, since the sensing range was broader, which thus, allows a smoother interaction. For the speaker, I decided to use a larger, 8 ohm 2 watt, audio speakers through an addition of audio amplifiers.

In order to enhance the spook-factor, I decided to add an output vibrator attached to the target treat, where it would start vibrating when the distance sensor reads the user’s location to be close enough to the treat.

Documentation in Google Drive (Video X /Fritz X /Photos X /Code X): https://drive.google.com/drive/folders/0B70fyRiHk85qSW9vcDNuV0I2Y3c?usp=sharing

Spooky Skull

For this project, I was inspired by the nearness of Halloween. I wanted to incorporate the festive feel. My original idea involved a hand that would recoil as you got close to it. My plan was to tie one end of a string to the individual fingers and the other end to a servo that would coil the string when activated, and consequently pull in the fingers. Unfortunately, the library required to play the converted audio file interfered with the servo library so the two could not work in tandem. My solution was to use a solenoid instead. With the solenoid incorporated, it made more sense to directly relate the audio aspect to the visual component, resulting in an evil laughing skull. If had the opportunity to recreate the project I would like to retry the recoiling hand idea.

 

 

Link to Code:https://drive.google.com/open?id=0B62ArY8nFitqRmo2Wnd5UU9PRFE

Assigment 5: Bolaji Bankole

For this assignment, I set out to create a two-voice synth/sequencer. A major goal of mine was to be able to create each of the basic waveforms (I ended up with sine, square, triangle, and noise), so I made two R2R ladder DACs, each with a controlling arduino pro mini. The two pro minis were then controlled by an uno that told them what waveform to use, and what note to play. The uno had arrays of notes that it would tell each pro mini to play, and I threw together an interface for inputting them.

I’ve essentially learned that analog circuitry is really hard, especially on breadboards. I tried to do more thorough unit testing as I went on, trying different values for filters and making sure that I was getting the correct waveforms at the correct frequencies, but when all put together, it just kinda shat the bed. There were likely issues in the final signal combining and amplification, but then again, there were likely issues in every step. I think that in the future I’ll try and step away from using as much electronics and do something more material. I think this kind of project could have turned out well if I was able to put more time into it, but sadly I need to graduate.

At the very least, the sounds it makes are kinda spooky so it’s fitting for Halloween.

code

video

Assignment 5 Final: Scott

For this assignment I aimed to make a music pattern generator. I wanted to have an interface for the user to make a custom pattern and then the ability to play that pattern back and hear it as they see time moving across the pattern. I had a few iterations of ideas with sound that all focused on the user having the ability to customize what they were hearing. I was fortunate that Aditi let me use the 8×8 LED matrix with the backpack she attached, and this was perfect for showing a pattern of notes in time.

zip: assignment5

Assignment 5: Musical Objects

For this project, I integrated different musical melodies with objects around us. I wanted to use a set of objects with different weights, categorize them, and then produce separate musical identities of each object. While there is a range of objects available, only 3 sensors are available. So, different combinations using the objects produce slightly different experiences.

For the practice assignment, I used the playMelody Arduino tutorial  to be the tune set off by the ball and original backbone for the program (the weight is captured by an FSR). However I needed to change the program heavily to adapt for three sensors. The biggest challenge I faced was wiring the FSRs appropriately to the get solid and consistent readings.

Overall, I’m very happy with how the project turned out and learned a lot about sensors as well as programming this time around. If I were to improve, I would like to fine-tune the thresholds of the sensors and weights and also develop the program to play melodies in parallel with one another.

video

documentation, fritz, and code

Scooby Doo Project – Sarika Bajaj

For my Halloween project, I wanted to do something that involved playing the Scooby Doo theme song (as illustrated in my prototype) and some type of motor/sensor action that involved the gang and maybe some monsters. I was not really pleased with the quality or length of the sound that I achieved in my prototype, so I decided to pursue using the Music Maker Adafruit shield which uses an SD card to play songs (which would give me longer music length and better quality as I would no longer be using the Arduino as my storage device). After a lot of struggling, I got the full theme song playing such that when it got to be “nighttime” (based off my photoresistor) the song would play in its entirety. However, I think this Music Maker shield + the photoresistor got to be too much for my Arduino (and I think some pins might have been fried in the process), so I had originally connected the wheels of the Mystery Machine straight to power and ground so I could get some motor action.

I then spent a decent amount of time trying to make some workaround to get some motor and LED interaction from the light sensor. I realized that an easy solution without messing too much with the Music Maker set up would just to use a second Arduino that gets the same input from the photoresistor that connects to the Music Maker and instead just runs the data to an h-bridge and an LED. After some simple issues of downloading code to the wrong board, I was able to get this system up and working.

My final project now works such that when it gets to be “nighttime,” the wheels of the Mystery Machine start spinning, its headlights turn on, and the Scooby Doo theme song plays. The whole system is completely functional!

Final Video:

Arduino Code for the Music Shield:  HalloweenProject
Arduino Code for the H-Bridge and LED: Halloweenpt2

Reference Material Used: http://digitalmedia.risd.edu/pbadger/physcomp/index.php?n=Devices.ArrayOfMP3sOnAdafruitVS1053

Assignment 5: DJ Turntable

For this assignment, I made a mini DJ turntable using a soft circular potentiometer, speaker, and some buttons/switches. The buttons and switches are only for aesthetic purposes, however, since I didn’t have time to figure out how to incorporate volume and play/pause into my code.

As you press the needle in different places around the record (the circular potentiometer), the speed of the song (Super Mario theme song) either increases or decreases.

Link to demo video, code, etc:

https://drive.google.com/drive/folders/0B0yMpI_ZOcoYU2pTOVd2M2hWVDg?usp=sharing

Evil Lord Kakoon – Akshat Prakash

I created a “trick or treat” project where people can come to get candy to and be “treated” by the evil halloween lord “Kakoon.” As a person reaches out for candy, “Kakoon” senses his/her presence and erupts in a melancholic tone and lights up his fiery eyes to drive away intruders.

I used a ping sensor, neopixel and speaker to achieve this effect. I had no trouble this time around with code or circuit and everything seemed to work in the first go. I also feel with more and more projects, I feel more comfortable with the creativity and art side of physical computing. A lot of the makeup for Kakoon was pretty spontaneous.

Link to project video:

https://drive.google.com/file/d/0B-XYwe_ldmF9bjNta2lWNzZnYUU/view?usp=sharing

Spooky Scary Mask – Part 1

This is the first part of the Holloween project – the Spooky Scary Mask. There is a sonic detector to monitor how close people are, when people are close enough (about 20cm), the sound effect will go off and the “blood ball” will be squeeze , and the mask will spin randomly as if the ghost is giggling and laughing at the spooked person.

 

How the project would work is that there will be a motor connected to the blood splashing mask that makes it turn and spin. The solinoids will be actuated and squeeze the ball. There is also a sonic detector to detect how close people are from the setup.

Here is what I have for the first part of the project. Since I already familierized myself with motor and solinoids in the previous projects, the main focus on this part is about the soinc sensor and the sound.

 

Here is the sketch and the code for the setup:

Code:

//JeanZhang_yihanz
//The Bloody Scary Mask - Part 1
//This code contains code and resources from this webpage:
//http://randomnerdtutorials.com/complete-guide-for-ultrasonic-sensor-hc-sr04/



//Set up the pins
const int trigPin = 11; //Trig - green Jumper - digital 
const int echoPin = 12; //Echo - yellow Jumper - pwm
const int soundPin = 5;

long duration, cm, inches;



//This is the function for a spooky sound (doesn't have to be exactly like this)
void scarySound() {
 for (int i = 100; i < 1000 ; i+= 20) {
 Serial.println(i);
 tone(soundPin, i);
 delay(50);
 }
 for (int i = 1000; i > 100; i-=20) {
 Serial.println(i);
 tone(soundPin, i);
 delay(50);
 }
 noTone(soundPin); // stop the sound after the trigger
}


void setup() {
 //Serial Port begin
 Serial.begin (9600);
 
 //Define inputs and outputs
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);
 pinMode(soundPin, OUTPUT);
}
 
void loop()
{
 
 
 // The sensor is triggered by a HIGH pulse of 10 or more microseconds.
 // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
 digitalWrite(trigPin, LOW);
 delayMicroseconds(5);
 digitalWrite(trigPin, HIGH);
 delayMicroseconds(10);
 digitalWrite(trigPin, LOW);
 
 // Read the signal from the sensor: a HIGH pulse whose
 // duration is the time (in microseconds) from the sending
 // of the ping to the reception of its echo off of an object.
 pinMode(echoPin, INPUT);
 duration = pulseIn(echoPin, HIGH);
 
 // convert the time into a distance
 cm = (duration/2) / 29.1;
 inches = (duration/2) / 74; 
 
 Serial.print(inches);
 Serial.print("in, ");
 Serial.print(cm);
 Serial.print("cm");
 Serial.println();

//if the person is close enough, things will be triggered
 if (cm < 20){
 scarySound();
 }
 
 delay(250);
}

 

 

Reflection:

Even though this seems really easy, it took me quite a long time to figure out that several libraries for the sonic detector is not compatible with the tone() function for arduino. For this paticular problem, even though there is not really any problem with the code, the IDE would not complie. And shows error is like this:

Tone.cpp.o (symbol from plugin): In function `timer0_pin_port':

(.text+0x0): multiple definition of `__vector_7'

libraries\NewPing\NewPing.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

I spent quite sometime online to see if there is anything to do to fix this problem, which I failed to do. At the end, I have to switch to another way to make the sensor work (without using any library).