Image

Lost Arduino Kit?

20 Dec

Lost Arduino Kit?

Did anyone forget their Arduino kit in the BDA studio? Message me if this is yours!

Image

Final Project – Wine Wall – Tyler Cook & Casey Henrichs

19 Dec

photo photo (3) photo (1)Final Project - Wine Wall - Tyler Cook & Casey Henrichs

Our project used RFID technology to interact with a wine rack. There were two levels of interaction; the LEDs and the displayed text. Ideally we had planned to tag each bottle of wine with an RFID tag and then have those tags display a text when scanned pertaining to that type of wine. The information was a broad definition of a Riesling or Shiraz wine giving information about the grapes, history, and food pairings. This would allow the same tag to be reapplied to another bottle without it being the exact brand of wine.

The ceramic tiles which held the wine bottles were then fitted with LEDs. The idea developed to a point where scanning the tag would interrupt the LED loop and turn certain tile’s LEDs off. The idea behind this was that empty tiles would be dark until a bottle replaced to old one.

For the actual project budget constraints led to a few alterations in the design. Each bottle of wine contained an RFID tag. Due to the financial restraints of the project we were only able to display the piece with 5 wine bottles. These 5 tiles then had LEDs wired separately to transistors on the arduino board to stop the current when that particular tag was scanned. Unfortunately not all of the transistors were compatible and only 2 where able to be displayed with the correct changes in lighting.

Another issue we faced was getting the desired text to be read through processing. Processing would not display character strings received from Arduino. Our way around this was to type the phrases directly into processing or into Firefly. This was not ideal as it did not sync to the scanning of the tags. The information appeared though with the click of the mouse. The other problem with Firefly is that the tool used to display text only allows three inputs. This meant that the final project had two wine bottle tiles that had LEDs turning off when the RFID tags were scanned and three that projected a text when scanned.

Here is the code we used:

// RFID reader for Arduino
// Wiring version by BARRAGAN
// Modified for Arudino by djmatic

int val = 0;
char code[10];
int bytesread = 0;

void setup() {

Serial.begin(2400); // RFID reader SOUT pin connected to Serial RX pin at 2400bps
pinMode(2,OUTPUT); // Set digital pin 2 as OUTPUT to connect it to the RFID /ENABLE pin
//pinMode(5,OUTPUT); //Send to second arduino
digitalWrite(2, LOW); // Activate the RFID reader
digitalWrite(5,HIGH); //LEDs on in tiles
digitalWrite(3,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(9,HIGH);
digitalWrite(11,LOW);
digitalWrite(12,LOW);
digitalWrite(13,LOW);
}

void loop() {

if(Serial.available() > 0) { // if data available from reader
if((val = Serial.read()) == 10) { // check for header
bytesread = 0;
while(bytesread 0) {
val = Serial.read();
if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading
break; // stop reading

}
code[bytesread] = val; // add the digit
bytesread++; // ready to read next digit
}
}
if(bytesread == 10) { // if 10 digit read is complete
//Serial.print(“TAG code is: “); // possibly a good TAG
Serial.println(val); // print the TAG code
}
if (val==65){
Serial.println(“Shiraz originated in the Rhône region of France.”);
Serial.println(“Wines made from Syrah are often powerfully flavoured and full-bodied. While there is a wide range of aromas, two that are often noticed in Shiraz wines are that of blackberry and pepper.”);
Serial.println(“Shiraz is a heavy red with big bodied flavor and therefore pairs well with meets such as beef and lamb.”);
digitalWrite(5,LOW); // LEDs off when scanned
digitalWrite(11,HIGH);
//delay(500);
//digitalWrite(5,LOW);
}
if(val==53){
Serial.println(“Malbec originated in the Bordeaux region of France and has spread to South America.” );
Serial.println(“Wines made from Malbec grapes have hints of ripe fruits and earthy greens.”);
Serial.println(“Malbec is a medium bodied red wine pairing well with red meats and dishes of Mexican, Cajun, or Italian cuisine.”);
digitalWrite(6,LOW);
digitalWrite(12,HIGH);

}
if(val==48){
Serial.println(“Rosé wine originated in the Provence region of France which was settled by ancient Greeks around 600 BC.”);
Serial.println(“Wines of this sort rely on the skins of the grapes to color the wine but remove them before they add a harshness to the flavor.”);
Serial.println(“Since rosés are made with a variety of grapes the flavor ranges from light and fruity to a darker heartier wine.”);
Serial.println(“Due to it’s wide variety of blends a rosé pairs well with an endless possibility of foods.”);
digitalWrite(3,LOW);
}
if(val==50){
Serial.println(“Sauvignon blanc is a green grape that originated in the Bordeaux region of France”);
Serial.println(“The grapes were named after the French word for wild, sauvage, and produce wines with flavors ranging from zesty lime to a flowery peach. “);
Serial.println(“This herbaceous wine pairs well with simple greens and herbs.”);
digitalWrite(7,LOW);
digitalWrite(13,HIGH);
}
if(val==52){
Serial.println(“Riesling originated in the Rhine region of Germany.”);
Serial.println(“Riesling wines tend to exhibit notes of apple and tree fruit.”);
Serial.println(“Noble rot is a term used when Riesling grapes were harvested after a harsh freeze creating a much sweeter wine.”);
Serial.println(“Sweet riesling wines pair well with dessert as they are semi-carbonated like dessert champagnes.”);
digitalWrite(9,LOW);
}

bytesread = 0;
digitalWrite(2, HIGH); // deactivate the RFID reader for a moment so it will not flood
delay(1500); // wait for a bit
digitalWrite(2, LOW); // Activate the RFID reader
}
}
}

// extra stuff
// digitalWrite(2, HIGH); // deactivate RFID reader

Image

Final Project – Shadowbox (aka Mystery Box) – Kevin Desautels, Dennis MacAvaney, Kierra Thomas

19 Dec

Final Project - Shadowbox (aka Mystery Box) -  Kevin Desautels, Dennis MacAvaney, Kierra Thomas

Shadowbox is an installation that manipulates shadows. It works best in a dark room with a single light source. The goal of this project was to produce a fun, interactive piece that is both reactive and somewhat unpredictable (to add interest).
The Box contains an Arduino, a webcam, 2 potentiometers, and has a frosted plastic screen on which to cast shadows. The frosted plastic aids the processing script in blob detection by filtering out color. One potentiometer controls the color of the projection, and one controls the shakiness of the edges drawn. The arduino then relays the raw information to a laptop, which runs a processing script. The processing script captures video frames from the webcam, and attempts to draw the edges of the shadows it views from the inside of the plastic screen, and then draw lines from the center of the blobs to the outer edge (to act as a fill).
Because of the roughness of the blobs detected by the processing code, the projected image is abstract and interacts somewhat unpredictably. Shadowbox is a good proof of the concept, but could use streamlining and more accurate interpretations of the shadows. This would help to produce a more consistently reactive and abstract result. More controls could be added to give the user more options.

ARDUINO CODE:

int colorPot=0;//determines color in Processing (float Color)
int weirdPot=0;//determines shaky-ness of edges (float Weird)

void setup(){
Serial.begin(9600);
}

void loop(){
colorPot=analogRead(A0);
weirdPot=(analogRead(A1)+9000);//adds 9000 to variable to differentiate from colorPot
colorPot=map(colorPot,510,1023,0,510);
Serial.println (colorPot);
delay(50);//for stability
Serial.println (weirdPot);
delay(50);
}

PROCESSING CODE:

import processing.video.*;
import blobDetection.*;
import processing.serial.*;

Capture cam;
BlobDetection theBlobDetection;
PImage img;
boolean newFrame=false;
Serial myPort;
float Temp=0;
float Color=0;
float Weird=0;

// ================================================== setup()
void setup()
{
println(Serial.list());//Select serial port
myPort = new Serial(this, Serial.list()[3], 9600);
size(640, 480);
String[] cameras = Capture.list(); //Select camera
if (cameras.length == 0) {
println(“There are no cameras available for capture.”);
exit();
} else {
println(“Available cameras:”);
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);
}
cam = new Capture(this, cameras[3]); //iSight
//cam = new Capture(this, cameras[15]); //webcam
cam.start();
}
// BlobDetection
// img which will be sent to detection (a smaller copy of the cam frame);
img = new PImage(80,60);
theBlobDetection = new BlobDetection(img.width, img.height);
theBlobDetection.setPosDiscrimination(false);//"true" makes blobs favor bright areas, mostly works
theBlobDetection.setThreshold(0.8f); //detection threshold
}

// ================================================== captureEvent()
void captureEvent(Capture cam)
{
cam.read();
newFrame = true;
}

// ================================================== draw()
void draw()
{
if (newFrame)
{
newFrame=false;
background(0, 255); //background color
img.copy(cam, 0, 0, cam.width, cam.height,
0, 0, img.width, img.height);
fastblur(img, 2);
theBlobDetection.computeBlobs(img.pixels);
drawBlobsAndEdges(false,true);
}
}

// ================================================== drawBlobsAndEdges()
void drawBlobsAndEdges(boolean drawBlobs, boolean drawEdges)
{
noFill();
Blob b;
EdgeVertex eA,eB,vA,vB;

Temp=0;
String inString=myPort.readString();//Read from serial port

if(inString!=null){
inString = trim(inString);
Temp = float(inString);

if(Temp<9000){//filter out colorPot value, set = float Color
Color=Temp;
}else{//filter out weirdPot value, set = float Weird
Weird=(Temp-9000);
Weird=map(Weird,550,1023,0,.02);
if(Weird<0){
Weird=0;}
println(Weird);
}
}else{
Temp=0;
}

for (int n=0 ; n<theBlobDetection.getBlobNb() ; n++)//blob-scanning
{
b=theBlobDetection.getBlob(n);
if (b != null)
{
if (drawEdges)//Edges
{
//====================================color scrolling
float R=0;
float G=0;
float B=0;
if(Color255){
B=(Color-255);
}else{
B=0;}
G=(255-R-B); //R+G+B = 256

strokeWeight(5);
stroke(R,G,B);
for (int m=0;m 0){
eB.x += random(-Weird,Weird);//adds random value to edge endpoint based on float Weird
eB.y += random(-Weird,Weird);
}
if (eA !=null && eB !=null){
line(
eA.x*width, eA.y*height,
eB.x*width, eB.y*height);
line(
b.x*width, b.y*height,
eB.x*width, eB.y*height);
}
}
}//end edge drawing
}
}//end blob-scanning loop
}
// The following code is unneccesary, but adds stability to edges
// Super Fast Blur v1.1
// by Mario Klingemann
//
// ==================================================
void fastblur(PImage img,int radius)
{
if (radius<1){
return;
}
int w=img.width;
int h=img.height;
int wm=w-1;
int hm=h-1;
int wh=w*h;
int div=radius+radius+1;
int r[]=new int[wh];
int g[]=new int[wh];
int b[]=new int[wh];
int rsum,gsum,bsum,x,y,i,p,p1,p2,yp,yi,yw;
int vmin[] = new int[max(w,h)];
int vmax[] = new int[max(w,h)];
int[] pix=img.pixels;
int dv[]=new int[256*div];
for (i=0;i<256*div;i++){
dv[i]=(i/div);
}

yw=yi=0;

for (y=0;y<h;y++){
rsum=gsum=bsum=0;
for(i=-radius;i>16;
gsum+=(p & 0x00ff00)>>8;
bsum+= p & 0x0000ff;
}
for (x=0;x>16;
gsum+=((p1 & 0x00ff00)-(p2 & 0x00ff00))>>8;
bsum+= (p1 & 0x0000ff)-(p2 & 0x0000ff);
yi++;
}
yw+=w;
}

for (x=0;x<w;x++){
rsum=gsum=bsum=0;
yp=-radius*w;
for(i=-radius;i<=radius;i++){
yi=max(0,yp)+x;
rsum+=r[yi];
gsum+=g[yi];
bsum+=b[yi];
yp+=w;
}
yi=x;
for (y=0;y<h;y++){
pix[yi]=0xff000000 | (dv[rsum]<<16) | (dv[gsum]<<8) | dv[bsum];
if(x==0){
vmin[y]=min(y+radius+1,hm)*w;
vmax[y]=max(y-radius,0)*w;
}
p1=x+vmin[y];
p2=x+vmax[y];

rsum+=r[p1]-r[p2];
gsum+=g[p1]-g[p2];
bsum+=b[p1]-b[p2];

yi+=w;
}
}
}

Image

Final Project – Interactive Blinds – Arthur Dunne and Alex Duden

16 Dec

Sine Wave PatternLight Sensorgrasshopper screen shotFinal Project - Interactive Blinds - Arthur Dunne and Alex Duden

We designed a system of interactive blinds that reacted to light sensors, an OSC Touch on the iphone, and a sine wave animation that we created in Grasshopper. A projector was also included in our display to provide color, so this was added for only aesthetics. We started by building a frame out of two-by-fours, which held everything together. Next, we constructed the blinds out of thin balsa wood and attached wooden dowels to the ends of each blind, so that they could pivot around 180 degrees. We borrowed a pre-wired rail of servo motors from Justin, that we used to rotate the wooden blinds and was connected to an Arduino. All in all, we were able to build this on a low budget, because we already had the light sensors, grasshopper, breadboard, computer, projector, Arduino, and iphone. The only costs were the OSC Touch app for $5, and $15 worth of balsa wood.

After everything was wired to the Arduino, we uploaded the Firefly Firmata to the Arduino. We used Firefly as a way to link the Arduino to Grasshopper, and created all of our variations through this visual programming software. It took us a little while to troubleshoot the OSC Touch, because it had to be on the right channel, and share the same IP address as the computer, but the result was great. The OSC Touch allows the user to control the blinds’ position from an iphone, which could be useful in any kind of building or house.

Next, we experimented with the light sensors, and we were able to get the blinds in an open position when the light was shining on the sensor, and a closed position when it was dark. Our intention was to simulate the sun’s rays shining on the window of a house during the day, and how the blinds would respond by opening. This would allow a room to utilize the sun as a source of heating and lighting during the day and trap the heat in as the sun sets.

Finally, we created sine wave animations on Grasshopper, and connected each of them to a separate servo motor. Each sine wave animation had a different speed and degree of rotation, so that it would generate a gradual wave across the blinds. This was purely an aesthetic display as well as the projector that projected different colors onto the blinds for each application.

Image

Homework 06 – Second Arduino Board Interacton – Sarah Wolf and Charlene Kulesa

21 Nov

Homework 06 - Second Arduino Board Interacton - Sarah Wolf and Charlene Kulesa

Potentiometer is connected to arduino board 1, controls the LED light blinking frequency on arduino board 2.

Here is the code:
int LED = 13;// setting the integer LED
int pot = 0; //analog pin used to connect the potentiometer

void setup() {
pinMode (LED, OUTPUT);// set pin 13 to output

}
void loop() {
pot = (analogRead(A0));
digitalWrite (LED, HIGH);// Turn LED on
delay(pot); //delay based off of potentiometer
digitalWrite (LED, LOW);//Turn LED off
delay(pot); //delay based off of potentiometer

}

Image

Class Demo – Analog Digital Converter – 11-21-2013

21 Nov

Digital to Ananlog Converter_bb

Image

Homework 05- Arduino and Processing – Arthur Dunne

14 Nov

Homework 05-  Arduino and Processing - Arthur Dunne

 

2013-11-14_13-23-34_759

 

I connected the potentiometer to the Arduino, and then used the processing program to generate a wave pattern. I also changed the color of the stroke to blue.

import processing.serial.*;

Serial myPort; // The serial port
int xPos = 1; // horizontal position of the graph

void setup () {
// set the window size:
size(1000, 300);

println(Serial.list());// List all the available serial ports
myPort = new Serial(this, Serial.list()[0], 9600); // don’t generate a serialEvent() unless you get a newline character:
myPort.bufferUntil(‘\n’);

background(0); // set inital background:
}
void draw () {

}

void serialEvent (Serial myPort) {// get the ASCII string:

String inString = myPort.readString();

if (inString != null) { // trim off any whitespace:

inString = trim(inString);// convert to an int and map to the screen height:

float inByte = float(inString);
inByte = map(inByte, 0, 1023, 0, height);//map incomming value to height of screen

stroke(25, 38 , 56 );// draw the line:
line(xPos, height, xPos, height – inByte);

// at the edge of the screen, go back to the beginning:
if (xPos >= width) {
xPos = 0;
background(4);
}
else {
// increment the horizontal position:
xPos++;
}
}
}