As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.
Sunday, June 15, 2014
Coding by Freistadt/Hart
#include <Adafruit_NeoPixel.h>
#include <SharpIR.h>
#include <DistanceGP2Y0A21YK.h> // LINEAR SENSOR LIBRARY ADD
DistanceGP2Y0A21YK Dist; // LINEAR SENSOR LIBRARY ADD
int distance; // LINEAR SENSOR LIBRARY ADD
#define PIN 6
#define ir A0
#define model 1080
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);
SharpIR sharp(ir, 25, 93, model);
/*
ir: the pin where your sensor is attached
25: the number of readings the library will make before calculating a mean distance
93: the difference between two consecutive measurements to be taken as valid
model: an int that determines your sensor: 1080 for GP2Y0A21Y
*/
void setup()
{
Serial.begin(9600);
pinMode (ir, INPUT);
Dist.begin(A0); // LINEAR SENSOR LIBRARY ADD
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop()
{
int dis=sharp.distance(); // this returns the distance to the object you're measuring
distance = Dist.getDistanceCentimeter(); // LINEAR SENSOR LIBRARY ADD
Serial.print("Distance in centimers: "); // LINEAR SENSOR LIBRARY ADD
Serial.print(distance); // LINEAR SENSOR LIBRARY ADD
Serial.print(" // Mean distance: "); // returns it to the serial monitor
Serial.println(dis); // print distance
dis = map(dis, 0, 130, 0, 230); // convert range to color value
if(dis >= 0 && dis <= 220) { // if distance is in range
colorWipe(strip.Color(255-dis, 255-dis, 255-dis)); // White lights based off proximity sensivity
} else {
colorWipe(strip.Color(0, 0, 0)); // Nothing
}
}
void colorWipe(uint32_t c) { // function to control NeoPixels
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
}
strip.show();
}
Friday, June 13, 2014
Anjelica Harlow . Processing
/**
* Reach 3.
* Based on code from Keith Peters (www.bit-101.com)
*
* The arm follows the position of the ball by
* calculating the angles with atan2().
*/
int numSegments = 6;
float[] x = new float[numSegments];
float[] y = new float[numSegments];
float[] angle = new float[numSegments];
float segLength = 50; //lengthens/shortens arm-ajh
float targetX, targetY;
float ballX = 50;
float ballY = 50;
int ballXDirection = 1;
int ballYDirection = -1;
void setup() {
size(500, 500); //change size from 200 to 500-ajh
smooth();
strokeWeight(20.0);
stroke(0, 100);
noFill();
x[x.length-1] = width/2; // Set base x-coordinate
y[x.length-2] = height; // Set base y-coordinate //moves from bottom to top by making integer larger than 2-ajh
}
void draw() {
background(250); //color changed to white from grey-ajh
strokeWeight(20);
ballX = ballX + 1.0 * ballXDirection;
ballY = ballY + 0.8 * ballYDirection;
if(ballX > width-25 || ballX < 25) {
ballXDirection *= -1;
}
if(ballY > height-25 || ballY < 25) {
ballYDirection *= -1;
}
ellipse(ballX, ballY, 60,60); //1st (,) movement, 2nd (,)changes lg. width -ajh
reachSegment(0, ballX, ballY); //keeps last segment centered on ball
for(int i=1; i<numSegments; i++) {
reachSegment(i, targetX, targetY);
}
for(int i=x.length-1; i>=1; i--) {
positionSegment(i, i-1);
}
for(int i=0; i<x.length; i++) {
segment(x[i], y[i], angle[i], (i+1)*2);
}
}
void positionSegment(int a, int b) {
x[b] = x[a] + cos(angle[a]) * segLength;
y[b] = y[a] + sin(angle[a]) * segLength;
}//keeps segments together and orderly
void reachSegment(int i, float xin, float yin) {
float dx = xin - x[i];
float dy = yin - y[i];
angle[i] = atan2(dy, dx);
targetX = xin - cos(angle[i]) * segLength;
targetY = yin - sin(angle[i]) * segLength;
}
void segment(float x, float y, float a, float sw) {
strokeWeight(sw);
pushMatrix();
translate(x, y);
rotate(a);
line(0, 0, segLength, 0);
popMatrix();
}
* Reach 3.
* Based on code from Keith Peters (www.bit-101.com)
*
* The arm follows the position of the ball by
* calculating the angles with atan2().
*/
int numSegments = 6;
float[] x = new float[numSegments];
float[] y = new float[numSegments];
float[] angle = new float[numSegments];
float segLength = 50; //lengthens/shortens arm-ajh
float targetX, targetY;
float ballX = 50;
float ballY = 50;
int ballXDirection = 1;
int ballYDirection = -1;
void setup() {
size(500, 500); //change size from 200 to 500-ajh
smooth();
strokeWeight(20.0);
stroke(0, 100);
noFill();
x[x.length-1] = width/2; // Set base x-coordinate
y[x.length-2] = height; // Set base y-coordinate //moves from bottom to top by making integer larger than 2-ajh
}
void draw() {
background(250); //color changed to white from grey-ajh
strokeWeight(20);
ballX = ballX + 1.0 * ballXDirection;
ballY = ballY + 0.8 * ballYDirection;
if(ballX > width-25 || ballX < 25) {
ballXDirection *= -1;
}
if(ballY > height-25 || ballY < 25) {
ballYDirection *= -1;
}
ellipse(ballX, ballY, 60,60); //1st (,) movement, 2nd (,)changes lg. width -ajh
reachSegment(0, ballX, ballY); //keeps last segment centered on ball
for(int i=1; i<numSegments; i++) {
reachSegment(i, targetX, targetY);
}
for(int i=x.length-1; i>=1; i--) {
positionSegment(i, i-1);
}
for(int i=0; i<x.length; i++) {
segment(x[i], y[i], angle[i], (i+1)*2);
}
}
void positionSegment(int a, int b) {
x[b] = x[a] + cos(angle[a]) * segLength;
y[b] = y[a] + sin(angle[a]) * segLength;
}//keeps segments together and orderly
void reachSegment(int i, float xin, float yin) {
float dx = xin - x[i];
float dy = yin - y[i];
angle[i] = atan2(dy, dx);
targetX = xin - cos(angle[i]) * segLength;
targetY = yin - sin(angle[i]) * segLength;
}
void segment(float x, float y, float a, float sw) {
strokeWeight(sw);
pushMatrix();
translate(x, y);
rotate(a);
line(0, 0, segLength, 0);
popMatrix();
}
Anjelica Harlow . Knolling
For the knolling project I brought back a coffee pot. I was surprised how simplistic the coffee pot was. I don't know why, but I imagined the mechanisms to be much more complicated. It was interesting seeing how well all the parts fit together. I was most surprised by this one part on the pot that connects 5 different functioning pieces with one tiny screw.
The function diagram is to be used in tandem with the knolling layout.
Capstone Enclosure | Anjelica Harlow + Albert Lui
You would thinking making a box would be easy. The details are actually deceptively meticulous.
We already knew what our project enclosure would look like because we worked it out together on paper. At first we thought about buying premade pots from the store but in the end we decided against it because we believed it might have been hard to modify it to suit our needs (placement of the moisture sensors, Arduino board, wiring). Therefore, we decided to create our own design instead.
The planter is the shape of a box. There's a space below it that houses all the electrical components - we call this the base. The base has a circular cutout to accommodate the PIR motion sensor.
The planter is actually made up of two boxes, one larger (outer) and the other smaller (inner). The inner box holds the soil and moisture sensor probes. It is isolated from the rest of the build to prevent any moisture from making contact with the electronics.
The inner box and base are made up of white opaque acrylic. We felt that this really imbued our project with a touch of modern design. The outer box is made out of a translucent acrylic to allow the LED light to shine through. We bought all our plastic material from TAPs plastics in downtown.
When cutting the sheets of plastic to make pieces for the box, we messed up a lot! We thought we made perfect measurements but we ended up cutting some pieces too short and some too long. We also had to make sure to account for the thickness of the plastic, the placement of the holes for the LEDs, and the size of the PIR sensor cutout. As the deadline grew near, John and Taylor were both absent from the shop (it was actually supposed to be closed) the day we needed them the most. This really stressed us out, but since we had extra plastic, we were able to get by by enlisting the help of some ID students.
We already knew what our project enclosure would look like because we worked it out together on paper. At first we thought about buying premade pots from the store but in the end we decided against it because we believed it might have been hard to modify it to suit our needs (placement of the moisture sensors, Arduino board, wiring). Therefore, we decided to create our own design instead.
The planter is the shape of a box. There's a space below it that houses all the electrical components - we call this the base. The base has a circular cutout to accommodate the PIR motion sensor.
The planter is actually made up of two boxes, one larger (outer) and the other smaller (inner). The inner box holds the soil and moisture sensor probes. It is isolated from the rest of the build to prevent any moisture from making contact with the electronics.
The inner box and base are made up of white opaque acrylic. We felt that this really imbued our project with a touch of modern design. The outer box is made out of a translucent acrylic to allow the LED light to shine through. We bought all our plastic material from TAPs plastics in downtown.
When cutting the sheets of plastic to make pieces for the box, we messed up a lot! We thought we made perfect measurements but we ended up cutting some pieces too short and some too long. We also had to make sure to account for the thickness of the plastic, the placement of the holes for the LEDs, and the size of the PIR sensor cutout. As the deadline grew near, John and Taylor were both absent from the shop (it was actually supposed to be closed) the day we needed them the most. This really stressed us out, but since we had extra plastic, we were able to get by by enlisting the help of some ID students.
Capstone Homemade Moisture Sensors! | Anjelica Harlow + Albert Lui
We are very proud of the fact that instead of buying every sensor we needed for our project, we worked together and made our very own moisture sensor! Granted it wasn't the most difficult thing to build, we still think we can be proud of hand making a sensor from scratch!
To do this we followed a tutorial we found on Instructables here.
I found two nails laying around the house and brought them to class. Next, we would need some kind of wire to attach to these nails. We went down to the shop and asked Taylor for some wire. He cut off a length of thick black cable and then striped it to reveal a few multi-colored cables inside. He lent us a fancy wire stripper that grabs hold of the cable sleeve with one clamp while striping it with the other - an insanely awesome tool.
We went back to our classroom and proceeded to strip the multi-colored cables to reveal a bunch of skinny copper wires. Angelica took 3 of these wires and braided them together to give them some thickness (she's an expert at braiding hair and was able to do this with extreme speed and consistency). By doing this twice, we had our 2 copper wires!
The next step was the cover the bare wire up with something so it didn't end up touching other components and messing things up. We were actually able to pull the original multi-colored cable sleeves back up onto our braided wires. We added some electrical tape for safe measure.
Finally, we wrapped these below the heads of the nails and added some gorilla tape to hold them in place to complete our moisture sensors.
The code was extremely simple to get moisture readings. I guess it works by detecting how much electricity is going into the analog pin that the moisture sensor is plugged into on the Arduino board. If there's more moisture (water conducts electricity), the electricity will flow better from one nail to the other. If we touched the two nails together, the reading would spike into the thousands. We checked the readings by doing an analog read on the pin and using Serial.println to see the values in the Serial Monitor.
One problem we would run into in the future is the rusting of the nails. I should have used galvanized nails like the tutorial suggested.
To do this we followed a tutorial we found on Instructables here.
I found two nails laying around the house and brought them to class. Next, we would need some kind of wire to attach to these nails. We went down to the shop and asked Taylor for some wire. He cut off a length of thick black cable and then striped it to reveal a few multi-colored cables inside. He lent us a fancy wire stripper that grabs hold of the cable sleeve with one clamp while striping it with the other - an insanely awesome tool.
We went back to our classroom and proceeded to strip the multi-colored cables to reveal a bunch of skinny copper wires. Angelica took 3 of these wires and braided them together to give them some thickness (she's an expert at braiding hair and was able to do this with extreme speed and consistency). By doing this twice, we had our 2 copper wires!
The next step was the cover the bare wire up with something so it didn't end up touching other components and messing things up. We were actually able to pull the original multi-colored cable sleeves back up onto our braided wires. We added some electrical tape for safe measure.
Finally, we wrapped these below the heads of the nails and added some gorilla tape to hold them in place to complete our moisture sensors.
Close-up showing the braided wires. |
Where the moisture sensors are located within the planter box. |
The code was extremely simple to get moisture readings. I guess it works by detecting how much electricity is going into the analog pin that the moisture sensor is plugged into on the Arduino board. If there's more moisture (water conducts electricity), the electricity will flow better from one nail to the other. If we touched the two nails together, the reading would spike into the thousands. We checked the readings by doing an analog read on the pin and using Serial.println to see the values in the Serial Monitor.
One problem we would run into in the future is the rusting of the nails. I should have used galvanized nails like the tutorial suggested.
Labels:
Albert Lui,
braiding,
homemade,
moisture sensor,
nails,
wire stripping,
wires
Jen and Emma | Final Video
http://vimeo.com/97908418
Here is our final video! We wanted to express the frustration and discomfort of being tied to your computer screen while working on stuff for a long time. Skyler is a great actor! The interaction is simple but it was interesting to think about the different ways we could accomplish this task. It is also interesting to think about how this interaction scales in different ways: what if a classroom or study area had these all fastened to the desk? the screen covers could sync up and allow people to take breaks together, inciting social interactions and conversation that could benefit everyone's studying and stuff!
Here is our final video! We wanted to express the frustration and discomfort of being tied to your computer screen while working on stuff for a long time. Skyler is a great actor! The interaction is simple but it was interesting to think about the different ways we could accomplish this task. It is also interesting to think about how this interaction scales in different ways: what if a classroom or study area had these all fastened to the desk? the screen covers could sync up and allow people to take breaks together, inciting social interactions and conversation that could benefit everyone's studying and stuff!
Capstone Speaker Shield Madness | Anjelica Harlow + Albert Lui
One super ‘fail’ we had happened when we got our hands on a new shield for our Arduino board. We purchased a MP3 Player Shield from Sparkfun (https://www.sparkfun.com/products/10628) to use for our project’s audio output because we needed a way to get the planter to talk to people who passed by.
At first we simply hooked up a speaker Dominic let us borrow directly to the Arduino. We were able to get it to play a tone, but we knew if we wanted to play multiple recorded phrases, we would need to go for a shield.
When the shield arrived, we were so excited to get it working that we made a crazy oblivious mistake.
First we stuck the headers into the shield and stacked them on top of our Arduino. We hooked everything up and plugged in some earphones into the shield's sound output. We tried running the test code that is provided with the shield, but kept getting error messages. The error messages were not helpful at all in helping us identify what was wrong.
We spent hours trying to figure out why it wasn't working. We were convinced the problem was the SD card. We browsed forums, comments, and help pages but couldn't find out what was going on. Dominic came over and took a look at things and at first, we still couldn't figure out what was going on. I asked Dominic to look at the physical board setup and asked him why the shield was so unstable on the Arduino board. I'm pretty sure at that point, Dominic had a mental facepalm. We didn't solder the headers onto the shield!!!
To our defense, this was our first time ever setting up a shield. In addition, no where in the instructions did it say to solder the headers onto the shield before using. This might be "obvious" for some people, but I still think it would be beneficial to include this (along with some soldering instructions) in the documentation.
This was a great learning experience. I'm used to coding stuff up and over the years I've learned how to debug code quite well. However, when you're doing physical prototyping stuff like this, you have to understand that you must debug the physical stuff as well as the code. You can spend hours staring at your code only to find that the problem was a loose wire.
This was a great learning experience. I'm used to coding stuff up and over the years I've learned how to debug code quite well. However, when you're doing physical prototyping stuff like this, you have to understand that you must debug the physical stuff as well as the code. You can spend hours staring at your code only to find that the problem was a loose wire.
Labels:
Albert Lui,
Arduino,
Soldering,
Sparkfun MP3 Player Shield
Jen + Emma | Research
This concept came from personal experience: constant reminders growing up to not have too much consecutive time on screens for the sake of my eyes as well as feeling like my eyes are dry and irritated after spending much of the day on my computer.
I did some research on Computer Vision Syndrome and eye strain and the causes are from insufficient rest periods, not enough blinking because long periods of time on screens doesn't encourage the natural blinking periods humans usually have, and not enough or too much contrast. There are a couple online programs that do the same thing as our program like EyeDefender and activity timers that take over your screen after a certain amount of time. These programs have mixed reviews, which I might think comes from a lack of control that scares users.
building the inner-housing (Charlotte and Kendall)
Once we had the essentials of our lamp functioning (coding, wiring, LEDS, sensor), we needed to figure out how to house these objects inside of the lamp that we bought. We sketched out a few ideas, and discussed possible materials and ways to construct this housing. In the end, we decided to laser-cut a sheet of acrylic to create our housing. This was the first time either of us had used the laser-cutter so it was a new experience for both of us. We used illustrator to create correctly-scaled templates, which we then put into Rhino to send to the laser-cutter. It was exciting watching the laser printer cut out the pieces, even though we had to make adjustments to our first attempt. We assembled the pieces, sanded down the acrylic, and spray-painted the housing to give it a clean look that matched the aesthetic quality of our lamp. Our housing had a hole at the top, to allow for the sensor to easily detect the color of an object. Using the laser-cutter and constructing part of our lamp ourselves, was an exciting hands-on experience.
LED blow-out (Charlotte and Kendall)
In the finishing stages of our project, we had the unfortunate experience of having our LED strip blow-out. We didnt neccesarily know how or why the lights had suddenly stopped working. We had to test out a lot of different things to figure out the cause of the issue. After talking to Dominic for over an hour, we tried re-doing the wiring, testing the power transistors, and buying new batteries.. but everything lead us to realize that something had gone wrong with the LEDs. Once we had figured this out, we thought that perhaps only the first set of LEDs had been burned out (somewhat comparable to christmas lights). Thus, we cut off the first strip of three LEDs off, and cut off another strip of three just to test if there were some surviing LEDs. We soldered these and to our relief, they easily turned on! This meant, that our whole strip wasn't dead..and we wouldn't have to rush-order new LEDs. We then soldered the remaining LED strip, and were able to move on to the physical building of our lamp's interior. Although this set us back time-wise, it was still a learning experience because we were more able to understand the relationship between LEDs in a strip and how they transfer power.. as well as gianing a bit more soldering experience.
Project Concept | Anjelica Harlow + Albert Lui
Hello there. This is a short blog post about our project's concept.
If you wish to see the functional diagram instead, please click on the following link:
http://tangibleinteractionuw.blogspot.com/2014/05/leds-would-bring-awareness-to-plants.html
In class, Dominic told us to come up with a 'concept of situation' that consists of 3 different parts:
1) Information on the situation
2) The change and response description
3) Inputs & outputs (if you get to it)
He used an example of a table jumping into a pool to save drowning children.
The situation is kids playing in the swimming pool. The change is detecting that a kid is drowning, and the response is the table jumping into the pool.
Angelica and I met up and came up with many ideas.
We settled on this one:
1) A plant in soil is residing within a 'smart' planter pot. That basically sums up the situation.
2) A person walks in front of the plant/pot is the change happens. It's interesting to note that another type of change happens within this system (the moisture of the soil goes up or down). The planter will respond by speaking to the person. In addition, of the moisture is within an ideal range, the planter will respond by lighting up.
3) Inputs: Person walking (motion), soil moisture
Outputs: Speech, light
Our other ideas included voice controlled blinds, spinning/glowing drink coasters, a talking fireplace mantle, and a smart library bookshelf system.
If you wish to see the functional diagram instead, please click on the following link:
http://tangibleinteractionuw.blogspot.com/2014/05/leds-would-bring-awareness-to-plants.html
In class, Dominic told us to come up with a 'concept of situation' that consists of 3 different parts:
1) Information on the situation
2) The change and response description
3) Inputs & outputs (if you get to it)
He used an example of a table jumping into a pool to save drowning children.
The situation is kids playing in the swimming pool. The change is detecting that a kid is drowning, and the response is the table jumping into the pool.
Angelica and I met up and came up with many ideas.
We settled on this one:
1) A plant in soil is residing within a 'smart' planter pot. That basically sums up the situation.
2) A person walks in front of the plant/pot is the change happens. It's interesting to note that another type of change happens within this system (the moisture of the soil goes up or down). The planter will respond by speaking to the person. In addition, of the moisture is within an ideal range, the planter will respond by lighting up.
3) Inputs: Person walking (motion), soil moisture
Outputs: Speech, light
Our other ideas included voice controlled blinds, spinning/glowing drink coasters, a talking fireplace mantle, and a smart library bookshelf system.
Labels:
Albert Lui,
Arduino,
Brainstorming,
Project Concept,
Sketching
powering the LEDs...portably (Charlotte and Kendall)
Kendall and I used RGB LED strips to light our lamp. These caused us a bit of confusion at first, as we were very unsure of how much power they needed and how they should be powered portably. We realized too late that we needed power transistors and had to order those after all our stuff had already come! Luckily, Adafruit was pretty clear on telling us what to do and what to buy (https://learn.adafruit.com/rgb-led-strips/usage). We went to Metrix to purchase transistors and were looking for the specific ones mentioned by Adafruit, which were impossible to find among the hundreds of unlabelled pieces they had. We even asked an employee and he had to admit that he really had no idea what the difference between certain types of transistors is. In the end we ordered the ones we wanted but also had a few random ones from Metrix as back-up. Luckily we figured out how to wire everything and our lights didn't blow out, at least not because of the transistors..
Lum: An arduino-powered smoke detector
https://vimeo.com/97977007
Lum is a Arduino-powered smoke detector that combines motion, light and smoke inputs to improve alerts and make sure they only happen when you want them to. With Lum, we emphasized visual alerts using Neopixel LED’s and sound through a speaker and the tone library. If there is a false alarm, the PIR motion detector will silence the alarms with the wave of a hand. Given a light threshold, Lum acts as an ambient light. Lum is a smoke detector for everyone.
NeoPixels and Soldering
NeoPixels by adaFruit are ideal when you want a light source that needs to change color, intensity or rate. The library by adaFruit makes programming a snap and there are a variety of options to choose from. That being said, MAKE SURE YOU CHOOSE CAREFULLY. We ended up buying a set of 4 breadboard-friendly NeoPixels with the intention of soldering them together later on. This is much more time consuming and temperamental than you may think. There are 3 connections on each side of each pixel creating 6 soldering points on a object about a centimeter per a side. If you are planning to use them in sequence, We recommend buying a pack that are already connected or a strip.
Getting started with 3D forms and plastics
Running the bandsaw and manipulating plastics are not core skills that we run into in IxD. so choosing the right plastic or method for getting the results you want can be a little daunting. As with most parts of design, your peers are one of your greatest assets. MAKE FRIENDS WITH THE ID KIDS. They will get you started and scaffold your way through the process. With this class, we learned that most things related to physical prototyping are possible and a lot more attainable than you may initially think. The vacuum form is an incredible tool that will produce a really high quality model in a relatively short period of time. When creating a model to vacuum form ove, Roy and I found that manually creating a model with modeling foam was the most efficient use of time. When it comes to plastics, we worked with Acrylic which turned out to be very temperamental. It cracks easy, has a very specific flash point when vacuum forming and is a pain to cut out. In our project, we settled on it for the transparent qualities and thickness. Doing it over again, I think we would have looked into other plastics that had similar qualities.
- Ian Fike and Roy Kim
Working with the MQ-2 sensor
Breakout Board: http://www.pololu.com/product/1479
Spec Sheet: http://www.pololu.com/file/0J309/MQ2.pdf
The MQ-2 smoke and flammable gas sensor was an essential component to our smoke detector. It gives an analog output which we found was best calibrated with 2- 100k resistors. Initially, we ran into 2 major roadblocks. Because the sensor uses a 5V-powered heater to test the air passing through it, the readings have some inconsistency. The heater reaches a flatline of about 221 (analog input with 2- 100k resistors) after about 10 minutes of running. This can cause an issue because during the first 10 minutes your program is running the sensor, its output is constantly falling from a starting point of around 600-700 analog in. The second roadblock to take into consideration is the soldering of the breakout board to the main heater component. BUY THE BREAKOUT BOARD. The pins off of the heater are reversible but it is much easier to keep tabs 3 pins (ground, 5v and output) than jumping the pins yourself. When soldering, we found the sensors to be reversible. If you fit it in the hole, the results should be good.
- Ian Fike and Roy Kim
Chris & Skyler: Processing
We were just messing around with a processing file that had 2 squares that responded to the mouse position. We added a third square that behaves increasingly random as mouseX changes. Just interesting to watch the changes.
/**
* Mouse 2D.
*
* Moving the mouse changes the position and size of each box.
* THere is a third box that moves a little randomly
*/
void setup()
{
size(640, 360);
noStroke();
rectMode(CENTER);
}
void draw()
{
background(51);
fill(255, 204);
rect(mouseX, height/2, mouseY/2+10, mouseY/2+10);
fill(255, 204);
int inverseX = width-mouseX;
int inverseY = height-mouseY;
rect(inverseX, height/2, (inverseY/2)+10, (inverseY/2)+10);
rect(mouseX*1.1+random(2)*mouseX, height/1.1, mouseY/2+12, mouseY/1.3+10);
}
/**
* Mouse 2D.
*
* Moving the mouse changes the position and size of each box.
* THere is a third box that moves a little randomly
*/
void setup()
{
size(640, 360);
noStroke();
rectMode(CENTER);
}
void draw()
{
background(51);
fill(255, 204);
rect(mouseX, height/2, mouseY/2+10, mouseY/2+10);
fill(255, 204);
int inverseX = width-mouseX;
int inverseY = height-mouseY;
rect(inverseX, height/2, (inverseY/2)+10, (inverseY/2)+10);
rect(mouseX*1.1+random(2)*mouseX, height/1.1, mouseY/2+12, mouseY/1.3+10);
}
High-Five Machine is high-fiving! (and just in time)
The most frustrating part of the process is that we have had to order and wait for so many duplicates of parts because of shorting issues or wear and tear. For example, the force of the spring pulling on one of our first servos was causing so much wear on the internal gears that the servo finally gave out. Our hardware, after several weeks of experimentation was failing us. Of all things, our breadboard was not making the connections to our servos and sensors, which took us several frustrating hours (and some help from Domenic) to figure out. On the day of our final, Scott ran out to buy another solderless breadboard and we rewired our connections, which worked just in time for us to record a quick clip minutes before our final class:
We chose to challenge ourselves with a mechatronics project and learned a lot. The rapid, iterative process of laser cutting various possible solutions and testing them out has been both eye-opening and empowering. Both Scott and I will be putting in a few more hours to achieve the intended functionality of our machine. We're so close.
Fabricating the housing, Zitto!
A major aspect of our creating our lamp was making sure all the wires, electronics, and other physical components were nicely stored within the lamp.
the MELODI is straight from Sweden (so scan!). It's made up of a dangling light that nicely clips into the top of the shade. The lamp is 15' tall and wide and made perfect for holding all the other components.
Step two, making a support to hold the LEDs while also holding the electronics above the light. I laser cut a circle two circles that friction fit to support beams. The top circular cut has a cut for the mic, light bulb and speaker. I glued in the support beams in with an additional wire support to make sure the structure would stay together.
Step three, I attached the support structure with all the electronics to the lamp with threaded rod. I drilled a hole from the top of the lamp to the inner structure and screwed it all together!
the MELODI is straight from Sweden (so scan!). It's made up of a dangling light that nicely clips into the top of the shade. The lamp is 15' tall and wide and made perfect for holding all the other components.
Step two, making a support to hold the LEDs while also holding the electronics above the light. I laser cut a circle two circles that friction fit to support beams. The top circular cut has a cut for the mic, light bulb and speaker. I glued in the support beams in with an additional wire support to make sure the structure would stay together.
Step three, I attached the support structure with all the electronics to the lamp with threaded rod. I drilled a hole from the top of the lamp to the inner structure and screwed it all together!
Vitto! Complete!
For our video we put zitto in the classroom and hung it from one of the ceiling plugs. Then we threw a white backdrop behind it and filmed away! We took the old school infomercial route, check it out!
Zitto! from Skyler Rodriguez on Vimeo.
Skyler and Chris: Stupid mic!
Stupid MIC! I don’t know what I expected from a $4
microphone, but I was definitely hoping for something slightly more sensitive.
Anyways, after quite a bit of tweaking, re-tweaking, and trying strange things
out in coding, we were finally able to get the lamp to react to loud sounds. We
are messing around with having warning lights that let you know when you are
being too loud before the speaker actually tells you to be quiet. It’s kind of
interesting trying to decide how long to wait between triggers so that the lamp
isn’t constantly going off. Figuring out how to mount everything inside of the
lamp is going to be interesting but I think there should be enough space inside
of the cone for everything to fit in snugly.
Tightening Up Legs, USB Issues and Re-shoot Lights by Freistadt/Hart
We were running into issues with the tightness of our tripod dowels, so we installed fasteners to create a better hold, especially on the center leg. This required a return to the wood shop today, Friday after Finals, where I expanded the hole to fit a metal fastener, acquired at Hardwick's. Now the legs are tight and tip top.
I will also be reshooting the mirror with the lights on, as we have successfully installed the 60 NeoPixel strip from Adafruit. It took a little while after our presentation, but after we figured out the direction of input, which was incorrect out of the box (CHECK THE ARROWS OF DATA FLOW), we were up and fully powered. At which time our USB ports became a problem. We kept getting a message of "avrdude: stk500_getsync(): not in sync: resp=0x00" which we could not find the solution online, so we swapped our Arduino UNO for an Arduino MEGA and everything worked finally.
I will also be reshooting the mirror with the lights on, as we have successfully installed the 60 NeoPixel strip from Adafruit. It took a little while after our presentation, but after we figured out the direction of input, which was incorrect out of the box (CHECK THE ARROWS OF DATA FLOW), we were up and fully powered. At which time our USB ports became a problem. We kept getting a message of "avrdude: stk500_getsync(): not in sync: resp=0x00" which we could not find the solution online, so we swapped our Arduino UNO for an Arduino MEGA and everything worked finally.
Prototype, prototype, prototype
One thing we got reiterated on the Plantarduino project, is that in order to be sure that something is going to work, it is necessary to build a mock up.
Sometimes one mockup will prove sufficient, often it is necessary to build a couple. We built quite a few because we were opening a water valve with a servo we needed the alignment to be good always. The prototype also allowed us to see where we needed mounting holes for all the components.
Sometimes one mockup will prove sufficient, often it is necessary to build a couple. We built quite a few because we were opening a water valve with a servo we needed the alignment to be good always. The prototype also allowed us to see where we needed mounting holes for all the components.
Code and Diagram
Controlling a servo with a tact switch, and LED blinking tied to moisture sensor.
// Latest code June 4th
#include <Servo.h>
#include <Servo.h>
Servo servoMain; // Define our Servo
const int buttonPin = 2; // the number of the pushbutton pin
// variables will change:
int buttonState = 0;
int pos = 0; // variable to store the servo position
int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
const int led = 13; // turn on
const int led2 = 3; // blinking
int ledState = LOW; // ledState used to set the LED
long previousMillis = 0; // will store last time LED was updated
long interval = 1000;
const int buttonPin = 2; // the number of the pushbutton pin
// variables will change:
int buttonState = 0;
int pos = 0; // variable to store the servo position
int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
const int led = 13; // turn on
const int led2 = 3; // blinking
int ledState = LOW; // ledState used to set the LED
long previousMillis = 0; // will store last time LED was updated
long interval = 1000;
void setup() {
// declare the ledPin as an OUTPUT:
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
servoMain.attach(10); // servo on digital pin 10
pinMode(buttonPin, INPUT);
servoMain.write(90);
}
// declare the ledPin as an OUTPUT:
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
servoMain.attach(10); // servo on digital pin 10
pinMode(buttonPin, INPUT);
servoMain.write(90);
}
void loop() {
sensorValue = analogRead(sensorPin);
delay(1000);
Serial.print("sensor = " );
Serial.println(sensorValue);
if (sensorValue <= 200) { //350-390 range => blinking
digitalWrite(led, LOW);
// Only allowed button to be pressed if no water
// read the state of the pushbutton value:
//buttonState = ;
if (digitalRead(buttonPin) == 1) { // Ground
Serial.println(buttonState);
Serial.println(buttonPin);
servoMain.write(0);
delay(5000);
servoMain.write(90);
delay(500);
} else {
unsigned long currentMillis = millis();
sensorValue = analogRead(sensorPin);
delay(1000);
Serial.print("sensor = " );
Serial.println(sensorValue);
if (sensorValue <= 200) { //350-390 range => blinking
digitalWrite(led, LOW);
// Only allowed button to be pressed if no water
// read the state of the pushbutton value:
//buttonState = ;
if (digitalRead(buttonPin) == 1) { // Ground
Serial.println(buttonState);
Serial.println(buttonPin);
servoMain.write(0);
delay(5000);
servoMain.write(90);
delay(500);
} else {
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
digitalWrite(led2, ledState);
}
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
digitalWrite(led2, ledState);
}
}
} else if (sensorValue >= 350) {
digitalWrite(led2, LOW); // turn off the other LED first
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
} else {
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
digitalWrite(led2, LOW); // turn the LED off by making the voltage LOW
}
}
} else if (sensorValue >= 350) {
digitalWrite(led2, LOW); // turn off the other LED first
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
} else {
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
digitalWrite(led2, LOW); // turn the LED off by making the voltage LOW
}
}
Laser Cutting Taller Objects (over 2" and up to 9" or so)
An interesting complication in building the Plantarduino box was that we put it together too soon and it became hard to make decisions later. We were too constrained by the form unless we wanted to build a new one. Later we realized we could use the box but we needed to laser cut it assembled.
After talking and checking out a few laser cutters, we learned that we couldn't cut anything that was taller than a few inches. The box was 7" tall when on its side.
One night that we were working in the metals shop, I look closer at the laser cutter and noticed that you can remove the material holding tray completely and stick a 10" tall object! I then modified the Z axis on the computer program and voila! We did a incision on out 7" tall box!!!
I put a block of wood in the box to protect the bottom from the laser and it was a good idea because the laser did reach all the way through.
After talking and checking out a few laser cutters, we learned that we couldn't cut anything that was taller than a few inches. The box was 7" tall when on its side.
One night that we were working in the metals shop, I look closer at the laser cutter and noticed that you can remove the material holding tray completely and stick a 10" tall object! I then modified the Z axis on the computer program and voila! We did a incision on out 7" tall box!!!
I put a block of wood in the box to protect the bottom from the laser and it was a good idea because the laser did reach all the way through.
Final Video - Daniel/Chip
Chip and I took a simple and mundane task, watering a house plant, and separated the basic steps and put them on extreme ends. Conceptually it is a wireless interaction, but this version is wired. So the concept is about watering a plant remotely and about the interactions it could create.
On one end, the user (user A) can have the visuals and the presence benefits of owning a plant, but user A can’t water the plant, nor touch it, and it difficult to tell when it needs watering.
On the other end (User B), the user has the satisfaction of keeping this plant alive, but s/he can’t see it.
This broken communication structure can motivate the involved ones to seek communication between them.
Other situations in which this concept could be used are :
-Kids plant caring
-Traveling and away from plant
In the video, Chip realizes he could use a concept like his to have a new level of interact with his host dad.
Wednesday, June 11, 2014
Stellio (Color-Selecting Lamp) (Charlotte and Kendall)
Charlotte and Kendall's Color-Selecting Lamp
We created a lamp that changes color based on the color of an object that the user holds up to it. It utilizes an RGB sensor to detect the color and displays this color in the RBG LED strip. We purchased an ikea ceiling lamp and modified it to fit our purposes. We laser-cut a sheet of acrylic (which we then sanded and spray-painted white) to create an inner-housing for the arduino, breadboard and LEDs.
The code for our lamp is as follows:
#include
#include "Adafruit_TCS34725.h"
// Pick analog outputs, for the UNO these three work well
// use ~560 ohm resistor between Red & Blue, ~1K for green (its brighter)
#define redpin 3
#define greenpin 6
#define bluepin 9
// for a common anode LED, connect the common pin to +5V
// for common cathode, connect the common to ground
// set to false if using a common cathode LED
#define commonAnode false
// our RGB -> eye-recognized gamma color
byte gammatable[256];
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_16X);
void setup() {
Serial.begin(9600);
Serial.println("Color View Test!");
if (tcs.begin()) {
Serial.println("Found sensor");
} else {
Serial.println("No TCS34725 found ... check your connections");
while (1); // halt!
}
// use these three pins to drive an LED
pinMode(redpin, OUTPUT);
pinMode(greenpin, OUTPUT);
pinMode(bluepin, OUTPUT);
// thanks PhilB for this gamma table!
// it helps convert RGB colors to what humans see
for (int i=0; i<256; i++) {
float x = i;
x /= 255;
x = pow(x, 2.5);
x *= 255;
if (commonAnode) {
gammatable[i] = 255 - x;
} else {
gammatable[i] = x;
}
//Serial.println(gammatable[i]);
}
}
void loop() {
//this is the sensor read code
uint16_t clear, red, green, blue;
tcs.setInterrupt(false); // turn on LED
delay(60); // takes 50ms to read
tcs.getRawData(&red, &green, &blue, &clear);
tcs.setInterrupt(true); // turn off LED
if (clear >= 10000){
Serial.print("C:\t"); Serial.print(clear);
Serial.print("\tR:\t"); Serial.print(red);
Serial.print("\tG:\t"); Serial.print(green);
Serial.print("\tB:\t"); Serial.print(blue);
// Figure out some basic hex code for visualization
uint32_t sum = clear;
float r, g, b;
r = red; r /= sum;
g = green; g /= sum;
b = blue; b /= sum;
r *= 256; g *= 256; b *= 256;
Serial.print("\t");
Serial.print((int)r, HEX); Serial.print((int)g, HEX); Serial.print((int)b, HEX);
Serial.println();
//Serial.print((int)r ); Serial.print(" "); Serial.print((int)g);Serial.print(" "); Serial.println((int)b );
analogWrite(redpin, gammatable[(int)r]);
analogWrite(greenpin, gammatable[(int)g]);
analogWrite(bluepin, gammatable[(int)b]);
} // close of if
}
Interaction overload!
Chip and I learned that in arduino projects it is very helpful if you simplify to the most essential elements that would still make most of the concept work. After getting advice from everywhere, we simplified our initial concept to only incorporate the most basic controls. A button, a light, and a valve. We then added a moisture meter to tell the LED's to blink.
Chip and I learned that in arduino projects it is very helpful if you simplify to the most essential elements that would still make most of the concept work. After getting advice from everywhere, we simplified our initial concept to only incorporate the most basic controls. A button, a light, and a valve. We then added a moisture meter to tell the LED's to blink.
Anjelica & Albert: Posh Plant Video
After initially not knowing the direction of our project, Albert and I decided to create a planter that would alert users of its water needs. When comparing our end product to our initial diagram, the concept changed very little, if at all. Essentially, the Posh Pot (named because our current version is British and snarky) detects the moisture levels in the potted plant's soil. Albert and I crafted our own moisture sensor by using spare copper wire,two nails, and some electrical tape. If the soil is acceptably damp, the planter turns on 3 blue LEDs. However, if the soil is too dry or too wet, the plant will comment on its state when someone walks by. This is detected through the motion sensor located in the front of the housing. The Arduino and wires are all housed in the base of the planter.
http://youtu.be/PK-YXzXmMmo
http://youtu.be/PK-YXzXmMmo
Jen + Emma | Prototype Life
After getting the rotation down and all of our code going, we had to figure out how to work out the screen that would cover the laptop. We were using a metal rod that was secured to the servo motor that was hard to configure in a way that would allow the entire screen to flip over. We tested out all sorts of materials, ranging from light paper towels to cardboard, but failed to make any of these work. The problem was that the rod itself would rotate inside of the loop it was fastened into, rather than rotating the material. We fixed this by bending the wire down to loop it in two holes, so it would be stable and rotate the (future) screen cover.
Here are some photos of some very rough experiments. LOL.
Tuesday, June 10, 2014
Final Video and Documentation. Constance Wellman and Haley Knox
Coin Counter: "Bright Box"
Our final concept is a our coin counter that encourages children to set saving goals by rewarding them with a short light show each time they reach a goal of 1, 3, and 5 dollars. There are four rectangular slots at the top of the box. Each slot counts 1, 5, 10, and 25 cents to coordinate with a penny, nickel, dime and quarter. Once you reach your goal, the lights in the box will light up and the light show will get longer as the amount collected in the box increases. Once you have reached your final goal you can lift up the lid and collect your money. The video, hero shots, and code are posted below.
Video Link: https://vimeo.com/97896975
Code:
Our final concept is a our coin counter that encourages children to set saving goals by rewarding them with a short light show each time they reach a goal of 1, 3, and 5 dollars. There are four rectangular slots at the top of the box. Each slot counts 1, 5, 10, and 25 cents to coordinate with a penny, nickel, dime and quarter. Once you reach your goal, the lights in the box will light up and the light show will get longer as the amount collected in the box increases. Once you have reached your final goal you can lift up the lid and collect your money. The video, hero shots, and code are posted below.
Video Link: https://vimeo.com/97896975
hero shot |
insert coin |
lighting up |
Code:
#include <Adafruit_NeoPixel.h>
#define PIN 6
int val1;
int val2;
int val3;
int val4;
int setPoint1 = 100;
int setPoint2 = 100;
int setPoint3 = 100;
int setPoint4 = 100;
//int A = 100;
//int B = 300;
boolean countcheck1 = false;
boolean countcheck2 = false;
boolean countcheck3 = false;
boolean countcheck4 = false;
int count = 0;
int changes = 0;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(8, 2, NEO_GRB + NEO_KHZ800);
void setup()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);
pinMode(A2, INPUT);
Serial.begin(9600);
digitalWrite(13, HIGH);
digitalWrite(12, HIGH);
digitalWrite(11, HIGH);
digitalWrite(10, HIGH);
strip.begin();
strip.show();
// stripone.begin();
// stripone.show();
}
void loop() {
val1 = analogRead(A3); // Read the analogue input value
//Serial.print("1ai");
//Serial.println(aiValue1);
//Serial.print("slot1count");
//Serial.println(slot1count);
if (val1 < setPoint1 && countcheck1 == false)
{ count = count + 5;
Serial.println("count1");
countcheck1 = true;
}
if (val1 > setPoint1)
{ countcheck1 = false;
}
val2 = analogRead(A4); // Read the analogue input value
//Serial.print("2ai");
//Serial.println(aiValue2);
//Serial.print("slot2count");
//Serial.println(slot2count);
if (val2 < setPoint2 && countcheck2 == false)
{ count = count + 10;
Serial.println("count2");
countcheck2 = true;
}
if (val2 > setPoint2)
{ countcheck2 = false;
}
val3 = analogRead(A5); // Read the analogue input value
//Serial.print("1ai");
//Serial.println(aiValue1);
//Serial.print("slot1count");
//Serial.println(slot1count);
if (val3 < setPoint3 && countcheck3 == false)
{ count = count + 25;
Serial.println("count3");
countcheck3 = true;
}
if (val3 > setPoint3)
{ countcheck3 = false;
}
val4 = analogRead(A2); // Read the analogue input value
if (val4 < setPoint4 && countcheck4 == false)
{ count = count + 1;
Serial.println("count4");
countcheck4 = true;
}
if (val4 > setPoint4)
{ countcheck4 = false;
}
if (count > 100)
{ strip.begin();
strip.show();
if (changes == 0) {
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(0, 0, 0), 50); // Nothing
strip.show();
changes = 1;
}
}
if (count > 300)
{ strip.begin();
strip.show();
if (changes == 1) {
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(0, 0, 0), 0); // Nothing
strip.show();
changes = 2;
}
}
if (count > 500)
{ strip.begin();
strip.show();
if (changes == 2) {
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(0, 0, 0), 0); // Nothing
strip.show();
changes = 3;
}
}
}
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
Subscribe to:
Posts (Atom)