You are on page 1of 5

Sound of Speed

How can we identify the state of mind of a person as they approach a doorway, a
transition, or move through a pathway?

Thinking ahead to the site for project 2, the PATH is, by program, always a passage
and never a destination.

People walk at speeds according to their moods. Are they rushed or leisurely? Are
they excited or exhausted? This project seeks to articulate the speed of people
passing by, in the form of sound.
Infrared Distance Sensor

infrared sensor read 2 read 1

This scenario uses an Infrared Distance Sensor and a Piezo Actuator. The Distance
Sensor takes two reads of the passerby.
Speed Calculations
and Piezo Actuation

d2-d1 = speed
t2-t1

Each read from the sensor records the distance of the passerby and the millis
code is used to record the time that each distance is taken. This input is used to
calculate speed.

The speed of the object is used to actuate the piezo. The duration of the note
sounded by the piezo is directly proportional to the speed of the passing object.
CODING BREAKDOWN

1. IDENTIFY THE INTEGERS TO BE USED IN THE CODE read1=in;


AND ASSIGN THEM PINS delay(100);
timeRead2=millis();
int read1=0; in = analogRead(0); // Reading Sensed data from Arduino
int read2=0; in=map(in,650,100,10,80);
int timeRead1=0; read2=in;
int timeRead2=0; }
int in=0;
int piezoPin = 13; // Piezo connected to digital pin 13 4. CALCULATE FOR SPEED
int freq = 956; int Speed=int((read2-read1)*1000/(timeRead2-
timeRead1)*1.0);
2. VOID SETUP TO OPEN THE SERIAL PORT AND IDENTIFY
THE PIEZO AS OUTPUT 5. CREATE A FOR STATEMENT TO SET CONDITIONS FOR
PIEZO OUTPUT. IF THE SPEED IS GREATER THAN THIRTY
void setup(){ (BECAUSE BELOW THIRTY IS UNRELIABLE) THEN WRITE TO
Serial.begin(9600); //Begining Serial Connection PIEZO.
pinMode(piezoPin, OUTPUT); // sets the digital pin as
output if (abs(Speed)>30){
} Serial.println(10000/abs(Speed));
for(int j=0;j<10000/abs(Speed);j++){
3. USE VOID LOOP TO PERFORM TWO READS. USE digitalWrite(13,HIGH);
MILLIS TO RECORD A TIME FOR EACH DISTANCE READ- delayMicroseconds(freq);
ING. MAP THE RESISTANCE READINGS TO THE RELEVANT digitalWrite(13,LOW);
UNITS. delayMicroseconds(freq);
}
void loop(){ }
timeRead1=millis(); //digitalWrite(13,HIGH);
in = analogRead(0); // Reading Sensed data from if (abs(Speed)<30){
Arduino digitalWrite(13,LOW);
in=map(in,650,100,10,80);//converting to cm }
Observations

Observations

The GP2Y0A21YK Analog Distance Sensor measures 10-80cm. This is not an ad-
equate range to demonstrate the desired effect for this project. The analog input is
finicky and does not produce consistant data.

Moving Forward

Moving forward, an Ultrasonic Digital Sensor with a range of 6 inches to 254 inches
will be tested at a 1:1 scale.

You might also like