The midterm-taxi light project had several lessons on how things can go wrong with lighting. We spent a lot of time and money on lighting solutions that broke within the system. So I made many trips to the lighting store on 14th Street between 5th and Broadway.
From our first mishaps with the florescent light enclosure we learned that certain circuits don't respond well to rapid on and off switching. We later learned from the relay incident that when you overload a relay it may fuse open and allow current through.
I helped plan the housing structures of both prototypes, and the behavior of the system. Through most of the last iteration, I focused on getting lighting hardware in place for Finley's code.
Sunday, December 27, 2009
Final-InterFACE
This project was a good group effort. Each member of the team had a useful skill set and the work was spread across the group.
Photos: http://www.flickr.com/photos/45806699@N05/
Videos: http://www.vimeo.com/8334405 , http://www.vimeo.com/8334560
I handled most of the programming, and I learned a lot about Processing for handling screens, states, and timing. We went through a lot of interface iterations as we got feedback. Here's the last version of the code, for the blue cloud interface in the flickr photos:
import processing.serial.*;
Serial port; // Serial port variable
int serialIn = 0;
int stagew = 1920;
int stageh = 1156;
int state = 1;
PFont font; // Define font variable
int homeFlag = 1;
int homeDelay = 4000;
int startTime, currentTime, diffTime;
int endFlag = 1;
int endDelay = 6000;
int fromEnd = 0;
String selectedQuestion;
String gAdvice;
String mouth;
int randQ;
int randGAdvice;
int randAdvice;
String happyAdvice;
String sadAdvice;
int[][] answerArray = new int[2][500]; // Array to store answers
int answerCount = 0;
int happyCount = 0;
int qNumber = 1;
int qBuffer = 1;
int n = 0;
int happyTotal = 0; // Total of happy answers
int noneTotal = 0; // Total of neutral answers
int sadTotal = 0; // Total of sad answers
float sadRows = 0;
float happyRows = 0;
float noneRows = 0;
int sadBuffer, noneBuffer, happyBuffer;
String selectedQuestionBuffer;
int faceZeroW, faceZeroH, sumfaceZeroW, sumfaceZeroH, sadX, sadY, sadW, sadH, noneX, noneY, noneW, noneH, happyX, happyY, happyW, happyH;
int moodhappyTotal, moodnoneTotal, moodsadTotal, socialhappyTotal, socialnoneTotal, socialsadTotal, energyhappyTotal, energynoneTotal, energysadTotal;
int moodTotal, moodPoints, moodPossible, socialTotal, socialPoints, socialPossible, energyTotal, energyPoints, energyPossible;
float moodSpread, socialSpread, energySpread;
int eyeflag = 0;
int mouthflag = 0;
int switchflag = 0;
int pressedflag = 0;
int eyeval, mouthval, switchval;
int eyevalBuffer, eyevalDiff;
// *************************** SETUP LOOP ***************************
void setup() {
size(stagew, stageh); // Stage size
background(44);
noStroke();
smooth();
// Print a list of the serial ports and select first:
println(Serial.list());
port = new Serial(this, Serial.list()[0], 9600);
}
// *************************** DRAW LOOP ***************************
void draw() {
background(#8ccaea);
// *************************** Home State
if (state == 1) {
answerCount = 0;
happyCount = 0;
fromEnd = 0;
moodTotal = 0;
moodPoints = 0;
moodhappyTotal = 0;
moodnoneTotal = 0;
moodsadTotal = 0;
socialTotal = 0;
socialPoints = 0;
socialhappyTotal = 0;
socialnoneTotal = 0;
socialsadTotal = 0;
energyTotal = 0;
energyPoints = 0;
energyhappyTotal = 0;
energynoneTotal = 0;
energysadTotal = 0;
if (homeFlag == 1) {
startTime = millis();
}
if (homeFlag == 0) {
currentTime = millis();
}
diffTime = currentTime - startTime;
// Home Screen 1
if (diffTime < homea =" loadImage(" homeb="loadImage(" font =" loadFont(" font =" loadFont(" homec="loadImage(" font =" loadFont(" homeflag =" 0;" randgadvice =" int(random(3));" vizbkgd="loadImage(" linea="loadImage(" lineb="loadImage(" linec="loadImage(" vizdotted="loadImage(" vizfaces="loadImage(" font =" loadFont(" font =" loadFont(" font =" loadFont(" font =" loadFont(" i="0;" if="">= 130) {
moodhappyTotal++;
moodPoints = moodPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < moodpoints =" moodPoints">= 130) {
socialhappyTotal++;
socialPoints = socialPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < socialpoints =" socialPoints">= 130) {
energyhappyTotal++;
energyPoints = energyPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < energypoints =" energyPoints"> (2*homeDelay)) {
homeFlag = 1;
}
}
}
// *************************** Question State
if (state == 2) {
//load cloud background image
PImage QBkgd;
QBkgd=loadImage("cloud_qbkgd.jpg");
image(QBkgd, 0, 0);
//load static face image
PImage QFace;
QFace=loadImage("face_nomouth.jpg");
image(QFace, 994, 244);
//question
font = loadFont("Strada-Light-70.vlw"); //load font file
textFont(font);
fill(#ffffff); //font color
textAlign(LEFT);
text(selectedQuestion, 208, 244, 696, 594); //text display, color
textAlign(CENTER);
//text instructions part a
font = loadFont("Strada-Light-40.vlw"); //load font file
textFont(font);
fill(#000000); //font color
textAlign(LEFT);
text("Choose your mood with the mouth,", 308, 1082, 612, 40); //text display, color
//text instructions part b
font = loadFont("Strada-Light-40.vlw"); //load font file
textFont(font);
fill(#0b920b); //font color
text("press the button to submit your answer.", 912, 1082, 696, 40); //text display, color
textAlign(CENTER);
smileyMouth(1089, 527, 537, 101, 1); // Face showing input values
progBars(answerCount);
}
// *************************** End State
if (state == 5) {
if (endFlag == 1) {
startTime = millis();
randAdvice = int(random(5));
}
if (endFlag == 0) {
currentTime = millis();
}
diffTime = currentTime - startTime;
if (diffTime < rbkgd="loadImage(" font =" loadFont(" randadvice ="=" happyadvice = "If you smile while you talk, you make people happy." sadadvice = "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes. ~ Hugh Downs" randadvice ="=" happyadvice = "A good word to a friend or stranger can bring light into their day." sadadvice = "Look at the happy side of life, and you will develop the happiness habit." randadvice ="=" happyadvice = "Whoever is happy will make others happy, too. ~ Mark Twain" sadadvice = "Learn to laugh. This will make you feel better." randadvice ="=" happyadvice = "Be kind whenever possible. It is always possible. ~ Dalai Lama" sadadvice = "Each day do something to make you feel happy, until this becomes a habit." randadvice ="=" happyadvice = "Let us be grateful to people who make us happy, they are the charming gardeners who make our souls blossom. ~ Marcel Proust" sadadvice = "Choose happiness, concentrate on happiness, and you will find it everywhere."> 1) {
font = loadFont("Strada-Light-70.vlw"); //load font file
textFont(font);
fill(#000000); //font color
textAlign(LEFT);
text(happyAdvice, 234, 474, 1462, 320); //text display, color
textAlign(CENTER);
}
else {
font = loadFont("Strada-Light-70.vlw"); //load font file
textFont(font);
fill(#000000); //font color
textAlign(LEFT);
text(sadAdvice, 234, 474, 1462, 320); //text display, color
textAlign(CENTER);
}
for (int i=0; i= 130) {
moodhappyTotal++;
moodPoints = moodPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < moodpoints =" moodPoints">= 130) {
socialhappyTotal++;
socialPoints = socialPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < socialpoints =" socialPoints">= 130) {
energyhappyTotal++;
energyPoints = energyPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < energypoints =" energyPoints" endflag =" 0;" state =" 1;" homeflag =" 1;" endflag =" 1;" fromend =" 1;" serialin =" port.read();" mouthflag ="=" mouthval =" serialIn;" switchflag ="=" switchval =" serialIn;" serialin ="=" mouthflag =" 0;" switchflag =" 1;" serialin ="=" mouthflag =" 1;" switchflag =" 0;" mouthflag =" 0;" switchflag =" 0;" answercount ="=" selectedquestion = "How do you feel about SVA IXD?" qnumber =" 1;" selectedquestion = "1/4 of your degree is almost done." qnumber =" 4;" selectedquestion = "Today is a great day." qnumber =" 7;" answercount ="=" selectedquestion = "Celebrating the holidays with friends and family?" qnumber =" 2;" selectedquestion = "I feel like hanging out with friends." qnumber =" 5;" selectedquestion = "Want to play pictionary?" qnumber =" 8;" answercount ="=" selectedquestion = "I'm getting enough sleep." qnumber =" 3;" selectedquestion = "Are you motivated today?" qnumber =" 6;" selectedquestion = "I feel adventurous." qnumber =" 9;" state ="=">= 130) {
//case 1
mouth = "happy";
}
else if ((mouthval >= 120) && (mouthval < mouth = "none" mouth = "sad" switchval ="=" pressedflag ="=" sadtotal =" 0;" nonetotal =" 0;" happytotal =" 0;" happycount =" 0;" i="0;" if="">= 130) {
happyTotal++;
happyCount++;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < randq =" int(random(3));"> 2) {
state = 5;
endFlag = 1;
}
}
}
// *************************** Home State
if ((state == 1) && (fromEnd == 0)) {
if ((switchval == 0) && (pressedflag == 1)) {
state = 2;
randQ = int(random(3));
}
}
// setting flags for switch pressed
if (switchval == 1) {
pressedflag = 1;
}
else {
pressedflag = 0;
}
}
// *************************** SMILEY MOUTH FUNCTION ***************************
void smileyMouth(int x, int y, int w, int h, int active) {
PImage e, f, g;
e = loadImage("happy-mouth.jpg");
f = loadImage("none-mouth.jpg");
g = loadImage("sad-mouth.jpg");
if ((mouth == "happy") || (active == 0)) {
image(e, x, y, w, h);
}
else if (mouth == "none") {
image(f, x, y, w, h);
}
else if (mouth == "sad") {
image(g, x, y, w, h);
}
}
// *************************** PROGRESS BARS FUNCTION ***************************
void progBars(int answers) {
PImage onbar, offbar;
onbar = loadImage("onbar.jpg");
offbar = loadImage("offbar.jpg");
if (answers < answers ="=" answers ="="> 2) {
image(onbar, 20, 20);
image(onbar, 655, 20);
image(onbar, 1290, 20);
}
}
// *************************** GROUP STATS FUNCTION ***************************
void groupStats(int mPoints, int sPoints, int ePoints, int mTotal, int sTotal, int eTotal) {
int groupBarWidth = 1404;
int groupBarX = 286;
int mY = 388;
int sY = 564;
int eY = 740;
float mSpread = 0;
float sSpread = 0;
float eSpread = 0;
int mPossible, sPossible, ePossible;
int gAdviceX = 286;
int gAdviceY = 1030;
PImage mMarker, sMarker, eMarker;
mMarker = loadImage("green_triangle.png");
sMarker = loadImage("purple_triangle.png");
eMarker = loadImage("orange_triangle.png");
mPossible = mTotal * 2;
sPossible = sTotal * 2;
ePossible = eTotal * 2;
if ((mPoints != 0) && (mPossible != 0)) {
mSpread = float(mPoints) / float(mPossible);
}
if ((sPoints != 0) && (sPossible != 0)) {
sSpread = float(sPoints) / float(sPossible);
}
if ((ePoints != 0) && (ePossible != 0)) {
eSpread = float(ePoints) / float(ePossible);
}
float mOffset = mSpread * float(groupBarWidth);
float sOffset = sSpread * float(groupBarWidth);
float eOffset = eSpread * float(groupBarWidth);
image(mMarker, groupBarX + int(mOffset), mY);
image(sMarker, groupBarX + int(sOffset), sY);
image(eMarker, groupBarX + int(eOffset), eY);
float avSpread = (mSpread + sSpread + eSpread)/3;
if (avSpread > 0.5) {
switch(randGAdvice) {
case 0:
gAdvice = "Your happiness is showing!";
break;
case 1:
gAdvice = "Smiling is contagious.";
break;
case 2:
gAdvice = "Share the joy, it's satisfying.";
break;
}
}
else if (avSpread <= 0.5) { switch(randGAdvice) { case 0: gAdvice = "Happiness can overcome all challenges."; break; case 1: gAdvice = "Happiness equals good health."; break; case 2: gAdvice = "Extract happiness in all things!"; break; } } font = loadFont("Strada-Bold-40.vlw"); // Load font file textFont(font); fill(#000733); //font color textAlign(LEFT); text(gAdvice, gAdviceX, gAdviceY, 1500, 90); }
Photos: http://www.flickr.com/photos/45806699@N05/
Videos: http://www.vimeo.com/8334405 , http://www.vimeo.com/8334560
I handled most of the programming, and I learned a lot about Processing for handling screens, states, and timing. We went through a lot of interface iterations as we got feedback. Here's the last version of the code, for the blue cloud interface in the flickr photos:
import processing.serial.*;
Serial port; // Serial port variable
int serialIn = 0;
int stagew = 1920;
int stageh = 1156;
int state = 1;
PFont font; // Define font variable
int homeFlag = 1;
int homeDelay = 4000;
int startTime, currentTime, diffTime;
int endFlag = 1;
int endDelay = 6000;
int fromEnd = 0;
String selectedQuestion;
String gAdvice;
String mouth;
int randQ;
int randGAdvice;
int randAdvice;
String happyAdvice;
String sadAdvice;
int[][] answerArray = new int[2][500]; // Array to store answers
int answerCount = 0;
int happyCount = 0;
int qNumber = 1;
int qBuffer = 1;
int n = 0;
int happyTotal = 0; // Total of happy answers
int noneTotal = 0; // Total of neutral answers
int sadTotal = 0; // Total of sad answers
float sadRows = 0;
float happyRows = 0;
float noneRows = 0;
int sadBuffer, noneBuffer, happyBuffer;
String selectedQuestionBuffer;
int faceZeroW, faceZeroH, sumfaceZeroW, sumfaceZeroH, sadX, sadY, sadW, sadH, noneX, noneY, noneW, noneH, happyX, happyY, happyW, happyH;
int moodhappyTotal, moodnoneTotal, moodsadTotal, socialhappyTotal, socialnoneTotal, socialsadTotal, energyhappyTotal, energynoneTotal, energysadTotal;
int moodTotal, moodPoints, moodPossible, socialTotal, socialPoints, socialPossible, energyTotal, energyPoints, energyPossible;
float moodSpread, socialSpread, energySpread;
int eyeflag = 0;
int mouthflag = 0;
int switchflag = 0;
int pressedflag = 0;
int eyeval, mouthval, switchval;
int eyevalBuffer, eyevalDiff;
// *************************** SETUP LOOP ***************************
void setup() {
size(stagew, stageh); // Stage size
background(44);
noStroke();
smooth();
// Print a list of the serial ports and select first:
println(Serial.list());
port = new Serial(this, Serial.list()[0], 9600);
}
// *************************** DRAW LOOP ***************************
void draw() {
background(#8ccaea);
// *************************** Home State
if (state == 1) {
answerCount = 0;
happyCount = 0;
fromEnd = 0;
moodTotal = 0;
moodPoints = 0;
moodhappyTotal = 0;
moodnoneTotal = 0;
moodsadTotal = 0;
socialTotal = 0;
socialPoints = 0;
socialhappyTotal = 0;
socialnoneTotal = 0;
socialsadTotal = 0;
energyTotal = 0;
energyPoints = 0;
energyhappyTotal = 0;
energynoneTotal = 0;
energysadTotal = 0;
if (homeFlag == 1) {
startTime = millis();
}
if (homeFlag == 0) {
currentTime = millis();
}
diffTime = currentTime - startTime;
// Home Screen 1
if (diffTime < homea =" loadImage(" homeb="loadImage(" font =" loadFont(" font =" loadFont(" homec="loadImage(" font =" loadFont(" homeflag =" 0;" randgadvice =" int(random(3));" vizbkgd="loadImage(" linea="loadImage(" lineb="loadImage(" linec="loadImage(" vizdotted="loadImage(" vizfaces="loadImage(" font =" loadFont(" font =" loadFont(" font =" loadFont(" font =" loadFont(" i="0;" if="">= 130) {
moodhappyTotal++;
moodPoints = moodPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < moodpoints =" moodPoints">= 130) {
socialhappyTotal++;
socialPoints = socialPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < socialpoints =" socialPoints">= 130) {
energyhappyTotal++;
energyPoints = energyPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < energypoints =" energyPoints"> (2*homeDelay)) {
homeFlag = 1;
}
}
}
// *************************** Question State
if (state == 2) {
//load cloud background image
PImage QBkgd;
QBkgd=loadImage("cloud_qbkgd.jpg");
image(QBkgd, 0, 0);
//load static face image
PImage QFace;
QFace=loadImage("face_nomouth.jpg");
image(QFace, 994, 244);
//question
font = loadFont("Strada-Light-70.vlw"); //load font file
textFont(font);
fill(#ffffff); //font color
textAlign(LEFT);
text(selectedQuestion, 208, 244, 696, 594); //text display, color
textAlign(CENTER);
//text instructions part a
font = loadFont("Strada-Light-40.vlw"); //load font file
textFont(font);
fill(#000000); //font color
textAlign(LEFT);
text("Choose your mood with the mouth,", 308, 1082, 612, 40); //text display, color
//text instructions part b
font = loadFont("Strada-Light-40.vlw"); //load font file
textFont(font);
fill(#0b920b); //font color
text("press the button to submit your answer.", 912, 1082, 696, 40); //text display, color
textAlign(CENTER);
smileyMouth(1089, 527, 537, 101, 1); // Face showing input values
progBars(answerCount);
}
// *************************** End State
if (state == 5) {
if (endFlag == 1) {
startTime = millis();
randAdvice = int(random(5));
}
if (endFlag == 0) {
currentTime = millis();
}
diffTime = currentTime - startTime;
if (diffTime < rbkgd="loadImage(" font =" loadFont(" randadvice ="=" happyadvice = "If you smile while you talk, you make people happy." sadadvice = "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes. ~ Hugh Downs" randadvice ="=" happyadvice = "A good word to a friend or stranger can bring light into their day." sadadvice = "Look at the happy side of life, and you will develop the happiness habit." randadvice ="=" happyadvice = "Whoever is happy will make others happy, too. ~ Mark Twain" sadadvice = "Learn to laugh. This will make you feel better." randadvice ="=" happyadvice = "Be kind whenever possible. It is always possible. ~ Dalai Lama" sadadvice = "Each day do something to make you feel happy, until this becomes a habit." randadvice ="=" happyadvice = "Let us be grateful to people who make us happy, they are the charming gardeners who make our souls blossom. ~ Marcel Proust" sadadvice = "Choose happiness, concentrate on happiness, and you will find it everywhere."> 1) {
font = loadFont("Strada-Light-70.vlw"); //load font file
textFont(font);
fill(#000000); //font color
textAlign(LEFT);
text(happyAdvice, 234, 474, 1462, 320); //text display, color
textAlign(CENTER);
}
else {
font = loadFont("Strada-Light-70.vlw"); //load font file
textFont(font);
fill(#000000); //font color
textAlign(LEFT);
text(sadAdvice, 234, 474, 1462, 320); //text display, color
textAlign(CENTER);
}
for (int i=0; i
moodhappyTotal++;
moodPoints = moodPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < moodpoints =" moodPoints">= 130) {
socialhappyTotal++;
socialPoints = socialPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < socialpoints =" socialPoints">= 130) {
energyhappyTotal++;
energyPoints = energyPoints + 2;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < energypoints =" energyPoints" endflag =" 0;" state =" 1;" homeflag =" 1;" endflag =" 1;" fromend =" 1;" serialin =" port.read();" mouthflag ="=" mouthval =" serialIn;" switchflag ="=" switchval =" serialIn;" serialin ="=" mouthflag =" 0;" switchflag =" 1;" serialin ="=" mouthflag =" 1;" switchflag =" 0;" mouthflag =" 0;" switchflag =" 0;" answercount ="=" selectedquestion = "How do you feel about SVA IXD?" qnumber =" 1;" selectedquestion = "1/4 of your degree is almost done." qnumber =" 4;" selectedquestion = "Today is a great day." qnumber =" 7;" answercount ="=" selectedquestion = "Celebrating the holidays with friends and family?" qnumber =" 2;" selectedquestion = "I feel like hanging out with friends." qnumber =" 5;" selectedquestion = "Want to play pictionary?" qnumber =" 8;" answercount ="=" selectedquestion = "I'm getting enough sleep." qnumber =" 3;" selectedquestion = "Are you motivated today?" qnumber =" 6;" selectedquestion = "I feel adventurous." qnumber =" 9;" state ="=">= 130) {
//case 1
mouth = "happy";
}
else if ((mouthval >= 120) && (mouthval < mouth = "none" mouth = "sad" switchval ="=" pressedflag ="=" sadtotal =" 0;" nonetotal =" 0;" happytotal =" 0;" happycount =" 0;" i="0;" if="">= 130) {
happyTotal++;
happyCount++;
}
else if ((answerArray[1][i] >= 120) && (answerArray[1][i] < randq =" int(random(3));"> 2) {
state = 5;
endFlag = 1;
}
}
}
// *************************** Home State
if ((state == 1) && (fromEnd == 0)) {
if ((switchval == 0) && (pressedflag == 1)) {
state = 2;
randQ = int(random(3));
}
}
// setting flags for switch pressed
if (switchval == 1) {
pressedflag = 1;
}
else {
pressedflag = 0;
}
}
// *************************** SMILEY MOUTH FUNCTION ***************************
void smileyMouth(int x, int y, int w, int h, int active) {
PImage e, f, g;
e = loadImage("happy-mouth.jpg");
f = loadImage("none-mouth.jpg");
g = loadImage("sad-mouth.jpg");
if ((mouth == "happy") || (active == 0)) {
image(e, x, y, w, h);
}
else if (mouth == "none") {
image(f, x, y, w, h);
}
else if (mouth == "sad") {
image(g, x, y, w, h);
}
}
// *************************** PROGRESS BARS FUNCTION ***************************
void progBars(int answers) {
PImage onbar, offbar;
onbar = loadImage("onbar.jpg");
offbar = loadImage("offbar.jpg");
if (answers < answers ="=" answers ="="> 2) {
image(onbar, 20, 20);
image(onbar, 655, 20);
image(onbar, 1290, 20);
}
}
// *************************** GROUP STATS FUNCTION ***************************
void groupStats(int mPoints, int sPoints, int ePoints, int mTotal, int sTotal, int eTotal) {
int groupBarWidth = 1404;
int groupBarX = 286;
int mY = 388;
int sY = 564;
int eY = 740;
float mSpread = 0;
float sSpread = 0;
float eSpread = 0;
int mPossible, sPossible, ePossible;
int gAdviceX = 286;
int gAdviceY = 1030;
PImage mMarker, sMarker, eMarker;
mMarker = loadImage("green_triangle.png");
sMarker = loadImage("purple_triangle.png");
eMarker = loadImage("orange_triangle.png");
mPossible = mTotal * 2;
sPossible = sTotal * 2;
ePossible = eTotal * 2;
if ((mPoints != 0) && (mPossible != 0)) {
mSpread = float(mPoints) / float(mPossible);
}
if ((sPoints != 0) && (sPossible != 0)) {
sSpread = float(sPoints) / float(sPossible);
}
if ((ePoints != 0) && (ePossible != 0)) {
eSpread = float(ePoints) / float(ePossible);
}
float mOffset = mSpread * float(groupBarWidth);
float sOffset = sSpread * float(groupBarWidth);
float eOffset = eSpread * float(groupBarWidth);
image(mMarker, groupBarX + int(mOffset), mY);
image(sMarker, groupBarX + int(sOffset), sY);
image(eMarker, groupBarX + int(eOffset), eY);
float avSpread = (mSpread + sSpread + eSpread)/3;
if (avSpread > 0.5) {
switch(randGAdvice) {
case 0:
gAdvice = "Your happiness is showing!";
break;
case 1:
gAdvice = "Smiling is contagious.";
break;
case 2:
gAdvice = "Share the joy, it's satisfying.";
break;
}
}
else if (avSpread <= 0.5) { switch(randGAdvice) { case 0: gAdvice = "Happiness can overcome all challenges."; break; case 1: gAdvice = "Happiness equals good health."; break; case 2: gAdvice = "Extract happiness in all things!"; break; } } font = loadFont("Strada-Bold-40.vlw"); // Load font file textFont(font); fill(#000733); //font color textAlign(LEFT); text(gAdvice, gAdviceX, gAdviceY, 1500, 90); }
Saturday, December 26, 2009
Midterm-Taxi Light
Our idea for the project was to create a new taxi light notification system. Here's a diagram of the current system:

After observing many tourists and NYC newcomers waving in confusion at cabs in various states, we decided this is something worth improving with physical computing. We also interviewed several cab drivers to understand the system from their point of view. We found these were the initial problems:
Attached to the light box was a chair meant to simulate the seats of a cab. The chair had a force resistor attached, and when a user sat down the Busy mode would trigger, and when a user got up the Vacant mode would trigger. A few seconds of delay were added before both state changes to allow for users shifting in their seats. This system meant the cab driver would no longer need to manually keep track of (or manipulate) what was going on. The system would be easier for both drivers and passengers to understand. Our first solution worked in the following ways:



The photos show the prototype with a portable florescent bulb inside, because this iteration had several problems with lighting. We first tried wiring into small florescent bulb enclosures to put into the light box. These blew after a few rapid on and off switches. We thought it was the bulbs, so we bought more and tested. Then it turned out the enclosure units were burning out. So we bought more enclosure units and they burned out again. The units couldn't handle the rapid on and off from the wire-to-wire vibration of testing.
We decided to switch to incandescent bulbs and use relays in a circuit to allow AC current from the wall power outlet to flow to the bulbs.
The schematic for this approach:

The code for this approach:
#define RELAY_PIN_ONE 3 //double relay action
#define RELAY_PIN_TWO 4
int relayVal = 0;
int fsrVal = 0; //force-sensitive resistor
int fsrPin = 0;
void setup()
{
pinMode(RELAY_PIN_ONE, OUTPUT);
pinMode(RELAY_PIN_TWO, OUTPUT);
Serial.begin(9600); // open serial
}
void loop(){
fsrVal = analogRead(fsrPin); // read the input pin
// if force resistor is pressed
if(fsrVal > 10){ //sitting
delay(4000);
relayVal = 1;
Serial.println("1");
}
else{ // empty
delay(4000);
relayVal = 0;
Serial.println("2");
}
// switch the relays
if(relayVal == 0){
digitalWrite(RELAY_PIN_TWO, LOW);
digitalWrite(RELAY_PIN_ONE, HIGH);
}
else{
digitalWrite(RELAY_PIN_ONE, LOW);
digitalWrite(RELAY_PIN_TWO, HIGH);
}
}
The 120V AC from the wall overloaded our relays so the current stayed on. Our prototype video shows the timing is working but the relays are overloaded:
http://vimeo.com/7446264
Unfortunately, we did not have time to build a new iteration this semester.

After observing many tourists and NYC newcomers waving in confusion at cabs in various states, we decided this is something worth improving with physical computing. We also interviewed several cab drivers to understand the system from their point of view. We found these were the initial problems:
- Unclear meaning to customers (especially tourists)
- Visually unclear when far away or moving fast
- Drivers often break rules and solicit passengers while “Off Duty”
Attached to the light box was a chair meant to simulate the seats of a cab. The chair had a force resistor attached, and when a user sat down the Busy mode would trigger, and when a user got up the Vacant mode would trigger. A few seconds of delay were added before both state changes to allow for users shifting in their seats. This system meant the cab driver would no longer need to manually keep track of (or manipulate) what was going on. The system would be easier for both drivers and passengers to understand. Our first solution worked in the following ways:
- Easy to see at any distance or speed
- Uses green “Go” and orange “Warning” conventions
- Customers see what they care about - Yes or No
- Taxi company sees details, not customer
- Drivers will not lure customers while “Off Duty”
- Not language agnostic
- Not visible from all sides
- Not as visible in day time



The photos show the prototype with a portable florescent bulb inside, because this iteration had several problems with lighting. We first tried wiring into small florescent bulb enclosures to put into the light box. These blew after a few rapid on and off switches. We thought it was the bulbs, so we bought more and tested. Then it turned out the enclosure units were burning out. So we bought more enclosure units and they burned out again. The units couldn't handle the rapid on and off from the wire-to-wire vibration of testing.
We decided to switch to incandescent bulbs and use relays in a circuit to allow AC current from the wall power outlet to flow to the bulbs.
The schematic for this approach:

The code for this approach:
#define RELAY_PIN_ONE 3 //double relay action
#define RELAY_PIN_TWO 4
int relayVal = 0;
int fsrVal = 0; //force-sensitive resistor
int fsrPin = 0;
void setup()
{
pinMode(RELAY_PIN_ONE, OUTPUT);
pinMode(RELAY_PIN_TWO, OUTPUT);
Serial.begin(9600); // open serial
}
void loop(){
fsrVal = analogRead(fsrPin); // read the input pin
// if force resistor is pressed
if(fsrVal > 10){ //sitting
delay(4000);
relayVal = 1;
Serial.println("1");
}
else{ // empty
delay(4000);
relayVal = 0;
Serial.println("2");
}
// switch the relays
if(relayVal == 0){
digitalWrite(RELAY_PIN_TWO, LOW);
digitalWrite(RELAY_PIN_ONE, HIGH);
}
else{
digitalWrite(RELAY_PIN_ONE, LOW);
digitalWrite(RELAY_PIN_TWO, HIGH);
}
}
The 120V AC from the wall overloaded our relays so the current stayed on. Our prototype video shows the timing is working but the relays are overloaded:
http://vimeo.com/7446264
Unfortunately, we did not have time to build a new iteration this semester.
Tuesday, December 22, 2009
Lab10-Wireless
XBee Breakout Board
The XBee breakout board was soldered with male headers on one side and female sockets on the other. The XBee was then mounted to the breakout board, which in turn was mounted to the breadboard.

XBee Connections
The XBee was connected to 3.3V power and ground. The XBee DOUT was connected to Arduino RX, and the XBee DIN was connected to Arduino TX.
Switch Input
A momentary switch and 10K Ohm pull down resistor were added between power and Arduino digital input 2.

Buzzer Output
A speaker was connected to work as a buzzer between Arduino digital pin 5 and ground.

Configure XBees
Both XBee radios were configured with the XBeeConfigTerminal software. Using ATID, ATMY, and ATDL commands, the radios were paired reciprocally.
Program the Arduino Doorbell
The provided code was uploaded to both Arduino boards. When the momentary switch was pressed, the speaker outputted a tone. This verified the wireless connection was made.
Program the Arduino Feedback Doorbell
An LED and 200 Ohm resistor were added to the Switch Input board. The provided code was uploaded to both boards. The updated code allowed the newly added LED to light up when the Buzzer board received a signal and replied. This was tested and confirmed.
The XBee breakout board was soldered with male headers on one side and female sockets on the other. The XBee was then mounted to the breakout board, which in turn was mounted to the breadboard.

XBee Connections
The XBee was connected to 3.3V power and ground. The XBee DOUT was connected to Arduino RX, and the XBee DIN was connected to Arduino TX.
Switch Input
A momentary switch and 10K Ohm pull down resistor were added between power and Arduino digital input 2.

Buzzer Output
A speaker was connected to work as a buzzer between Arduino digital pin 5 and ground.

Configure XBees
Both XBee radios were configured with the XBeeConfigTerminal software. Using ATID, ATMY, and ATDL commands, the radios were paired reciprocally.
Program the Arduino Doorbell
The provided code was uploaded to both Arduino boards. When the momentary switch was pressed, the speaker outputted a tone. This verified the wireless connection was made.
Program the Arduino Feedback Doorbell
An LED and 200 Ohm resistor were added to the Switch Input board. The provided code was uploaded to both boards. The updated code allowed the newly added LED to light up when the Buzzer board received a signal and replied. This was tested and confirmed.
Wednesday, November 18, 2009
Lab9-Serial
Connect a Potentiometer:
A potentiometer was connected to power and ground, and the middle wire was connected to Arduino analog input pin 0.
Send Serial Output:
The provided code was uploaded to the Arduino board.
Check Serial Output:
When turning the potentiometer, the range of ASCII values scrolled through in the serial monitor.
Make a Graph:
The provided code was entered into Processing.
Results:
When turning the potentiometer, the graph fluctuated up and down accordingly.
A potentiometer was connected to power and ground, and the middle wire was connected to Arduino analog input pin 0.
Send Serial Output:
The provided code was uploaded to the Arduino board.
Check Serial Output:
When turning the potentiometer, the range of ASCII values scrolled through in the serial monitor.
Make a Graph:
The provided code was entered into Processing.
Results:
When turning the potentiometer, the graph fluctuated up and down accordingly.
Lab8-Motors
Connect Power from Arduino to Breadboard:
Using the conventional red and black wires, the Arduino power and ground pins were connected to both sides of the breadboard.
Add a Potentiometer:
A potentiometer was hooked up to power and ground, and the middle wire was connected to Arduino analog pin 0.
Add a Motor:
Wires were soldered to the 2 contacts of a small motor. One wire was then connected to power, and the other to the center collector pin of a TIP120 transistor. The output leg of an LED was hooked up to the same TIP120 collector pin to prevent "blowback" current from causing a short circuit.
The base pin of the TIP120 was connected to a 1K ohm resistor, which was then connected to Arduino digital pin 9. The emitter pin of the TIP120 was connected to ground. To reduce circuit noise, a 10µF capacitor was placed between the power and ground rails of the breadboard.

Controlling Speed:
The provided code was uploaded to the Arduino board, and the motor spun according to the potentiometer's input value.
Add a Switch:
All components were removed except the power wiring and the motor. An SPST switch was connected to power and a 10K Ohm resistor going to ground. Arduino digital pin 2 was then wired to the node where the resistor and switch are connected.
Add an H-Bridge:
The H-Bridge was connected as follows:
Pin 16 to power
Pin 8 to power
Pin 1 to power
Pins 4, 5, 12, 13 to ground
Pin 2 to Arduino digital pin 3
Pin 7 to Arduino digital pin 7
Pin 3 to motor pin
Pin 6 to other motor pin
Pin 9 to Arduino digital pin 9

Controlling Direction:
The provided code was uploaded to the Arduino board. The switch toggled the direction the motor spun.
Using the conventional red and black wires, the Arduino power and ground pins were connected to both sides of the breadboard.
Add a Potentiometer:
A potentiometer was hooked up to power and ground, and the middle wire was connected to Arduino analog pin 0.
Add a Motor:
Wires were soldered to the 2 contacts of a small motor. One wire was then connected to power, and the other to the center collector pin of a TIP120 transistor. The output leg of an LED was hooked up to the same TIP120 collector pin to prevent "blowback" current from causing a short circuit.
The base pin of the TIP120 was connected to a 1K ohm resistor, which was then connected to Arduino digital pin 9. The emitter pin of the TIP120 was connected to ground. To reduce circuit noise, a 10µF capacitor was placed between the power and ground rails of the breadboard.

Controlling Speed:
The provided code was uploaded to the Arduino board, and the motor spun according to the potentiometer's input value.
Add a Switch:
All components were removed except the power wiring and the motor. An SPST switch was connected to power and a 10K Ohm resistor going to ground. Arduino digital pin 2 was then wired to the node where the resistor and switch are connected.
Add an H-Bridge:
The H-Bridge was connected as follows:
Pin 16 to power
Pin 8 to power
Pin 1 to power
Pins 4, 5, 12, 13 to ground
Pin 2 to Arduino digital pin 3
Pin 7 to Arduino digital pin 7
Pin 3 to motor pin
Pin 6 to other motor pin
Pin 9 to Arduino digital pin 9

Controlling Direction:
The provided code was uploaded to the Arduino board. The switch toggled the direction the motor spun.
Lab7-Programming 2
ClintBeharry-Shape: http://leftrightoutput.com/sva/physicalcomputing/prog2/1Shape/
ClintBeharry-Swatches: http://leftrightoutput.com/sva/physicalcomputing/prog2/2Swatches/
ClintBeharry-Character: http://leftrightoutput.com/sva/physicalcomputing/prog2/3Character/
ClintBeharry-Animation: http://leftrightoutput.com/sva/physicalcomputing/prog2/4Animation/
ClintBeharry-SquareLights: http://leftrightoutput.com/sva/physicalcomputing/prog2/5SquareLights/
ClintBeharry-ColorSwapper: http://leftrightoutput.com/sva/physicalcomputing/prog2/6ColorSwapper/
ClintBeharry-Racetrack: http://leftrightoutput.com/sva/physicalcomputing/prog2/7Racetrack/
ClintBeharry-Bounce: http://leftrightoutput.com/sva/physicalcomputing/prog2/8Bounce/
ClintBeharry-Snowman: http://leftrightoutput.com/sva/physicalcomputing/prog2/9Snowman/
ClintBeharry-MyFunction: http://leftrightoutput.com/sva/physicalcomputing/prog2/10MyFunction/
ClintBeharry-SharedFunction: http://leftrightoutput.com/sva/physicalcomputing/prog2/11SharedFunction/
ClintBeharry-AnimatedWorld: Same as MyFunction (explained in comments in MyFunction)
ClintBeharry-Swatches: http://leftrightoutput.com/sva/physicalcomputing/prog2/2Swatches/
ClintBeharry-Character: http://leftrightoutput.com/sva/physicalcomputing/prog2/3Character/
ClintBeharry-Animation: http://leftrightoutput.com/sva/physicalcomputing/prog2/4Animation/
ClintBeharry-SquareLights: http://leftrightoutput.com/sva/physicalcomputing/prog2/5SquareLights/
ClintBeharry-ColorSwapper: http://leftrightoutput.com/sva/physicalcomputing/prog2/6ColorSwapper/
ClintBeharry-Racetrack: http://leftrightoutput.com/sva/physicalcomputing/prog2/7Racetrack/
ClintBeharry-Bounce: http://leftrightoutput.com/sva/physicalcomputing/prog2/8Bounce/
ClintBeharry-Snowman: http://leftrightoutput.com/sva/physicalcomputing/prog2/9Snowman/
ClintBeharry-MyFunction: http://leftrightoutput.com/sva/physicalcomputing/prog2/10MyFunction/
ClintBeharry-SharedFunction: http://leftrightoutput.com/sva/physicalcomputing/prog2/11SharedFunction/
ClintBeharry-AnimatedWorld: Same as MyFunction (explained in comments in MyFunction)
Lab6-Analog Output
Connect Power from Arduino to Breadboard:
Using the conventional red and black wires, the Arduino power and ground pins were connected to both sides of the breadboard.
Servo and Sensor:
A potentiometer was connected to the Arduino input pin 0. The servo motor was connected to power and ground, and the 3rd wire (orange) was connected to the Arduino digital pin 9.

Programming:
The provided coded was loaded to the Arduino board. The servo motor mapped from 0 to (almost) 180 degrees, as the potentiometer value shifted from 0 to 1023.
Speaker Setup:
The servo motor was removed from the circuit. A speaker was connected to ground, and the other end was connected to a resistor, which in turn was connected to the Arduino digital pin 8.

Tone Library:
The Tone library was downloaded from the Arduino website and installed into the Arduino libraries folder. The provided code was then loaded to the Arduino board, and the speaker tone output responded to the potentiometer input.
Create Something Unique:
Using the servo motor attached to a lever (chopstick), a target sign was attached to the end of the lever to oscillate back and forth. The target sign had a small hole in the center for a photoresistor.
The photoresistor value was read as input into the Arduino code, and if the light value was high enough the servo motor was activated to move along its oscillation. A NERF gun was outfitted with a flashlight scope to shine a light where the gun was aimed. With these components in place, an impossible target system was created. Once the gun was aimed at the target, the target would move away.
Video: http://www.youtube.com/watch?v=1jFErmvWepQ
Using the conventional red and black wires, the Arduino power and ground pins were connected to both sides of the breadboard.
Servo and Sensor:
A potentiometer was connected to the Arduino input pin 0. The servo motor was connected to power and ground, and the 3rd wire (orange) was connected to the Arduino digital pin 9.

Programming:
The provided coded was loaded to the Arduino board. The servo motor mapped from 0 to (almost) 180 degrees, as the potentiometer value shifted from 0 to 1023.
Speaker Setup:
The servo motor was removed from the circuit. A speaker was connected to ground, and the other end was connected to a resistor, which in turn was connected to the Arduino digital pin 8.

Tone Library:
The Tone library was downloaded from the Arduino website and installed into the Arduino libraries folder. The provided code was then loaded to the Arduino board, and the speaker tone output responded to the potentiometer input.
Create Something Unique:
Using the servo motor attached to a lever (chopstick), a target sign was attached to the end of the lever to oscillate back and forth. The target sign had a small hole in the center for a photoresistor.
The photoresistor value was read as input into the Arduino code, and if the light value was high enough the servo motor was activated to move along its oscillation. A NERF gun was outfitted with a flashlight scope to shine a light where the gun was aimed. With these components in place, an impossible target system was created. Once the gun was aimed at the target, the target would move away.
Video: http://www.youtube.com/watch?v=1jFErmvWepQ
Wednesday, October 7, 2009
Lab5-Programming with Processing
ClintBeharry-Structure: http://leftrightoutput.com/sva/physicalcomputing/1Structure/
ClintBeharry-First: http://leftrightoutput.com/sva/physicalcomputing/2First/
ClintBeharry-FormColor: http://leftrightoutput.com/sva/physicalcomputing/3FormColor/
ClintBeharry-Albers: http://leftrightoutput.com/sva/physicalcomputing/4Albers/
ClintBeharry-Paintbrush: http://leftrightoutput.com/sva/physicalcomputing/5Paintbrush/
ClintBeharry-Mousebrush: http://leftrightoutput.com/sva/physicalcomputing/6Mousebrush/
ClintBeharry-Area: http://leftrightoutput.com/sva/physicalcomputing/7Area/
ClintBeharry-Final: http://leftrightoutput.com/sva/physicalcomputing/8Final/
ClintBeharry-Bonus: http://leftrightoutput.com/sva/physicalcomputing/9Bonus/
ClintBeharry-First: http://leftrightoutput.com/sva/physicalcomputing/2First/
ClintBeharry-FormColor: http://leftrightoutput.com/sva/physicalcomputing/3FormColor/
ClintBeharry-Albers: http://leftrightoutput.com/sva/physicalcomputing/4Albers/
ClintBeharry-Paintbrush: http://leftrightoutput.com/sva/physicalcomputing/5Paintbrush/
ClintBeharry-Mousebrush: http://leftrightoutput.com/sva/physicalcomputing/6Mousebrush/
ClintBeharry-Area: http://leftrightoutput.com/sva/physicalcomputing/7Area/
ClintBeharry-Final: http://leftrightoutput.com/sva/physicalcomputing/8Final/
ClintBeharry-Bonus: http://leftrightoutput.com/sva/physicalcomputing/9Bonus/
Tuesday, October 6, 2009
Assignment1-Imagined Physical Computing
For my assignment I decided to address the unpredictability, delays, and overall lack of prompt information when using the NYC subway system (though this project could be applied to many other transit systems). My project is an E-Ink Touch Interactive GPS Map hopefully possible withing the next decade.
The map is foldable and similar in size to current subway maps. When the map is open, all running trains are color-coded and visible with low visual priority (low opacity). When a subway station is touched, all approaching trains are given higher priority (high opacity).

Seeing all approaching trains, the user can touch the station and an upcoming train and see the arrival time.

The user can repeat the action with another approaching train and compare the arrival times. This informs the user which train to take and which subway platform to wait on.

In this example, the user notices the yellow R train has stopped moving. The user can touch the R train and see the cause of the delay.

The user can then update their plans accordingly. While waiting on trains, the user can also touch and hold a station to learn more about the station with relevant information like announcements, factoids, and history.
The map is foldable and similar in size to current subway maps. When the map is open, all running trains are color-coded and visible with low visual priority (low opacity). When a subway station is touched, all approaching trains are given higher priority (high opacity).

Seeing all approaching trains, the user can touch the station and an upcoming train and see the arrival time.

The user can repeat the action with another approaching train and compare the arrival times. This informs the user which train to take and which subway platform to wait on.

In this example, the user notices the yellow R train has stopped moving. The user can touch the R train and see the cause of the delay.

The user can then update their plans accordingly. While waiting on trains, the user can also touch and hold a station to learn more about the station with relevant information like announcements, factoids, and history.
Wednesday, September 30, 2009
Lab4-Analog Input
Connect Power from Arduino to Breadboard:
A red wire was connected from the 5V power output of the Arduino to the power column of the breadboard. A black wire was connected from the ground input of the Arduino to the breadboard's ground column. Red and black wires were then connected across the breadboard from power and ground columns to the opposite side power and ground columns.
Potentiometer Input:
A potentiometer was connected to the breadboard's power and ground, and the middle pin was connected to the Analog input pin 3 on the Arduino board.

Add an LED for PWM Output:
A wire was connected from the PWM Digital output pin 9 on the Arduino board to a 330 Ohm resistor on the breadboard. The other side of the resistor was connected to an LED, which in turn was connected to ground.

Load a Program to Control the Arduino:
The provided code was loaded on to the Arduino board. The potentiometer was twisted and the values on the serial output fluctuated accordingly. The LED faded brighter and dimmer as the potentiometer resistance was raised and lowered.
Try other Variable Resistors:
A thermistor was connected to the breadboard's power supply, and the other end was connected to a 10K Ohm resistor. The other end of the 10K Ohm resistor was then connected to ground. This was done to create a voltage divider in the circuit. A wire was connected at the junction between the thermistor and 10K Ohm resistor and connected to the Arduino board analog input pin 3. This was done to sense the changes in voltage in the serial output window.
When a 1K Ohm resistor was inserted in place of the 10K Ohm resistor, the serial output reading rose. This is due to the Ohm's Law ratio changing.
Invent Something:
I decided to create an exhibit of how one aspect of vision works. The rod and cone photoreceptor cells on the retina surface respond to darkness and light(& color) respectively. I simulated this by hooking up a photoresistor to the circuit, and splitting the resulting varied voltage across 2 LED's. When a light shone into the photoresistor, the LED representing the cone cell lit up. When the photoresistor received no light, the LED representing the rod cell lit up.
Here's a video demonstration:
http://www.youtube.com/watch?v=oR5DAbMoOi8
A red wire was connected from the 5V power output of the Arduino to the power column of the breadboard. A black wire was connected from the ground input of the Arduino to the breadboard's ground column. Red and black wires were then connected across the breadboard from power and ground columns to the opposite side power and ground columns.
Potentiometer Input:
A potentiometer was connected to the breadboard's power and ground, and the middle pin was connected to the Analog input pin 3 on the Arduino board.

Add an LED for PWM Output:
A wire was connected from the PWM Digital output pin 9 on the Arduino board to a 330 Ohm resistor on the breadboard. The other side of the resistor was connected to an LED, which in turn was connected to ground.

Load a Program to Control the Arduino:
The provided code was loaded on to the Arduino board. The potentiometer was twisted and the values on the serial output fluctuated accordingly. The LED faded brighter and dimmer as the potentiometer resistance was raised and lowered.
Try other Variable Resistors:
A thermistor was connected to the breadboard's power supply, and the other end was connected to a 10K Ohm resistor. The other end of the 10K Ohm resistor was then connected to ground. This was done to create a voltage divider in the circuit. A wire was connected at the junction between the thermistor and 10K Ohm resistor and connected to the Arduino board analog input pin 3. This was done to sense the changes in voltage in the serial output window.
When a 1K Ohm resistor was inserted in place of the 10K Ohm resistor, the serial output reading rose. This is due to the Ohm's Law ratio changing.
Invent Something:
I decided to create an exhibit of how one aspect of vision works. The rod and cone photoreceptor cells on the retina surface respond to darkness and light(& color) respectively. I simulated this by hooking up a photoresistor to the circuit, and splitting the resulting varied voltage across 2 LED's. When a light shone into the photoresistor, the LED representing the cone cell lit up. When the photoresistor received no light, the LED representing the rod cell lit up.
Here's a video demonstration:
http://www.youtube.com/watch?v=oR5DAbMoOi8
Tuesday, September 22, 2009
Lab3-Electronics
Measuring Voltage:
The Voltage Regulator 7805 was wired to the breadboard. The power jack was then soldered to wiring and connected it to the Voltage Regulator. The voltage through the circuit was tested and proved to be a regulated 5V.

Basic Circuit:
The circuit was rewired to set up a momentary switch, LED, and resistor in series. When the momentary switch was pressed the LED lit up. The multimeter was used to test the required voltage measurements:
+ Voltage across the switch when closed: 0V
+ Voltage across LED: 2V
+ Voltage across resistor: 1.76V


Series:
The momentary switch and resistor were removed from the circuit. Two LEDs were set up in series and they lit up when the power supply was connected to the power jack. The voltage was tested at various points in the circuit:
+ Voltage across each resistor: 2.51 V
+ Voltage across full circuit: 5.03 V
No resistors are needed in this circuit because each LED uses half the voltage and there is no excess voltage to burn out the LED.

Parallel:
The circuit was rewired to set up three resistors in parallel followed by a resistor in series. The voltage across each resistor was 1.92V. The multimeter was placed in series with the circuit and the current reading was 8.36mA.

Varying Voltage:
Three wires were soldered to the potentiometer. The circuit was rewired to set up a resistor and LED in series. The potentiometer was adjusted and the following voltages and LED behavior were observed:
+ Max voltage on potentiometer: 3.61V - Brightest LED
+ High voltage on potentiometer: 2.11V - Less bright LED
+ Low voltage on potentiometer: 1.68V - Dim LED
+ Minimum voltage on potentiometer: 0V - No light LED
The Voltage Regulator 7805 was wired to the breadboard. The power jack was then soldered to wiring and connected it to the Voltage Regulator. The voltage through the circuit was tested and proved to be a regulated 5V.

Basic Circuit:
The circuit was rewired to set up a momentary switch, LED, and resistor in series. When the momentary switch was pressed the LED lit up. The multimeter was used to test the required voltage measurements:
+ Voltage across the switch when closed: 0V
+ Voltage across LED: 2V
+ Voltage across resistor: 1.76V


Series:
The momentary switch and resistor were removed from the circuit. Two LEDs were set up in series and they lit up when the power supply was connected to the power jack. The voltage was tested at various points in the circuit:
+ Voltage across each resistor: 2.51 V
+ Voltage across full circuit: 5.03 V
No resistors are needed in this circuit because each LED uses half the voltage and there is no excess voltage to burn out the LED.

Parallel:
The circuit was rewired to set up three resistors in parallel followed by a resistor in series. The voltage across each resistor was 1.92V. The multimeter was placed in series with the circuit and the current reading was 8.36mA.

Varying Voltage:
Three wires were soldered to the potentiometer. The circuit was rewired to set up a resistor and LED in series. The potentiometer was adjusted and the following voltages and LED behavior were observed:
+ Max voltage on potentiometer: 3.61V - Brightest LED
+ High voltage on potentiometer: 2.11V - Less bright LED
+ Low voltage on potentiometer: 1.68V - Dim LED
+ Minimum voltage on potentiometer: 0V - No light LED
Tuesday, September 15, 2009
Lab2-Digital Input & Output
I went through Chapters 3 & 4 in Getting Started With Arduino. I coded all examples and learned step-by-step what each program was doing.
In particular, I found the idea of adding delays to counter the circuit's refresh rate to be an interesting concept.
I recorded videos for "Blink an LED", "Control an LED with a momentary switch", and "Improve control to make the switch usable".
For "Build a Switch" I decided to use a NERF gun and shoot a bull's-eye. The back side of the bull's-eye had a coiled wire attached. A 2nd layer behind the bull's-eye had a circle of foil attached to another wire. When the NERF bullet hits the target, the impact causes both layers to connect and transmit current. I coded the LED to blink 5 times rapidly and then stop as a sign of success! I recorded a video of the switch in action.
All videos are in reverse chronological order here (click backwards through the videos):
http://robo.to/clintbeharry
In particular, I found the idea of adding delays to counter the circuit's refresh rate to be an interesting concept.
I recorded videos for "Blink an LED", "Control an LED with a momentary switch", and "Improve control to make the switch usable".
For "Build a Switch" I decided to use a NERF gun and shoot a bull's-eye. The back side of the bull's-eye had a coiled wire attached. A 2nd layer behind the bull's-eye had a circle of foil attached to another wire. When the NERF bullet hits the target, the impact causes both layers to connect and transmit current. I coded the LED to blink 5 times rapidly and then stop as a sign of success! I recorded a video of the switch in action.
All videos are in reverse chronological order here (click backwards through the videos):
http://robo.to/clintbeharry
Lab1-Soldering
I started by stripping the ends of two wires to allow for a conductive attachment to the switch. I then soldered the two wire ends to the switch. This was a straightforward process but the wire and switch pieces took longer than expected to heat up and melt the solder. I'm looking forward to practicing more soldering!
I completed the Soldering Lab and tested my switch connections. The wires were sturdily attached and the Multimeter reading proved conductance.
I completed the Soldering Lab and tested my switch connections. The wires were sturdily attached and the Multimeter reading proved conductance.
Subscribe to:
Comments (Atom)