IFD:PhysicalComp2011/Dianna Mertz: Difference between revisions

From Medien Wiki
mNo edit summary
mNo edit summary
Line 8: Line 8:


===Concept===
===Concept===
These smart containers are a response to all the rotten food, unnecessary purchases, and special cravings you've ever had. Now you can see what's in your kitchen from where ever you are, just by checking your smart phone. <br>
These smart containers are a response to all the rotten food, unnecessary purchases, and special cravings you've ever had. Now you can see what's in your kitchen from wherever you are, just by checking your smart phone. <br>
http://doubledi.com/indepth/jpgs/concept_wiki.jpg
http://doubledi.com/indepth/jpgs/concept_wiki.jpg


===Product Function===
===Product Function===
The final product would have a short-distance sensor and wifi chip embedded within the lid of the container. The wifi chip would auto FTP the food data levels by sending the data to the wireless local area network. This info could then be accessed remotely with any web-enabled device, by logging into a secure account. <br>
The manufactured product would have a short-distance sensor and wifi chip embedded within the lid of the container. The wifi chip would send the data of the container levels to the wireless local area network, which would upload it to internet. This info could then be accessed remotely with any web-enabled device by logging into a secure account. <br>
http://doubledi.com/indepth/jpgs/function_wiki.jpg
http://doubledi.com/indepth/jpgs/function_wiki.jpg


===Prototype===
===Prototype Equipment===


====Equipment====
* [[Arduino]]
* [[Arduino]]
* Sharp GP2D120XJ00F Analog Infrared Distance Sensor 4-30cm
* Sharp GP2D120XJ00F Analog Infrared Distance Sensor 4-30cm
Line 27: Line 26:
<br><br><br>
<br><br><br>


====Container Prototype====
===Container Prototype===
http://doubledi.com/indepth/jpgs/prototype_function.jpg
http://doubledi.com/indepth/jpgs/prototype_function.jpg
<br><br><br>
<br><br><br>
Line 33: Line 32:
<br><br><br>
<br><br><br>


====Mobile Prototype====
===Mobile Prototype===
http://doubledi.com/indepth/jpgs/mobile_app.jpg
http://doubledi.com/indepth/jpgs/mobile_app.jpg
<br><br><br>
<br><br><br>
Line 39: Line 38:
<br><br><br>
<br><br><br>


====Demo Video====
===Demo Video===


<videoflash type=vimeo>39147257</videoflash>
<videoflash type=vimeo>39147257</videoflash>
<br><br>
<br><br>


====Live Web Demo====
===Live Web Demo===


http://doubledi.com/indepth/jpgs/live_web.jpg<br>
http://doubledi.com/indepth/jpgs/live_web.jpg<br>
Line 50: Line 49:




====Code====
===Code===


=====Arduino=====
====Arduino====
<source lang="java">
<source lang="java">
int sensePin = 1;  // infrared sensor to analog pin
int sensePin = 1;  // infrared sensor to analog pin
Line 69: Line 68:
</source>
</source>


=====Processing=====
====Processing====
<source lang="java">
<source lang="java">
Serial myPort; // variable for the serial
Serial myPort; // variable for the serial
Line 99: Line 98:
</source>
</source>


=====PHP=====
====PHP====
(Gets the data from an automatically uploaded file from desktop)
(Gets the data from an automatically uploaded file from desktop)
<source lang="php">
<source lang="php">

Revision as of 15:28, 26 March 2012

In-Depth: Smart Containers

PDF Version

In-Depth: Smart Containers PDF

Presentation Files

Click here

Concept

These smart containers are a response to all the rotten food, unnecessary purchases, and special cravings you've ever had. Now you can see what's in your kitchen from wherever you are, just by checking your smart phone.
concept_wiki.jpg

Product Function

The manufactured product would have a short-distance sensor and wifi chip embedded within the lid of the container. The wifi chip would send the data of the container levels to the wireless local area network, which would upload it to internet. This info could then be accessed remotely with any web-enabled device by logging into a secure account.
function_wiki.jpg

Prototype Equipment

  • Arduino
  • Sharp GP2D120XJ00F Analog Infrared Distance Sensor 4-30cm
  • Container
  • Computer
  • Mobile Device

equipment_wiki.jpg


Container Prototype

prototype_function.jpg


prototype_function2.jpg


Mobile Prototype

mobile_app.jpg


mobile_app2.jpg


Demo Video

<videoflash type=vimeo>39147257</videoflash>

Live Web Demo

live_web.jpg
Click here to be routed to the live demo launch page


Code

Arduino

int sensePin = 1;   // infrared sensor to analog pin
int value;     // value coming from the sensor

void setup() {
  Serial.begin(9600); // start the serial port                          
}

void loop() {
  int value = analogRead(sensePin); // current value of the sensor
  byte scaledVal = map(value, 0, 600, 0, 255); // rescale to send as one byte     
  Serial.write(scaledVal);  //print the distance
  delay(100);  // arbitrary wait time
}

Processing

Serial myPort; // variable for the serial
import processing.serial.*; // reads information coming in through the server via Arduino
int incomingVal; // incoming number value
int r; // example
int b; // example
int q; // example
int o; // example 
 
void setup(){
  size(255,255); // visualization window size
  myPort = new Serial(this,"/dev/tty.usbmodem411",9600); // my Arduino port
}
 
void draw(){
  background(0); // background black for visualization
  while(myPort.available() > 0){
    incomingVal = myPort.read(); // while new data coming in from Arduino, store in variable
  }
  float reVal =map(incomingVal, 51, 255, 0, 255); // rescale the incoming value to the depth of the container
  fill(reVal); // fill the visualization with the rescaled incoming value
  rect(0,height - reVal,width,height); // draws rectangle of the incoming value
  println("Flour:" +(reVal)+ " Sugar:" + r+ " Oats:" + b+ " Pasta:" + q+ " Millet" + o ); // incoming value to be seen in console
  PrintWriter output = createWriter("data/data.tsv"); // send info to external file
  output.println("Flour:" +(reVal)+ " Sugar:" + r+ " Oats:" + b+ " Pasta:" + q+ " Millet:" + o ); // directs which information to be written to new file
  output.flush(); // write the info
}

PHP

(Gets the data from an automatically uploaded file from desktop)

 <?php 
$file_handle = fopen("data.tsv", "r");
while (!feof($file_handle)) {
   $line = fgets($file_handle);
   echo $line;
}
fclose($file_handle);
?>


References

The Internet of Things Infographic
Reference for Sharp GP2D120XJ00F Analog Distance Sensor 4-30cm
Arduino – Using a Sharp IR Sensor for Distance Calculation
Frederic Gmeiner's Potentiometer Code
The Right Way to Read Files with PHP
Sencha Touch Charts
iPhone 4 PSD template