Lane of Things Hawthorne Effect Experiment

We are measuring whether foot traffic in a specific hallway in our high school decreases when students know they are being monitored.

AdvancedFull instructions provided10 hours624
Lane of Things Hawthorne Effect Experiment

Things used in this project

Hardware components

LED (generic)
LED (generic)
We included 3 LEDs in our design to have our node give off a visible reaction when people crossed the laser tripwire. The 3 LEDs go off in a row of Red-Blue-Red to mimic police car lights.
×3
Photon
Particle Photon
Our microcontroller
×1
Photo resistor
Photo resistor
Our way of receiving light
×1
Adafruit Laser Diode
Our way of sending light to the photo resistor
×1
Jumper wires (generic)
Jumper wires (generic)
Wires to connect parts together on the pcb
×1
Resistor 10k ohm
Resistor 10k ohm
1 10k ohm for photocell
×1
Resistor 221 ohm
Resistor 221 ohm
3 220 ohm for leds
×3
PCB
×1

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
What we used to cut our enclosure
Soldering iron (generic)
Soldering iron (generic)
Soldering iron to connect components to each other

Story

Read more

Custom parts and enclosures

Wooden Enclosures .ai File

We used these shells for the first section of our project because they blended in with the wooden shelves they were placed on

Acrylic Enclosures .ai File

We used these shells for the second section of our experiment because they would draw more attention to the node.

Schematics

Breadboard fritzing

Code

LoT-Hawthorne

Arduino
This is our project where we monitor traffic by door C in Lane Tech. A laser shines across one side of the hallway and contacts a photocell. Whenever someone passes through it, the count goes up and we shine some led's. The code is then pushed to a sparkfun data center.
// This #include statement was automatically added by the Particle IDE.
#include <SparkFunPhant.h>

int pCellPin = A0;
int count = 0;
int ledPin  = D0;
int ledPin2 = D2;
int ledPin3 = D4;
double value1 = 0; 
double value2 = 0; 

const char server[] = "data.sparkfun.com"; // Phant destination server
const char publicKey[] = "hidden"; // Phant public key - HAS TO BE CHANGED
const char privateKey[] = "hidden"; // Phant private key  - HAS TO BE CHANGED
Phant phant(server, publicKey, privateKey); // Create a Phant object

const int POST_RATE = 3000; // Time between posts, in ms.
unsigned long lastPost = 0; // global variable to keep track of last post time

void setup() {
pinMode(ledPin, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
Serial.begin(9600);
}

void loop() {
int read  = analogRead(pCellPin);


value1++;
    value2++;

    //Replace the if statement below with whatever your trigger is
    boolean somethingHappened = false;
    if (read<4000)
    {
         count ++;
    digitalWrite(ledPin, HIGH);
    delay(100);
    digitalWrite(ledPin2, HIGH);
    delay(100);
    digitalWrite(ledPin3, HIGH);
    delay(100);
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin3, LOW);
    
        postToPhant();
    }
    Serial.println( read );
}

int postToPhant()
{    
    // Use phant.add(<field>, <value>) to add data to each field.
    // Phant requires you to update each and every field before posting,
    // make sure all fields defined in the stream are added here.
    phant.add("count", count);
    
        	
    TCPClient client;
    char response[512];
    int i = 0;
    int retVal = 0;
    
    if (client.connect(server, 80)) // Connect to the server
    {
		// Post message to indicate connect success
        Serial.println("Posting!"); 
		
		// phant.post() will return a string formatted as an HTTP POST.
		// It'll include all of the field/data values we added before.
		// Use client.print() to send that string to the server.
        client.print(phant.post());
        delay(1000);
		// Now we'll do some simple checking to see what (if any) response
		// the server gives us.
        while (client.available())
        {
            char c = client.read();
            Serial.print(c);	// Print the response for debugging help.
            if (i < 512)
                response[i++] = c; // Add character to response string
        }
		// Search the response string for "200 OK", if that's found the post
		// succeeded.
        if (strstr(response, "200 OK"))
        {
            Serial.println("Post success!");
            retVal = 1;
        }
        else if (strstr(response, "400 Bad Request"))
        {	// "400 Bad Request" means the Phant POST was formatted incorrectly.
			// This most commonly ocurrs because a field is either missing,
			// duplicated, or misspelled.
            Serial.println("Bad request");
            retVal = -1;
        }
        else
        {
			// Otherwise we got a response we weren't looking for.
            retVal = -2;
        }
    }
    else
    {	// If the connection failed, print a message:
        Serial.println("connection failed");
        retVal = -3;
    }
    client.stop();	// Close the connection to server.
    return retVal;	// Return error (or success) code.
}

Credits

Ryan Kasper

Ryan Kasper

1 project • 0 followers
Elliott Morales

Elliott Morales

1 project • 0 followers
Currently enrolled at Lane Tech High School. Going to University of Illinois for Computer Science.
Nicholas Schoessling

Nicholas Schoessling

1 project • 0 followers
Currently enrolled at Lane Tech High School. Going to Lewis University for Computer Engineering.

Comments

Add projectSign up / Login