Weight in Greed (Ralph + Maryyann)

Have you ever patiently stood in a Buffet line, waiting for your turn to grab some food? Finally, you reach the start of the table and pick up a plate, but you suddenly realize that the previous person had taken such  large portions that the rest of the hungry customers don’t have enough to eat.

People always say to be more conservative or watch our weight. But we never take the time to recognize how much we actually take when we serve ourselves. “Weight in Greed” is based on the idea of bringing awareness to that issue. The most difficult and most important part of our project was actually building the scale to measure the difference in weight. After many attempts, we finally created a wooden scale consisting of a force sensitive resistor, a rounded screw, a few pieces of hardboard, and of course an arduino. The round wooden table, as seen in the video holds a pillar which presses against the force sensitive resistor underneath. Whenever the weight changed, the force applied onto the sensor would change and the difference would flash before readjusting to inform the next customer.

IMG_2980

IMG_2986

#include  // Enable this line if using Arduino Uno, Mega, etc.
//#include  // Enable this line if using Adafruit Trinket, Gemma, etc.

#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

Adafruit_7segment matrix = Adafruit_7segment();
const int pressurePin = 3;
int prevPressureLevel = 5;

void setup()
{
#ifndef __AVR_ATtiny85__
  Serial.begin(9600);
  Serial.println("7 Segment Backpack Test");
#endif
  matrix.begin(0x70);
}

void loop()
{
  int pressureLevel;
  pressureLevel = analogRead(pressurePin); 
  boolean drawDots = false;
  int ledDisplay = 0;

  if (abs(pressureLevel - prevPressureLevel) > 15){
    delay(3000);
    ledDisplay = abs(prevPressureLevel - analogRead(pressurePin));
    Serial.println("hi"+ledDisplay);
  }

  matrix.writeDigitNum(0, (ledDisplay / 1000), drawDots);
  matrix.writeDigitNum(1, (ledDisplay / 100) % 10, drawDots);
  matrix.writeDigitNum(3, (ledDisplay / 10) % 10, drawDots);
  matrix.writeDigitNum(4, ledDisplay % 10, drawDots);

  matrix.writeDisplay();
  //  Serial.print("sensor: ");
  //  Serial.println(pressureLevel);
  prevPressureLevel = pressureLevel;
  Serial.println(pressureLevel);
  delay(200);
}
}

 

Comments are closed.