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.
Showing posts with label Arduino. Show all posts
Showing posts with label Arduino. Show all posts

Friday, June 12, 2020

Simple Circuit Experimentation: Voltage Divider

Annabel Lee
DES 325 A
Voltage Divider


Getting the Photoresistor to work was one of the most challenging tasks. Guided by the referred instructions, I made sure to followed the tutorial step-by-step. I struggled getting the light to fade out as I hovered my finger over the photoresistor, but it seemed unaffected by the light. However, it turned out that it was my code that was the problem. 

 
Above is the code that fixed the problem! What I mistakenly realized was that previously I did not set ledPin=9; but to 8. A simple human error that caused the entire circuit to malfunction was a learning experience to make sure and double check every component and detail. 

Friday, June 13, 2014

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.

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.

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.

Friday, April 25, 2014

Jered and Ciera | Arduino | Sensor Experimentation

Using an Arduino can sometimes make it difficult to control high-voltage devices. The maximum voltage that the Arduino can output from its pins is +5 volts. Say we wanted to control a motor running at +12 volts? How could we do it?

The answer is transistors. Transistors are very powerful because they allow manipulation of very high voltages using only a very low voltage signal. Think of a transistor as a signal amplifier. A transistor can use a +5v signal from the Arduino to turn on or off a higher voltage +12v motor.


In common transistors like the TIP120, the "base" pin can connect to a control signal which controls current across the "collector" and "emitter" pins.

In the schematic below, a potentiometer is used to control the speed of a 12 volt DC motor via PWM. The potentiometer acts as a sensor and is connected to pin A0 as well as +5v and GND. Extra power comes from an external "wall wart" which provides a +12v current. Note: it is very important to connect all the grounds together in circuits like this. The ground from the wall wart is connected to the ground of the Arduino even though they output different voltages.


To get this circuit to run on the Arduino, simply use the unmodified example code from Examples > Analog > AnalogInOutSerial. The Arduino reads the analog signal from the potentiometer on pin A0, and then outputs an equivalent PWM signal from pin 9. The transistor then amplifies the PWM signal in order to control the flow of +12v current through the motor.


Try it for yourself!

Jered and Ciera | Arduino | Fibonacci Sequence Blinking

Writing an Arduino sketch to blink an LED according to the Fibonacci Sequence is fairly straightforward. The two main variables you need to keep track of are the last two numbers in the sequence. Without them, it is impossible to keep track of where you are as you step through the sequence!

The second important part of code is a loop that blinks the light repeatedly, however many times you need it to according to where in the sequence you are.

Source code posted below:

/*
Fibonacci Number Sequence counter
by Jered Danielson and Ciera Johl, 25 April 2014

This sketch blinks the LED on "ledPin" according to the Fibonacci Sequence.

The Fibonacci Sequence is defined as Fn = Fn-1 + Fn-2, such as
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89... etc.
*/

int ledPin = 13; // LED pin for output
int numberOne = 0; // Fn-2
int numberTwo = 1; // Fn-1
int delayTime = 400; // Delay time in milliseconds between blinks

void setup() {
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);
}

void loop() {
  int currentNumber = numberOne + numberTwo; // next number equals the sum of the last two
  // Blink the LED "currentNumber" number of times
  for(int i = currentNumber; i > 0; i--) {
     digitalWrite(ledPin, HIGH);
     delay(delayTime/2);
     digitalWrite(ledPin, LOW);
     delay(delayTime/2);
  }
  
  // Update the two stored numbers of the sequence
  numberOne = numberTwo;
  numberTwo = currentNumber;
  
  delay(delayTime*3);
}

Arduino Sensor Experiment | Anjelica Harlow + Albert Lui

Hi there. This is Albert and Angelica, we are now officially a group. I'm leaving for Toronto soon and wont be in class on next week so I figured I would get this out of the way as soon as possible. Pretty simple, I'm using a momentary push button as my 'sensor.'
Whenever the button is pressed down, the red LED lights up. I actually had to build my circuit with a resistor. Our textbook never really tells us why this is necessary and how the circuit actually works. I understand the code completely, but I don't quite understand the electronics. I have a few questions I'm hoping to ask Dominic in person.

Pressing the momentary button down to light up the red LED.

/*
Turns on an LED when the momentary switch is held down.
 */

int led = 13;
int button = 7;
int val = 0;

void setup() {              
  // initialize then digital pins as input/output for the LED an switch
  pinMode(led, OUTPUT);
  pinMode(button, INPUT);
}


void loop() {
  val = digitalRead(button);
  if (val == HIGH) { //switch is pressed
    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
  }
}

Thursday, April 24, 2014

Arduino Fibonacci Sequence LED | Albert Lui + Anjelica Harlow

Hi. This is Albert and Angelica. Here is the code for making an LED blink the Fibonacci Sequence. No fancy code or mathematical equations for this one. It basically treats the first Fibonacci number as if it were the beginning of a fencepost problem and solves it as a single unique case. It's true that performing the if/else check every single time the void loop is run seems to be redundant, but in reality, a single conditional statement test should have a negligible effect on the time complexity of the entire program. Variables are used to remember what values are in the n-1 and n-2 spots of the sequence and updated after blinking the LED.

/*
  A simple program that blinks an LED a number of times in accordance with the Fibonacci Sequence (1, 1, 2, 3, 5, 8, 13, 21 . . .)
  There are 3 second delays between each Fibonacci number.
 */

int led = 13;
int nMinus1 = 0; // keeps track of the previous number
int nMinus2 = 0; // keeps track of the number before the previous
int blinks = 0; // number of times to blink the LED


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

void loop() {
  // Takes care of the first case like a classic fencepost problem
  if (nMinus1 == 0) {
    digitalWrite(led, HIGH);
    delay(200);            
    digitalWrite(led, LOW);
    delay(200);
    nMinus1 = 1;
  } else {  
    blinks = nMinus1 + nMinus2;
    for (int x = 0; x < blinks; x++) {
      digitalWrite(led, HIGH);
      delay(300);            
      digitalWrite(led, LOW);  
      delay(300);            
    }
  nMinus2 = nMinus1;
  nMinus1 = blinks;
  }
  delay(3000);
}

Sunday, April 24, 2011

PB & A #1

Patrick, Ben, and Arduino: What we've been up to

Here's a quick recap of how our project has been evolving.



Social Beer Drinking

We've been designing around the situation of social beer drinking--partially because it's a situation that we're both quite familiar with, but also because it's a situation that's teeming with interesting interactions that are just begging to be messed with.

First we brainstormed around the items involved with social beer drinking:
  • Glasses
  • Pitchers
  • Stools
  • Chairs
  • Tables
  • Coasters
  • etc.
Then we focused in on the vessel itself--all of the information that can be gathered and what that could say about what is happening between the drinkers, each other, and their drinks. The beer-cology started to take shape. Some things we looked into:
  • Temperature
  • Head
  • Drinker/Owner
  • Act of Pouring
  • Amount of Beer
  • Proximity to Pitcher
  • Proximity to Drinker/Owner
  • Beer "Identity"
  • Viscosity
We started to get a feel for the situation and some of the possible effects of learning from these variables. Still, we weren't sure how to manifest potential feedback in a way that would affect the social situation in a really interesting (and maybe fun) way.

Back to the drawing board.

Instead of wrapping our heads around the pint glass and working outwards from the object, we attempted to get a fresh look by zooming out and examining the situation as a whole, once more. As we examined closely some of the other objects present in the situation, one seemed to stand out against the rest.

The table is always there, doesn't belong to any one person, and acts as the intermediary between the drinkers and their drinks--providing the surface necessary for these things to come together. Conveniently enough, it's also able to contain all of the sensing, processing, and actuating equipment we need to use. It is also positioned in such a way that would make it easy to interact with in a tactile, visual, and even aural way.



So a Supertable? What does it do?

Our device intends to measure one variable (to start with): Amount of beer.

It measures the amount of beer in the pitcher and in each member's glass by providing affordances that indicate where the glasses and communal pitcher should be placed (these areas contain sensors that can gather this information).

By reading this information, we intend to inform the user of a few things:
  • How many beers have been consumed by each member
  • How "drunk" that member might be (ballpark estimated by time vs amount)
  • How much money they need to contribute to the group for the communal beer
  • Who has had the most, who has had the least
We've also considered the concept of having the table decide who's next in line to buy a pitcher (randomly selecting a member of the group, and eliminating them from being chosen in the next random selection).

By working in this space, we're not trying to solve an existing problem--just make one of the solutions to life's problems a little more interesting. A hat-tip to Neil and Inness for presenting during class the situation that gave us the initial kick in the right direction.


Pictures, Fun Arduino experiments and more to come...