Assignment 4: Reading and posting about kinetics

Assignment 4: Start investigating kinect input and output

Reading assignment from Make It So

  • Chapter 2 Mechanical Controls
  • Chapter 5 Gesture
  • Chapter 9 anthorpomorphism
  • Chapter 10 communiation

Find some examples of kinetic interaction — not reaction — and post to looking out

Email me with how you feel about crits on Ttu if you can use A10 on Tue

“Fore!” Wristband

Background

“Nowadays, most golfers yell “fore” only after they’ve hit an errant shot toward an unsuspecting golfer, but the term which translates to “watch out!” or “heads up!” was originally intended to be used before teeing off.”

—- quote from here

Golf  balls can travel really fast in the air, and hitting by golf balls can cause from severe swellings to permanent damages. When you are playing at the golf course, you yell “Fore!” when:

    • you didn’t wait for the group in front of you to leave(rude!)
    • you hit a really bad ball and you are hitting onto other fairways(not where your ball is suppose to go), and you are not sure whether there are people there.

Because you might hit/injure them, or even just scare them.

When you hear “Fore!” on the golf course, there is usually less than a second for you to react. There are a few things that you can do:

    • identify where the sound comes from
    • hide at a nearby golf cart or tree
    • put your hands on your head
    • stay low so that the ball does not hit your head

But usually, it’s hard to identify where the sound comes from within such a short period of time, so one usually attempts to do all of above very confused and hope for the best.

Problem

Ever since the early times in the sport of golf, people rely on yelling and hearing “Fore!” to warn each other about a flying ball coming at their directions. This has issues:

    • People with hearing problems don’t receive the warning
    • There is not enough time for people to react to identify where the sound comes from

Proposed Solution

My proposed solution is a “Fore!” wristband. Everyone on the golf course will be wearing it, and it can do the followings:

    • Sense when “Fore!” warning is made
    • Communicate the location/direction of the warning to other wristbands
    • Display the direction of the warning

For proof of concept, I will(still don’t have my hardwares yet) use an accelerometer to detect whether a swing is made, a sound sensor to detect whether there is a loud yelling immediately following the swing, and an 8×8 led matrix for the display.

Discussion

The prototype design has a few flaws:

    • The sound sensor is chosen so that the golfer does not need to make any additional actions of notify other golfers, but the sound sensor only detects for sound above a certain threshold. It’s common for golfers to yell things other than “Fore!” immediately after the swings. For surrounding golfers, the issue should not be too big because the distance makes their yellings quieter. But for the golfer wearing the wristband, this would raise a problem of sending false alarms to other golfers. Possible solutions can be running speech recognition to ensure that “Fore!” is the word, or adding some additional conditions to avoid false alarms.
    • In my prototype, I omitted the wireless communication. But the communication can cause some problems if the wristbands are put in use in the real world, since it’s not uncommon for golf courses to have poor signals. So radio signals set up and maintained by the golf  course may be a good solution.

Sensing glove for Scuba Divers

Problem

Diving is an exciting and enjoyable sport. However, it can also be dangerous if the divers are not ware of the condition of their equipment, their companions, and the environment. Most divers are trained to understand their equipment well, but it is still difficult to keep track of one’s diving buddies and the environment even for experienced divers. It becomes quite difficult to keep track of others when a diving group has 3 people, and it is difficult to know one’s surrounding when the visibility is low in a cave or at night. Most of the time, the divers have to focus on what is ahead of them. Frequent checking around for people and surrounding would slow down the movement and distract the divers.

Solution

I previously saw that LED fibers are now integrated into some designs of the cloths. Therefore, I have this idea that a glove with LED on the back can be used as a sensing/locating system to tell the divers the positions of their companions of whether there is a rock or hard surface behind them. The idea is that The diver will wear 4 ultrasonic ranger for the front, back, left, and right. When the sensor detects objects in a certain range, a signal will be sent to the glove and shown as a light-up LED.

The sensing glove

With the information shown on the divers’ glove, they no longer need to look back or around to check on the situation. More importantly, this will be very useful during night dive when the only visible area is 2-4 m pointed by the flashlight.

Proof of Concept

Because of the lack of materials, I only use 1 ultrasonic sensor to stimulate the function of one of the four ultrasonic sensor. I originally planned to use a LED matrix as it is more accurate to the original design. But LEDs were used instead because I cannot get one of the LED matrix. The LEDs represent the angle or direction of the detected object, with the bottom LED being 0-30 degree and the top LED being 150-180 degree. Ideally, the distance is reflected by the distance of the light-up LED from the center block. The servo motor is used to rotate the ultrasonic sensor so that objects from a wider range of angles can be detected.

The set up of the hardware

Turning sensor

I used my hand to hold the ultrasonic sensor for the stimulation because the jumpers on the sensor stop the servo motor from moving freely. I tried to mimic the rotation made by the servo motor, but error still occurs as my hand cannot synchronize perfectly with the servo motor .

Demo of the device

Code:

#include <NewPing.h>
#include <Servo.h>

#define TRIGGER_PIN  12  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     11  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 100 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
#define SERVO_PIN 10
#define LED_0  2
#define LED_30  3
#define LED_60  4
#define LED_90  5
#define LED_120  6
#define LED_150  7


NewPing Sonar_1(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

Servo Servo1; // you can call the servo whatever you want

//Timer
//Clock 1 is the timer for the servo
unsigned long clock1 = 0; // variable for timing
const int INTERVAL1 = 5; // milliseconds between updates

//Global variables
int angle;
bool bounce = true;

int direc_distance[181];
int angle_of_objects[10];

//Functions
//Sweeping the servo motor
void sweep_servo() {
  if (bounce == true) {
    angle = angle + 1;
    Servo1.write(angle);

    dir_dis(angle);

    if (angle == 180) {
      bounce = false;

      clear_position();



      //Serial.print("0-180: ");
      check_position();


      Serial.println(angle_of_objects[0]);
      //Serial.println(angle_of_objects[1]);
      show_position();


    }
    return;
  }

  if (bounce == false) {
    angle = angle - 1;
    Servo1.write(angle);
    dir_dis(angle);

    if (angle == 0) {
      bounce = true;
      clear_position();

      //Serial.print("180-0: ");
      check_position();

      Serial.println(angle_of_objects[0]);
      //Serial.println(angle_of_objects[1]);

      show_position();


    }

  }


}

//The function that records the angle and the distance to the array direc_distance
void dir_dis (int angle) {

  direc_distance[angle] = Sonar_1.ping_cm();
}

void check_position() {
  //The for loop to find the angles of the locations of the objects

  int index;
  //Serial.print(direc_distance[0]);
  for (int i; i < 181; i++) {
    int start_angle;
    int end_angle;
    int mid_angle;

    if (direc_distance[i] != 0) {
      start_angle = i;

      //Serial.print(i);
      //Serial.print(",start angle:");

      while (direc_distance[i] != 0 and abs(direc_distance[i + 1] - direc_distance[i]) < 20) {
        i = i + 1;
        //Serial.println(direc_distance[i]);
        if (i == 180) {
          break;
        }
      }
      end_angle = i;

      mid_angle = (end_angle - start_angle) / 2;


      //Serial.println(start_angle);
      //Serial.print(",end angle:");
      //Serial.print(end_angle);
      //Serial.print(",mid angle:");
      //Serial.println(mid_angle);

      //Serial.print("This is mid angle:");
      //Serial.println(mid_angle);
      angle_of_objects[index] = mid_angle;
      if (index = 9) {
        return;
      }
      index = index + 1;
    }

  }
}

void light_LED(int angle) {
  if (angle == 0) {
    digitalWrite(LED_0, HIGH);
  }

  if (angle == 30) {
    digitalWrite(LED_30, HIGH);
  }

  if (angle == 60) {
    digitalWrite(LED_60, HIGH);
  }

  if (angle == 90) {
    digitalWrite(LED_90, HIGH);
  }

  if (angle == 120) {
    digitalWrite(LED_120, HIGH);
  }

  if (angle == 150) {
    digitalWrite(LED_150, HIGH);
  }

 

}

int select_angle(int angle) {
  if (angle < 30) {
    return 0;
  }

  if (angle >= 30 and angle < 60) {
    return 30;
  }


  if (angle >= 60 and angle < 90) {
    return 60;
  }

  if (angle >= 90 and angle < 120) {
    return 90;
  }

  if (angle >= 120 and angle < 150) {
    return 120;
  }

  if (angle >= 150 and angle < 180) {
    return 150;
  }
}



void show_position() {
  //Turns off all the LED lights
  digitalWrite(LED_0, LOW);
  digitalWrite(LED_30, LOW);
  digitalWrite(LED_60, LOW);
  digitalWrite(LED_90, LOW);
  digitalWrite(LED_120, LOW);
  digitalWrite(LED_150, LOW);


  int angles[] = {0, 30, 60, 90, 120, 150, 180};

  for (int i; i < 10; i++) {
    if (angle_of_objects[i] == 0) {
      Serial.println("Done");
      return;
    }


    int angle_light = select_angle(angle_of_objects[i]);



    Serial.println(angle_light);
    light_LED(angle_light);
  }
}

//This function clears the stored angles of the positions of the objects
void clear_position() {
  for (int i; i < 10; i++) {
    angle_of_objects[i] = 0;
  }
}

void setup() {
  pinMode(LED_0, OUTPUT);
  pinMode(LED_30, OUTPUT);
  pinMode(LED_60, OUTPUT);
  pinMode(LED_90, OUTPUT);
  pinMode(LED_120, OUTPUT);
  pinMode(LED_150, OUTPUT);
 

  Servo1.attach(SERVO_PIN);

  Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.

  Servo1.write(0);
  //digitalWrite(LED_180, HIGH);
  delay(2000);



}

void loop() {




  //The servo clock
  if (millis() >=  clock1) {
    //decreases the minute value in the timer for each task
    sweep_servo();

    clock1 = millis() + INTERVAL1 ;

    //Serial.println(angle_of_objects[0]);


  }
}

 

Actually Press Start for Your Laundry/Dryer

Problem:

I was having a lot of trouble coming up with something for this crit, but thankfully (at least for me) one of my housemates had forgotten to click start on the dryer and when she went to get her clothes an hour later, they of course were still wet. With our oven, I’ve forgotten to press start multiple times since moving in a month ago and the setup is literally just inputting the baking temperature. Thankfully, it beeps a few times to let me know that I never actually pressed start. If I were deaf, listening to music, or there was a lot of noise coming in from outside though, this wouldn’t help at all. When it comes to doing laundry, simply not pressing start can be a huge drain of time. However, this crucial last step is so easy to forget in even the smallest pre-steps like inputting a baking time, but especially so for laundry considering it takes a decent amount of time to load clothes.  For washing and drying clothes, a visual notification would save a ton of time and would ensure that as long as you aren’t blind, you will know you forgot to press start regardless of your ability to hear.

Proposed Solution:

My proposed solution is to notify the user to press start with an obnoxiously flashing LED strip along the walk away from the machine so as to catch their attention easily. The device would only light the LED strip if a few conditions are met so that energy isn’t wasted and the user who loads clothes slower than an arbitrary average isn’t unnecessarily annoyed. First, clothes would have to be loaded into the machine. This could be detected by a broken IR beam at the bottom middle of the machine. Secondly, the lid must be closed. Rather than use a tilt sensor which would limit this to machines with lids that are vertical when open and horizontal when closed, I’ve chose a photo resistor as the inside of the machine will be dark when closed. Finally, the notification will only occur if the user has walked a few steps away from the machine, detected by an ultrasonic ranger, as there’s no need for it if they are standing right in front of it and very well may not have forgotten. If they’ve walked out of the room, here signified by a time elapsed and no return in front of the machine, the LED strip automatically turns off.

Proof of Concept:

This shows the intended use where in the user sees the flashing LEDs and goes back to press start.

This shows how nothing happens if the start button is pressed to begin with.

This shows how the lights turn off if you’ve left.

This shows how nothing will happen if the lid is closed but nothing is in the machine.

Photoresistor and IR breakbeam sensor in box

My Circuit

const int IRpin = 3;
int IRstate;

const int buttonPin = 10;
int buttonPressed = 0;

#include <PololuLedStrip.h>
PololuLedStrip<13> ledStrip;//LED in pin 7
const int LEDPIN = 13;
const int LED_COUNT = 10;//in full project would be a lot longer strip of LEDs
rgb_color red[LED_COUNT];
rgb_color black[LED_COUNT];

#include <NewPing.h>
int triggerPin = 12;
int echoPin = 11;
int maxDistance = 400;
NewPing sonar(triggerPin, echoPin, maxDistance);

int photoPin = A5;

void setup() {
  pinMode(IRpin, INPUT);
  pinMode(buttonPin, INPUT);
  digitalWrite(IRpin, HIGH); 
  pinMode(LEDPIN, OUTPUT);
  pinMode(photoPin, INPUT);

  Serial.begin(9600);
}

void loop() {
  IRstate = digitalRead(IRpin);
  
  int photoVal = analogRead(photoPin);
  Serial.println(photoVal);
  int distance = sonar.ping_cm();
  for (uint16_t i = 0; i < LED_COUNT; i++) {
                black[i] = rgb_color(0, 0, 0);
              }
              ledStrip.write(black, LED_COUNT);
  if (IRstate == LOW) {//broken
    //Serial.println("broken");
    //Serial.println(distance);
    //Serial.println(photoVal);
    if (photoVal < 150) {//lid closed
      if (digitalRead(buttonPin)) {
        buttonPressed = 1;
      }
      if (not buttonPressed) {
        if (distance > 10) { //would've done 91cm, ~3ft for real thing
          static int startTime = millis();
          if (millis() - startTime < 7000) {//7s for demo, but would be about 30 for actual thing
            static int blinkStart = millis();
            for (uint16_t i = 0; i < LED_COUNT; i++) {//this rotates through each LED on the strip so that each one will be red
              byte x = millis() - 20 * i;
              red[i] = rgb_color(255 - x, 0, 0);
            }
            ledStrip.write(red, LED_COUNT);
            if (millis() - blinkStart >= 10) {
              for (uint16_t i = 0; i < LED_COUNT; i++) {
                black[i] = rgb_color(0, 0, 0);
              }
              ledStrip.write(black, LED_COUNT);
              blinkStart = millis();
            }
          }
        }
        
      }
    }
  }
}

Privacy for cats

For cats, the litter box is not only a place to do one’s duty; it is also a safe space. Never stare at your cat when one’s in the litter box. Either they are there to use the toilet or for a safe space, cats feel the extreme emotional pressure when humans stare at them while they are in the litterbox.

My cat Nala is the shiest cat you will ever meet. She hides inside the litter box from Ginger, our other cat, when she gets chased. After having many occasions where we tried to look for Nala and found her in the litterbox and unintentionally interrupting her privacy, I decided to come up with a device.

This device shows you if the litterbox is occupied, and it also tells you when it needs to be emptied.

Default screen

It includes two sensors: the PIR sensor and a methane gas sensor. The PIR sensor will be placed inside the litterbox to tell one if it is occupied. The gas detector detects various types of gases that create an odor, but methane gas mainly. It tells you when the box has to be emptied.

When the gas detector detects the methane gas

When the litterbox needs to be emptied, the red LED turns on and it displays the message “Empty the box!”. Through various range testing, the adequate value that corresponded with times of the toilet being used was “110.”

When the PIR sensor detects the movement

When the cat is inside the box, the blue LED turns on and it graphically displays what the cat is doing inside the box.

When both sensors are on

This is when both sensors are activated.

 

Video demonstration of how this works:

https://drive.google.com/file/d/1c-2hyGFoSVJmicfLqxxD7Vq3-VhMbg-t/view?usp=sharing

 

Now that we  know that it works, it was time to actually get real.

For some reason, my 9V battery was not working; so I had it connect to my computer. It already told me that the box needs to be cleaned.


So I came back after cleaning; the display does not say that it needs to be cleaned anymore, so I needed to get a participant. Nala knew what was going on so I couldn’t get her inside the box, so I tried to get Ginger to be my first participant.

He seemed quite convinced, but he seemed uninterested because he already emptied his stomach before the testing.

 

The questions might be:

Why the gas detector?

-The commonly used sensor for movements would be the ultrasonic sensor; however, cats are very sensitive to sounds. So I used the PIR sensor that detects the infrared light coming from moving objects with heat.

Why do we need this to be visual?

-I have been working with cats since the introduction to physical computing class. My cat Nala is now 8 years old, so I wanted to do something fun with her and also wanted to make her life better and more convenient because all cats deserve the best life. As much as humans, cats need some privacy as well, and this gets often interrupted when we share the space. Cats can’t say “Hey I need some space”/”I need this to be cleaned” or when you find them in the litter box/private settings, their privacy is already interrupted. So I thought the mutual ground that we have is having things visual.

 

Schematic:

#include <Wire.h>
#include <LiquidCrystal.h>


//const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


int GasPin = A0; 
int CatPin = 6; 
int LED1 = 8; 
int LED2 = 7;

void setup() {

lcd.begin(16,2);
pinMode(GasPin ,INPUT); 
pinMode(CatPin, INPUT); 
pinMode(LED1, OUTPUT); 
pinMode(LED2, OUTPUT);
pinMode(CatPin, INPUT); 
Serial.begin(9600);


lcd.print("=^._.^= S");



}


void loop() {




digitalWrite(LED1,LOW);


if (digitalRead(CatPin) == HIGH){ 
digitalWrite(LED1,HIGH); 
delay(1000);
lcd.setCursor(11,0);
lcd.print("O o o");
}

else { 
digitalWrite(LED1,LOW); 
//delay(1000);
lcd.setCursor(11,0);
lcd.print(" ");
}

if ((analogRead(GasPin))<190){
Serial.println(analogRead(GasPin));
digitalWrite(LED2, LOW);
lcd.setCursor(0,1);
lcd.print(" ");
}
else {
Serial.println(analogRead(GasPin));
digitalWrite(LED2, HIGH);
lcd.setCursor(0,1);
lcd.print("Empty the box!");
}



}

Critique 1: Visual

Crit Assignment: Visual Accessibility

Goal: Use vision to make something accessible to someone without hearing or manual sense of touch.  These do not have to be physical disabilities, it could be construction works wearing hearing protection or heavy protective gloves that prevent them from having a sense of physical touch.

Find a problem and solve it.  The problem needs to have a context.

Class notes, 17 Sep 2020

Class Admin

I’ve made a request that Tuesday’s work class be held in A10.  Will email an update.

Looking Outword comments

dark skies as a source of crowd-sourced weather data, scrape data from https://darksky.net/forecast/40.4346,-79.8655/us12/en

Interfering with sensors goes back to “Dazzle Camouflag”: https://en.wikipedia.org/wiki/Dazzle_camouflage

Virag Varga’s research on devices that communicate with one another through skin: https://dl.acm.org/profile/99658719699

State machine transitions

Documenting a state machine: Omnigraffle (mac) vs. SmartDraw (win10) vs. ??? (linux) vs. whiteboard

A finite(explain) state machine needs states, transitions, and actions (transitions that do things)

Example: UI button that changes screen color has a state variable with the current color

state machines in video games, hierarchies of state machines

how do we define a transition from one state to another?

– segue: pan, wipe, blur

– alert:

– microwave ding when it’s finished heating

– countdown timer to start an event (from waiting -> running)

– elevator alerts

what can visual output replace? sound? motion?

babymonitor that translates sound to video

GFCI sound vs. click

replace sound warning with video flash

ubicoustics: http://www.gierad.com/projects/ubicoustics/

how can we replace sound from a state machine with visual queues?

what sounds are important in state machines and what sound are decorations?

keyclicks on/off phone

annoying car noises

car sounds effects

Reading/research links not discussed in class

Discuss tempo of sound

visualizing sound waves

https://vimeo.com/partitura

visualizing music:

Vibrant Data Visualizations of Famous Classical Music Scores Burst with Color

https://www.youtube.com/channel/UCRQH9-hWxELNCv47z2O5nfg

Visualization of language

ASL: https://www.handspeak.com/

Braile: http://www.brailleauthority.org/formats/2011manual-web/index.html

Visual communication examples

Arrival — read “The Story of Your Life”

the movie version: https://www.space.com/35696-arrival-movie-alien-language-explained.html

99pi episodes 50 “Deafspace” (Gaulludet) and 126 “Walk This Way” (wayfinding)

When your senses get crossed, Synesthesia

State machines

A. Ambient Umbrella

It glows when it is going to rain to remind the owner to take it out.

B. Cube

Cube is an intuitive, tangible interface for smart homes. By touching, lifting, tilting and turning, Cube allows users to adjust technological appliances such as lighting, temperature and music using a single interface.

C. Water Pilly

Water Pilly constitutes a mechanical flower that opens and closes to offer pills to people suffering from humidity-related asthma.