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).

Assignment 5: sound formation

I want to remodel the way sound is formed by emphasizing on its the sound waves. The amount of nodes in one period of a sound wave determines the pitch of the sound. Below is a diagram that explains this concept visually:

 

Inspired by the Spiral Wall, developed by the P&A LAB (Programming and Architecture LAB)
[link: http://pandalabccc.blogspot.com/2010/07/spiralwall-final-arduino-processing.html]
I want to make simulation of playing a violin by having infrared sensors detect the users’ finger position and then translate that data into the amount of twists in servos and the pitch of the speaker.

Sketch:

Working with one “string”:

Video: https://drive.google.com/file/d/0B0lS0mmjvCWPckJHZDg0OTFTZGc/view?usp=sharing

The next step would be to make the infrared sensors detect finger positions and map the data to controlling the speaker and servos.

Assignment 5 Final: Spoopy Buzzer

For this assignment, I wanted to explore how speed relates to pitch. I decided to try and create a rolling cylinder that produces a sound. To achieve this I attached my arduino to a shaft and weighted it down. I wanted to use a motor encoder to measure how quickly the cylinder was rolling and then send measurements to the buzzer to adjust the frequency it produces.

FINAL:

After realizing I couldn’t do the above idea, I reassessed how I was going to approach the project. I am now programming my buzzer to play a melody that will speed up depending on how close the user is to the proximity sensor.

Read about it here:

https://samanthaho.myportfolio.com/spoopy-feelings

Happy Halloween 🙂

CODE:

Assignment 5: Prototype for ”Treat for a Trick” (Title likely to change)

For this assignment, I am planning to play a creepy melody of a harmonic minor scale, and modify either of its speed or pitches depending on how close the user gets to an object through the sensing of a distance sensor.

This was inspired by the typical horror movie scenes, where a scene’s atmosphere intensifies as the creepy background music plays either faster or higher in pitch, while the camera gives a fast-paced, zooming-in shot of either a mysterious object or a character

To make it more Halloween-specific, I am trying to place a candy as the object that the user would be interacting with. As the user approaches closer and reaches out for the candy, the creepy melody will be playing more intensively.

As for the prototype, I’m changing the speed of the playing speed of a melody, as the distance read from the distance sensor becomes shorter (the user gets closer to the object).

Documentation in Google Drive (Fritz/Video/Code): https://drive.google.com/open?id=0B70fyRiHk85qWWowSGwtYnZlMk0

Assignment 5: Bryt: A music (albeit crude) music visualizer prototype

For this assignment, I really wanted to explore the realm of music visualization. So I built a very simple prototype of a music visualizer that flashes an LED every time a new note occurs in a given piece of music. The music in the example is J.S. Bach’s Toccata and Fugue in D Minor, aka the classic Dracula song for a little Halloween flavor.

https://drive.google.com/open?id=0BxAGrufmmWthV2MwZGlMTmtCVEk

project 5 preliminary submission

my project is going to be a baby doll with a switch imbedded into its belly. When you push on its belly it starts screaming and its head turn around 180 degrees. This video shows the switch triggering the screaming sound sans baby.

 

video- https://www.youtube.com/watch?v=eeGeBYht-Y4

code- https://drive.google.com/drive/folders/0B_JEXda9ZXwvcENWTDFGU1pBd3c?usp=sharing

Assignment 5 Prototype: Emma Brennan

My idea for the final project is to create some kind of scared creature that responds to your movement. I wanted there to be a relationship between movement, direction and sound. The closer the person gets to the creature, the further away it retreats and makes sporadic noises. If the person is far enough away, the creature will want to move closer.

I prototyped this interaction using a speaker and leds to resemble motors. The on or off state of the led indicates what direction the motor will travel in. One thing I want to improve is the speed of the motor I will eventually use, and to try and incorporate that into the emotion of the creature.

I am currently having difficulty with getting the response to be understandable and noticeable.

Arduino Sketch

Assignment 5 : Gaurav Balakrishnan

For this assignment I decided to use capacitive touch sensors to respond to different kinds of physical interactions. I envision the project to allow the user experience physical interactions like a game with different kinds of physical interactions getting different levels of responses. The response will be in the form of a sound or specific tune. For instance, the sound played when the user hugs someone compared to the one after a handshake contains more excitement. I think this project would be a small easy way to spread happiness.

To prototype this project, I created a capacitive touch sensor using aluminum foil. I also use the CapacitiveSensor library available on the Arduino website to make this sensor. I play a certain frequency when the sensor is not engaged and a different one when it is. This proof of concept can be extended to have more number of sensors and different tunes to create the project imagined.

It will be interesting to find ways to incorporate this into the clothing of the user. I also think I will enjoy coming up with the different tunes that play in response to different stimuli.

 

Wearable Synth Prototype

My final goal for this project is to create a 5 tone sythesizer which can be held in one hand, while the other holds a 3 axis accelerometer to control pitch bend and modulation. We’ll see if I actually get there…

In it’s current state I’ve gotten the sythesizer portion working fairly well. I’ve taken some code from a source I found online for a polyphonic synth, that to be honest was far too complicated for me to really understand, however I was able to parse it down and edit it to suit my needs. There are some issues with volume that I need to address, perhaps just try a larger speaker, as well as some issues with unintentional pitch modulation that I think is due to wires not being quite insulated and touching since it goes away everytime I jiggle the breadboard.

I’m pleased with how the capacitive touch works, and how responsive it is in general.

assignment_5_proto

“Tickle Me” Bat

The idea is a bat that “screeches” at two different frequencies depending on how you pet him (yes, him.). The circular softpot is a good tool to use to change resistance depending on the location of your finger/interaction. The resistance changes from 0 to 10k as you go around the wheel.

There is little documentation on how this specific form of softpot functions (like what to use in the map function when assigning values of potentiometer readings to positions on the pot), but there’s more stuff on linear flex sensor monitors (FSMs) and softpots. Some of the documentation is translatable. The next steps will be defining what cases I want:

1.) Bat (we should name him) will screech in more pleasant frequency when user pets him under his chin.

2.) When not petting in the “sweet spot” (much like that of a cat), will the bat screech at all? Will it screech at a lower frequency everywhere else? Should it be silent when there is not interaction?

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