Ambient Food Campus Map

Made by Shawn Koid, Harshika Jain and Tejas Kashyap

Found in DioT 2019: Social Objects - Part 2

Our team is proposing an ambient map that will be placed at major buildings on CMU campus (i.e. University Center) to indicate free food opportunities and when CMU's food pantry is open and closed.

0

Why Create the Ambient Food Map?

While it may not be obvious, about 19% of the CMU student community is food insecure. Having to choose between eating and rent, tuition, amongst other expenditures, is a difficult situation to endure. Feeling hungry effects students’ moods and behaviours, health and well-being, social lives, and academic concentration. Unfortunately, there is also a stigma around food insecurity–making it even more troublesome for food insecure students. CMU officially launched a food pantry last fall, where all CMU students are able to get food staples for free (twice a month). Despite the CMU pantry being a step forward, we felt inspired to create a product that could help better connect students to the CMU pantry and other food opportunities on campus, as well as reduce the social stigma around using the pantry. 

With this goal in mind, our team proposes an ambient device that subtly informs students when the food pantry is opening and closing, when there are on-campus events offering free food, and if a “buddy” is available to visit the pantry or event together. The device synchronizes with the pantry’s opening hours, aims to fetch data from Facebook posts/tweets and detect when a buddy is available (when students are within proximity of each other). 

0

How it Works

0
How The Ambient Food Map Will Work
Screen shot 2019 02 11 at 6.39.03 pm Shawn Koid (2019)
0

PseudoCode

The pseudocode diagram was made to better understand the sequence of actions and events triggered i.e. OUTPUTS by the INPUTS. 

0

First Prototype

The components used in the working prototype include: 

1. 2 argons

2. 2 breadboards

3. 2 neopixels

4. 2 buttons 

0
SocialThings_Ambient Map_Prototype1
Shawn Koid - https://youtu.be/YX8BqAJlR0M
0

Code

0
// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>

int now = 0;
unsigned long tStartedAt =0;
bool tRunning = FALSE;
int duration = 10*1000;
int z=255;

uint32_t c;


uint32_t k;
int buttonPin = D3;
long lastPublishedAt = 0; // This value will store the last time we published an event
int publishAfter = 1000; // this is the time delay before we should publish a new event from this device

// ------------------- NEOPIXEL
#define PIXEL_COUNT 1
#define PIXEL_PIN D2
#define PIXEL_TYPE WS2812
Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

void setup() {
  Particle.subscribe(  "diot/2019/paired/sthfoodout/" , handleSharedEvent );
  pinMode( buttonPin , INPUT_PULLUP); // sets pin as input
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() { //publish my event you'll want some more complex stuff here

    int buttonState = digitalRead( buttonPin );
    
    c = strip.Color(0, 0, 255); // Blue
    
    if( buttonState == LOW ){  // turn the LED ON
    tStartedAt = millis();
    tRunning = TRUE;
    publishMyEvent();
    rainbow(c);
    delay(100); // delay for a bit
    }
    
    int now = millis();
    int j=now-tStartedAt;
    if(tRunning && j%1000<100) {
        z=z-255/10;
        k = strip.Color(0, 0, z);
        rainbow(k);
    }
    
    if (j>duration) {
        k = strip.Color(0,0,0);
        rainbow(k);
        tRunning=FALSE;
    }
}

void publishMyEvent(){
     if( lastPublishedAt + publishAfter < millis() ) {
         String eventName = "diot/2019/paired/sthfoodout/" + System.deviceID();
         Particle.publish( eventName, "food is available" );
         lastPublishedAt = millis();
         }
    }

void handleSharedEvent(const char *event, const char *data) {
    String eventName = String( event ); // convert to a string object
    String deviceID = System.deviceID();
    
    if( eventName.indexOf( deviceID ) != -1 ){
        return;
    } else {
        tStartedAt = millis();
        tRunning = TRUE;
        rainbow(c);
    }
    
    
    // c = strip.Color(255, 0, 0);
    // rainbow(c);
    // c = strip.Color(0, 255, 0);
    // rainbow(c);
    // c = strip.Color(255, 255, 255);
    // rainbow(c);
}



void rainbow(uint32_t c){
    for( int i = 0; i < strip.numPixels(); i++ ){
     strip.setPixelColor(i, c); // i= which led to light up, c= set a color 
     strip.show();
     delay( 100 ); // update each pixel one by one, and wait 100 ms in between each update
     }
  delay( 100 );
   
//   for( int i = strip.numPixels()-1; i >= 0 ; i-- ){
//      c = strip.Color(0, 0, 0); // White
//      strip.setPixelColor(i, c); // set a color 
//      strip.show();
//      delay( 100 ); // update each pixel one by one, and wait 100 ms in between each update
//   }
//   delay( 100 );
}
Click to Expand
0

Next Steps

1. Using IFTTT or another method, send a message about the location of button i.e. location of food when the button is triggered. 

2. Convert the open circuits to look like an ambient device. 

3. User Testing. 

x
Share this Project

This project is only accessible by signed in users. Be considerate and think twice before sharing.


Courses

49713 Designing for the Internet of Things

· 18 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


Focused on
About

Our team is proposing an ambient map that will be placed at major buildings on CMU campus (i.e. University Center) to indicate free food opportunities and when CMU's food pantry is open and closed.

Created

February 11th, 2019