Archive by Author

Final Project – Garrett Jensen & Olivia Coughlin

22 Dec

 

 

 

DSC_0249DSC_0253DSC_0257DSC_0268DSC_0277DSC_0292DSC_0299

After much deliberation and phases of design, Garrett and I were able to pull something together that

was both challenging and enjoyable to accomplish. Beginning with many different sustainable designs

for residential homes, we finally landed on a design for opening and closing window treatments. The

drapes went through multiple phases from a precedent consisting of string, to elastic fabric, then rubber

bands, to cloth bands, then finally back to elastic fabric.

One large piece of spandex material covered three ceiling to floor windows with four horizontal slits

across each window pane. Installing two servo motors hidden within the window mullions allow for

discreet, hands-free drape movement. We created a code for the dual servo motors to move 180

degrees simultaneously in a loop. Connected to thread and looped through small eyelets along the

ceiling and back down to the servo motors, the slits in the fabric have the ability to open and close

depending on the position of the servo motors.

The servo motors are on double loop per day rotation in which they rotate 180 degrees and then back

180 degrees. This motion is in synchronized with the time of day in order to open the drapes fullest

when the sun is at high noon, thus less direct sunlight through the windows and more ambient light.

Another idea we were thinking about installing is drape movement dependent on the twisting of a

potentiometer where the openness of the drapes would be user-controlled and interactive. This would

be simple reconstruction and code change.

We designed this mechanical circuit for the sustainability it can produce. With the ability to control the

daylighting in a home, this would be an energy-efficient product that would take advantage of natural

light at the perfect times. Though the final product could be tweaked to be even more functional and

aesthetic, it is a good starting point for what we were invisioning.

Code:

#include <Servo.h>

Servo myservo; // create servo object to control a servo
Servo myservo2;
int potpin = 0; // analog pin used to connect the potentiometer
int val;
int pos = 0;
int buttonPin = 2;
int buttonState = 0;// variable to read the value from the analog pin

void setup()
{ pinMode(buttonPin, INPUT);
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo2.attach(10);
}

void loop() {
buttonState = digitalRead(buttonPin);
if(buttonState == 1) {
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
myservo2.write(180-val);
delay(15);
}

else {
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
myservo2.write(pos);
delay(20); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable ‘pos’
myservo2.write(pos);
delay(20); // waits 15ms for the servo to reach the position
}
}
}

Final Project Proposal – Kinetic Architecture – Garrett Jensen & Olivia Coughlin

2 Dec

Description:

Our project will use kinetic architecture using the idea of the roof to catch rain water for other uses such as for toilet water or for storage as backup water. Our project will be a simple structure such as a (8 in x 8 in) box with a roof sloop peaking at 3 inches. We will use a moisture resistor on one panel of the roof that will represent the structure getting hit with rain. When the resistor is activated, a servo motor connected by four pulleys, one connecting to each corner, will also be activated pulling the pulleys causing metal rods in each corner to raise and slope the roof downwards where the water will be collected in a container used to dispense into toilets or various other water related appliances within the household.

1476131_3256048557178_1891703384_n

 

Materials:

Laptop, arduino, servo motor, moisture resistor, bread board, wires, arduino/processing software

3 MDF facades, 4 metal roof panels, 1 water catching contraption, 4 retractable metal rods, string for pulleys

Schedule:

Dec 3 – 4

Finalize details and materials needed

Buy materials and begin constructing structure

Dec 5-10

Writing code, testing,  tweaking, troubleshooting

Complete final structure

 

Homework 06 – Chain Reaction 1 – Garrett Jensen & Olivia Coughlin

26 Nov

Using both of our arduino boards to interact with each other we set an led to the fading code and added a potentiometer to adjust the brightness of the led as well

Code:

int ledPin = 9; // LED connected to digital pin 9

void setup() {
// nothing happens in setup
}

void loop() {
// fade in from min to max in increments of 5 points:
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}

// fade out from max to min in increments of 5 points:
for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
}

 

Homework 05 – Arduino & Processing – Garrett Jensen

14 Nov

Processing Code:

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()[9], 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(255, 128 ,0 );// 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(0);
}
else {
// increment the horizontal position:
xPos++;
}
}
}

 

Homework 04 – Combine Circuits – Garrett Jensen

5 Nov

I used the servo motor set combined with a led using a simple blink. I set the servo motor to use the fading code we learned to use with an LED in class and combined it with a simple LED blink. I tried to add various third components such as the potentiometer or the motion sensor but was unable to get all three to work together.

My Code:

int ledPin = 9; // LED connected to digital pin 9
int led = 6; // LED connected to digital pin 6

void setup() {
pinMode(led, OUTPUT);
}

void loop() {
// fade in from min to max in increments of 5 points:
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}

// fade out from max to min in increments of 5 points:
for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
digitalWrite(led, HIGH); // turning on LED
delay(1000); // keeping LED on for 1 second
digitalWrite(led, LOW); turning off LED
delay(1000); // keeping LED off for 1 second
}

Homework 03 – Server Motor Controlled by Variable Resistor – Garrett Jensen

31 Oct

Like other posts I too used the photoresistor (LDR) to control the speed of the LED lights that had been set in a sequence as well as the movement of the servo motor.

My Code:

#include <Servo.h>

Servo myservo; // create servo object to control a servo

int blue = 5; // setting blue LED to pin 5
int green = 6; // setting green LED to pin 6
int potpin = 0; // analog pin used to connect the photoresistor
int val; // variable to read the value from the analog pin

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
pinMode(blue, OUTPUT); // blue light output
pinMode(green, OUTPUT); // green light output
}

void loop()
{
val = analogRead(potpin); // reads the value of the photoresistor (value between 0 and 1023)
val = map(val, 0, 200, 0, 500); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there

potpin = (analogRead (A0));

digitalWrite(blue, HIGH); //turns blue light on

delay(potpin); //holds blue light on for period determined by photoresistor

digitalWrite(blue, LOW); //turns blue light off

delay(potpin);//holds blue light off for period determined by photoresistor

digitalWrite(blue, HIGH);//turns blue light on

delay(potpin); //holds blue light on for period determined by photoresistor

digitalWrite(blue, LOW); //turns blue light off

delay(potpin); //holds blue light off for period determined by photoresistor

digitalWrite(green, HIGH); //turns green light on

delay(potpin); //holds green light on for period determined by photoresistor

digitalWrite(green, LOW); //turns green light off

delay(potpin); //holds green light off for period determined by potentiometer }

}

Homework 02 — Create an LED Arduino Code — Garrett Jensen

28 Oct

Using the San Jose Sharks goal horn and song I tried to match the lights to light at the same time at distinct moments.

The code I used is:

int blue = 3;
int green = 5;
int red = 6;

void setup() {
pinMode(blue, OUTPUT);
pinMode(green, OUTPUT);
pinMode(red, OUTPUT);
}

void loop() {
digitalWrite(red, HIGH); // turn red light on (goal horn)
delay(4000); // red light stays on for 4 seconds
digitalWrite(red, LOW); // turn red light off
delay(3000); // red light stays off for 3 seconds
digitalWrite(red, HIGH); // turn red light on (goal horn)
delay(3000); // red light stays on for 3 seconds
digitalWrite(red, LOW); // turn red light off
delay(11000); // red light stays off or 11 seconds (music)
digitalWrite(blue, HIGH); // turn blue light on
delay(1000); // blue light stays on for 1 second (“hey”)
digitalWrite(blue, LOW); // turn blue light off
delay(2000); // blue light stays off for 2 seconds
digitalWrite(blue, HIGH); // turn blue light on (“hey”)
delay(1000); // blue light stays on for 1 second
digitalWrite(blue, LOW); // turn blue light off
delay(3000); // blue light stays off for 3 seconds
digitalWrite(blue, HIGH); // turn blue light on (“hey”)
delay(1000); // blue light stays on for 1 second
digitalWrite(blue, LOW); // turn blue light off
delay(3000); // blue light stays off for 3 seconds
digitalWrite(red, HIGH); // turn red light on
delay(1000); // red light stays on for 1 second
digitalWrite(blue, HIGH); // turn blue light on
delay(1000); // blue light stays on for 1 second
digitalWrite(green, HIGH); // turn green light on
delay(1000); // green light stays on for 1 second
digitalWrite(red, LOW); // turn red light off
delay(10000); // red light stays off for 10 seconds
digitalWrite(green, LOW); // turn green light off
delay(10000); // green light stays off for 10 seconds
digitalWrite(blue, LOW); // turn blue light off
delay(10000); // blue light stays off for 10 seconds
}