Showing posts with label prototyping. Show all posts
Showing posts with label prototyping. Show all posts

Monday, 26 March 2012

Transient Memory... In a nutshell... And More

How can I sum up transient memory?

'It is just the concept  of having a memory fading over time. Light a light gradually getting duller and duller...'

I decided to then model this using arduino: whereby pressing a button lights up an LED which gradually fades.

Requirements:
A button, a light, some code.

Software development technique: RAPID (Rapid Application Development facilitates fast prototyping and minimal planning which makes it easy to change requirements if desired). This allows for easy project expansion.


I have decided on the requirements, and will work on it in a modular fashion and then put the pieces together.

Step 1: Wiring up a button and LED
Step 2: Getting a light to turn on when the button is pushed
Step 3: Lighting slowly fading off,
Step 4: Getting it to light and re-light whenever the button is pushed.

Steps 1 and 2 were simple. I looked up pulse width modulation to get the LED to slowly turn off. I incorporated some sample fading code from http://arduino.cc/en/Tutorial/Fade and tweaked it to just turn off. An initial error was using a normal pin rather than a PWM pin which meant this it didnt slowly fade on and off; only turned on and off completely. This was noticed and rectified. The sample code faded on and off, but i wanted it to just fade off so i removed the looping code.


  // reverse the direction of the fading at the ends of the fade:
  if (brightness == 0 || brightness == 255) {
    fadeAmount = -fadeAmount ;
  }  

I then had to incorporate counter code which would exit the loop after one fade.

int counter = 0; was added at the top

added an 'if' comparison around the existing code which will allow me increase the counter by one at the end of the loop and therefore make the if statement false until reset. This will mean it only fades once.


if (counter < 52) {
  analogWrite(ledPin, brightness);  

  // change the brightness for next time through the loop:
  brightness = brightness - fadeAmount;

  // wait for 30 milliseconds to see the dimming effect  
  delay(30);  
counter++;
  }

I then had to incorporate a trigger button into this code. I added a button input and wired it up. I tested it with some basic serial.write() code.

Note: I comment my own code to make it easier for me to understand. This is shown as '//' in the arduino language.

The next step was getting it to fade whenever the button was pushed. Now, the problem is that i'll need state change detection which was easily to find an example of, but with a momentary switch like the one that I have, it quickly turns off. So, the fade code would only have a split second to run and wouldn't work as desired.

To combat this i'd have to get the button to manipulate another variable, which is named 'counterNew'. I originally tested this using blink code rather than fade code as it was simpler. It was successful and i could easily manipulate it blink on and off as many times as i liked.

Underneath the state change detection code i added '    counterNew = 1;'. This will set the variable to 1 whenever the button is pressed fully (up and down). If i did not use this code, i would have to hold the button down to notice the fading. I then added this code at the bottom of the page outside of the state change loop.


  if (counterNew < 52) { // fades by 52 to turn light off completely
    digitalWrite(ledPin, HIGH);
    delay(50);
        digitalWrite(ledPin, LOW);
        delay(50); // will be reset as a global variable
        counterNew ++;
    }

This blinks the led on and off 51 times.

The next step is to add fading code in its place. This was a little difficult, but it was eventually incoporated.

The final system turns a light off slowly. It could be incorporated into the paired distance sensing system but with multiple inputs. It could also be used by a single person i.e. a night light which slowly turns itself off. There does not necessarily have to be 'presence indicating' element to the system and it can take many forms. I feel that this prototype could be expanded upon it itself and sums up transient memory in itself.

This is a photograph of the prototype:



Expanding it to xBee systems.....

This is very similar to previous xBee models that i've made. All i need to do is send a letter to serial when the button is pushed on one xBee Arduino, which will then execute on the other xBee arduino.

Arduino A code:

  if (buttonState != lastButtonState) {
Serial.print('k');

and remove the LED executing code on this arduino

Arduino B code;
if(Serial.read() = 'k');
//then
    counterNew = 1;
//execute rest of code

Modelling this in the real world....

In the tutorial last week the concept of this been less functional and more just for fun was proposed... Also was the idea of the idea of false memories. How could this be used in this system?

Source code.


int brightness;    // how bright the LED is
int fadeAmount = 5;    // how many points to fade the LED by
const int ledPin = 9;
int counter = 0;
const int buttonPin = 6;     // the number of the pushbutton pin

int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

int counterNew;
int delayamount = 20; //the fade speed

void setup()  {
  pinMode(ledPin, OUTPUT); //led
    pinMode(buttonPin, INPUT);  //pushbutton  
      Serial.begin(9600);
}

void loop()  {
    buttonState = digitalRead(buttonPin);
  // counter loop which fades

  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
 
    counterNew = 1;
   brightness = 255;    // how bright the LED is
 
    if (buttonState == LOW) {
      // if the current state is HIGH then the button
      // wend from off to on:
      buttonPushCounter++;
      Serial.println("on");
      Serial.print("number of button pushes:  ");
      Serial.println(buttonPushCounter, DEC);
    }
    else {
      // if the current state is LOW then the button
      // wend from on to off:
      Serial.println("off");
   
    }
  }
  // save the current state as the last state,
  //for next time through the loop
  lastButtonState = buttonState;
//modulus
  if (buttonPushCounter % 4 == 0) {
  //  digitalWrite(ledPin, HIGH);
  } else {
 //  digitalWrite(ledPin, LOW);
  }


   if (counterNew < 53) {
     analogWrite(ledPin, brightness);  
  // change the brightness for next time through the loop:
  brightness = brightness - fadeAmount;
  // wait for 30 milliseconds to see the dimming effect  
  delay(delayamount);
        counterNew ++;
    }

  /*
  if (counter < 52) {
  analogWrite(ledPin, brightness);  
  // change the brightness for next time through the loop:
  brightness = brightness - fadeAmount;
  // wait for 30 milliseconds to see the dimming effect  
  delay(30);  
counter++;
  }
  */


  Serial.print(counter);
}

Monday, 5 March 2012

Prototyping: Teddy Share Full-Size

I am going to make a full-sized version of the Teddy Share concept. To extend from the prototype from yesterday, i am going to make an example where the two physical objects are different i.e. where the parent has a different object to the child. This could be an option for where the parents object needs to be more durable or inconspicuous.

The first thing to do is make fritzing models of the last xBee prototype i made for reference purposes.







The next thing is to work out the functional requirements for this prototype:

1. Needs to indicate presence
2. Needs to have a way to share the pre-recorded stories
There is an option for the parent to simply send a command to the child i.e. to put a certain track onto an m3 player rather than actually remote controlling said mp3 player. This prototype will be made without remote control functionality and will instead have an LED screen which will display a number when a button is pushed. There should be two different story options: 'Goldilocks' and 'The three bears'. So therefore
2a. Two labelled buttons on the parents device that will play one of two stories
2b. an LED screen that can display numbers
3. Some kind of instruction manual (eventually)

This prototype builds on the Design Evolution exercise by Matt Ward. Tactile interaction is important, and rather than have a textual input there are button inputs.

Again i will use Mill Moggridge's 4 step Interaction Design Process. I am doing this because it helps clarify ideas and forces the designer to be specific about what they are trying to do. This is useful both to the designer and the people that they are designing for. It allows me to connect my motivation to the end outcome and ensure the appropriateness of the design.  A clear context of use has emerged and it can revert back to other contexts and have multiple applications. The user base must be fully researched.

1. Motivation - errors or ideas
2. Meaning-metaphors and scenarios
3. Modes-models and tasks
4. Mappings-displays and controls

Case Study: The 'Teddy Share'

1. Motivation: Parents are separated from their children and miss out on crucial time with their parents.
2. Metaphor and scenario: I want to make something that is like being able to send your child a bedtime hug from far away. A busy parent can still interact with their child even if they are not able to make a phone call for a long enough period of time to read a bedtime story.
3. Model and task: The parent is connected to the child, and it creates a sense of togetherneess. Tasks:Set up the connection, notify eachother when they are present, trigger the stories. Prerecording of the stories will have to be done at some point. Should there be an online resource of printable stories that come with the set?
4. Display and control: Tactile operation. In this prototype there will be no remote control sound but a track number will come up on an LCD screen. 


I am planning on building on the current system to make it appropriate for the new prototype. I need to get the numeric LED screen working 


This is a tutorial about how the LCD screen works. As i am only going to use one number i can use less pins. I could also crate my own library to control the numbers in a more visual way. This is the datasheet for the component http://www.sparkfun.com/datasheets/Components/LED/7-Segment/YSD-439AK2B-35.pdf


12:00 The first thing i am going to do is wire up the LED screen and test it on a board. 


12:30 The display isnt working at all, I cant even get it to turn on. I believe that the whole board needs to be wired up so I am going to use another option: light indicators.






Two  labelled LEDs will indicate which story should be read. If the button is pushed one the first LED is on. If it is pushed again the second LED will turn on.


The first thing i did was add another two LED s to the recieving board and a push button to the communication board. I am mocking up a one-way presence indicator at the moment but this will be expanded to two ways next. The next step was setting up controls. I get the new push button to send a 'C' whenever it was pushed which would write 'cinderella' to the corresponding serial monitor. Once this was tested and worked correctly i then had to get the button to control the two green LED's. The code will work on the receiving board so no more has to be done to the communicator board.

Each button corresponds to a different story and they turn a different light off.


I managed to get the light indicators working. As the toy didnt arrive, i made a card mockup and plugged the sensors in. I am using a LDR to sense presence. The parents device is ergonomic and handheld.


Below: The prototype wiring




Below: The wiring behind a drawing of the two interactive objects.






A short video of the functionality: the nose flashes occasionally when it senses presence




To expand on this the sensors will be soldered into long wires and placed inside cuddly toys.


As soon as the toys arrive i will do this.

Sunday, 4 March 2012

Prototyping: Stop Motion Adverrt

Following on from research into similar technologies and further cognitive psychology research i am making e a stop motion animation advert for the product being used. This is a type of design fiction and its purpose is to bring the product alive and show that it how it could work. Also part of the purpose is whilst 'acting out' the scenario, ideas can develop and problems can be worked out. It is a form of non-functional prototyping. I plan to expand on the ideas developed with this prototype and to build a functioning teddy bear prototype tomorrow.

A decision needs to be made about which scenario to choose. There was the option to take the scenarios to users, but this has been decided against as the stop motion animation itself would be presented to users to spark further ideas and discussion.

I decided to choose the 'Teddy Share' concept due to the existence of similar technologies and the general appeal of the concept. I feel it is one of the more powerful concepts and that users would be able to immediately identify the necessity of such a product to the context it is in and then apply it to their own lives. Some of the other concepts have possible preferable alternatives i.e. using a mobile phone for 'The Chair' scenario to keep each-other updated.

To make the stop motion animation I am using an SLR camera, a lamp, paper and some purple plasticine. It's something i've never done before and I am building on general modelling techniques from tutorial sessions in the first and second years. This is an interesting tutorial on the infrasturcture of more complex models. I am going to be using very small models with little or no facial animation-mainly body animation so internal support is not necessary especially as i wont be reusing them.

The first stage is to build the background.

I used two stock images from the internet and edited them slightly. This will save time as they backgrounds are purely illustrative and what happens in from of them is what is important.




The next step is to make the characters. I would imagine that it would be two parents, child and two interactive objects. I will use teddy bears as in the cartoon strip.

Scene A: Child in bed, being tucked in by mum
Scene B: Dad away from home sitting on the sofa

The advert is not specific as to the reason why the parent is away from home. This will encourage users to appreciate the fact that it is an open concept.

The backgrounds were folded so they stand up by themselves. I put a piece of blank white paper into the scene as the floor. I used black and white backgrounds in to help the models stand out and also to create a cartoon feel.

The scenario was acted out with the plasticine characters in a very similar way to the cartoons. Doing this immediately brought up new options for tactile interactions i.e. squeezing an ear to play a certain track. Feedback was also important: should a display show what is actually being played. Is there another way? Another problem that was identified was whether the other parent would want their partner object to be a teddy bear at all? The set will be reused for user testing tomorrow and they will be able to quickly model their own alternative devices and possibly show how they would use the device.

The stills were edited using windows live movie maker.

It was decided not to do a 24-frame stop motion animation and instead do a key frame animation which is like the scenarios done before, but with more detail. It illustrated the concet just as well, but saved a lot more time.



The advert was not storyboarded as i had the general cartoon strip to refer to. Doing it this way allowed me to explore new ideas as the situation occurred. One of these was the idea that the parent could squeeze the teddy bears ear to play a particular song. This would have to be noted down somewhere. Another option is for the other parent to hold up the storybook that the parent is reading from to make it a more visual experience.

This was successful in illustrating the concept and will be introduced to users. The set will be used as a scenario prototype and also be introduced to users who can then manipulate the set easily and model their ideas. This will be recorded on video.

The next stage is to make a full-sized working teddy bear prototype. A teddy had been ordered from Amazon and should be large enough to hold the wiring. It will arrive tomorrow.