Doorway Traffic

Considering the busy schedule of most students life, especially of a graduate architecture student, the foot traffic of the studio space would be relatively busy. Utilizing the Arduino code and wiring, the sensors are able to pick up whenever the circuit is broken. Therefor, when the sensors are placed on the frame of the door and a body walks through the door, they would also be walking through the sensors. The broken connection ultimately triggers something within the Arduino, sounds a buzzer and keeps it in its records. The Arduino is coded to count the amount of times the circuit breaks, which ultimately counts the amount of bodies that exit or enter the studio space. The buzzer also alerts other beings within the space of a new presence or an exiting of a body. Keeping data of the foot traffic of the studio (and possibly the timing of the traffic) can assist with understanding the studio’s “peak hours”.

Below is the code that was used for Doorway Traffic

 

————–

#define LEDPIN 13
#define SENSORPIN 4

int sensorState = 0, lastState=0;
int counter = 50;

void setup() {

pinMode(LEDPIN, OUTPUT);

pinMode(SENSORPIN, INPUT);
digitalWrite(SENSORPIN, HIGH);

Serial.begin(9600);
}

void loop(){
sensorState = digitalRead(SENSORPIN);
if (sensorState == HIGH) {
digitalWrite(LEDPIN, LOW);
noTone(13);

}
else {
digitalWrite(LEDPIN, HIGH);
tone(13,counter = counter+1);
delay(100);
}
Serial.println(counter);

}