Uncategorized – Intro to Physical Computing: Student Work Fall 2020 https://courses.ideate.cmu.edu/60-223/f2020/work Intro to Physical Computing: Student Work Tue, 03 Nov 2020 05:15:50 +0000 en-US hourly 1 https://wordpress.org/?v=5.4.15 Drink up! https://courses.ideate.cmu.edu/60-223/f2020/work/drink-up/ Tue, 03 Nov 2020 05:15:17 +0000 https://courses.ideate.cmu.edu/60-223/f2020/work/?p=11720 Your water drinking water reminder and monitor!

Time-lapse of drinking a water bottle – Sorry the video quality is bad, I had to compress it a lot to upload it

 

The overall image of the project

 

This is an image of the LCD displaying the amount of water drank

 

The project in action!

 

Decision points:

  • Creating a laser cut box for the exterior of my project. This was a big decision point for me as I was debating on just using a cardboard box but realized the need for a sturdy box to use the load cell. Hence, I decided laser cut the box
  • I wanted to make my device to reset the number of bottles drunk every day, but I was unable to make the clock part work with my device and so decided it was not as important as working on the rest

Process Pictures

Load cell assembly – Load cell is placed between two wooden planks and attached to each of the planks on opposite sides of the cell to allow for bending when a wait is applied.

Image of the circuit inside the box

Clamps being used to hold the wooden box together waiting for the wood glue to dry up

 

Responses to other’s feedback

Your end product looked really nice and was a great idea. Like someone said it would be nice if this was a coaster that you could bring with you “

“I think your project is super helpful (as someone who doesn’t drink water either haha) – It could be interesting to see it as an attachment to a water bottle, like an attachable base, or have it be incorporated into your primary work desk so it’s almost indetectable.”

Since all my critique was essentially the same, I will respond to all of them at once. The reason I chose the topic, as it was pointed out in my critique, is because I need to force myself to drink more water regularly, and I am really glad that there are people other than me who think this is helpful and a good idea. The common feedback that I got from the critique as well as during the presentation was that the project would be better if I could make it smaller and more portable. I definitely like the idea of a coaster or an attachable base. However, the idea of embedding it into my work desk is something new that I never thought of but I really like. It is definitely something I would like to explore as a next step.

 

Self critique:

Overall, I think I am quite happy with the way my project turned out. I am specifically very happy with how the exterior of my project, the laser cut box, looks. This is because design and presentation is something I am very new to, and I did not expect it to turn out the way it did. In addition, it took me quite a bit of time to figure out how to make the design for the laser cutting. 

The one part I am not as happy with is that I was unable to get the LCD to reflect the exact volume of water that was consumed. This was one of the goals I was very excited about, but I was unable to figure out exactly what the conversion from load cell readings to volume in ml was.

 

What I learned:

There were a lot of different skills and concepts I learned through this project. Like I mentioned before, how to create laser cutting designs, how to make precise measurements for the drawings as well as how laser cutting works is one of the big learnings I had from this project. In addition, just thinking about the project not just in a technical way, as I have been doing all along, but as a product is a completely new lens I adopted through this project.

I also found the code for the project more challenging than normal, especially the part where I had to calculate the volume of water drank. This was quite difficult because I had to account for cases where the bottle was no longer on the load cell, when the volume of water decreased, as well as when the volume increased (when the bottle is refilled). In order to account for all of this, I had a lot of variables that I needed to keep track of which got very confusing at first. Later, however, I created a flowchart of how the code should work in each of the cases listed above, after which the coding process got a lot smoother.

In addition, I also had a little bit of trouble soldering my wires together. For some reason, the tip of my solder would not heat up, but the areas just below the tip would heat up just fine. It took me a while of thinking I didn’t know how to solder and thinking the solder wasn’t hot enough to realize this behavior, after which the process was easier, though it was still harder to use the thicker part of the solder rather than the tip.

 

Next Steps:

My next steps would be to build a more compact and portable version of the project, as well as better calculate the volume of water drank.

 

Schematic:

/********************************
 * Project: Drink up!
 * By Sruti Srinidhi
 * 
 * The code below takes a load cell reading and 
 * outputs the volume of water drank, lights
 * up LEDs indicating the number of bottles
 * completed as well as sounds an alarm 
 * if water has not been drank for a while
 * 
 * pin   | mode   | description
 * ------|--------|------------
 * 7      output     LED indicating bottle drank   
 * 8      output     LED indicating bottle drank 
 * 9      output     LED indicating bottle drank
 * 11     input      Push button switch for calibration 
 * A1     input      Load Cell Pin
 * A0     input      Load Cell Pin
 * 3      output     Speaker Pin
 * 
 * 2      output     LCD BD7 Pin 
 * 4      output     LCD DB6 Pin
 * 5      output     LCD DB5 Pin 
 * 6      output     LCD DB4 Pin 
 * 10     output     LCD Enable Pin
 * 12     output     LCD Register select Pin
 * 
 * HX711 module by Rob Tillaart
 */

#include "HX711.h"
#include <LiquidCrystal.h>

const int BOTTLE1LEDPIN = 7;
const int BOTTLE2LEDPIN = 8;
const int BOTTLE3LEDPIN = 9;
const int CALIBRATEPIN = 11;
const int LOADCELLPIN1 = A1;
const int LOADCELLPIN2 = A0;
const int SPEAKERPIN = 3;

int bottleCount = -1;
int emptyWeight = 0;
bool calibrated = false;
bool increasing = false;
unsigned long timer;
bool drinking = false;
int volumeDrank = 0;
int weightReading = 0;
long lastWeight;
long LoadCellInput = 0;

HX711 cell;
LiquidCrystal lcd(12, 10, 6, 5, 4, 2);

void setup() {
  pinMode(3, OUTPUT);
  // put your setup code here, to run once:
  pinMode(BOTTLE1LEDPIN,OUTPUT);
  pinMode(BOTTLE2LEDPIN,OUTPUT);
  pinMode(BOTTLE3LEDPIN,OUTPUT);
  pinMode(CALIBRATEPIN, INPUT);
  lcd.begin(16, 2);
  cell.begin(A1,A0);

}


void loop() {
  lcd.setCursor(0, 0);
  //Ask to calibrate if it is uncalibrated
  if (!calibrated){
    lcd.print("calibrate");
  }
  else {
    // Show volume drank on lCD
    lcd.print("Volume drank:");
    lcd.setCursor(0, 1);
    lcd.print(volumeDrank);
    lcd.setCursor(6,1);
    lcd.print("ml");
  }
  LoadCellInput = cell.read()/1000;
  //Water drank if the bottle is lifted off the load cell
  if (LoadCellInput < emptyWeight){
    timer = millis();
  }
  else{
    //Srinking water
    if (LoadCellInput < lastWeight){
      increasing = false;
      if (calibrated){
        volumeDrank = volumeDrank + lastWeight - LoadCellInput;
      }
     }
    
    //Bottle is being replaced
    else if (LoadCellInput > (lastWeight + 300)){
        increasing = true;
        bottleCount++;
      }
    
    lastWeight = LoadCellInput;
  }
  
  
  //Sound alarm if water has not been drank in a while
  if ((millis() - timer) > 900000){
    tone(SPEAKERPIN,200);
  }
  else {
    noTone(SPEAKERPIN);
  }
  
  //Calibrate
  int calibrate = digitalRead(CALIBRATEPIN);
  if (calibrate == HIGH){
    calibrated = true;
    emptyWeight = LoadCellInput;
    bottleCount = -1;
    volumeDrank = 0;
    digitalWrite(BOTTLE1LEDPIN,LOW);
    digitalWrite(BOTTLE2LEDPIN,LOW);
    digitalWrite(BOTTLE3LEDPIN,LOW);
  }else{
    //Turn on LED to show bottle count
    if (bottleCount >= 1){
      digitalWrite(BOTTLE1LEDPIN,HIGH);
    }
    if (bottleCount >= 2){
      digitalWrite(BOTTLE2LEDPIN,HIGH);
    }
    if (bottleCount >= 3){
      digitalWrite(BOTTLE3LEDPIN,HIGH);
    }
  }
  
  weightReading = LoadCellInput - emptyWeight;
}

 

 

]]>
Posture Corrector https://courses.ideate.cmu.edu/60-223/f2020/work/posture-corrector/ Mon, 02 Nov 2020 03:20:17 +0000 https://courses.ideate.cmu.edu/60-223/f2020/work/?p=11671 This assistive device uses spine position detection and tension sensing to detect slouching in order to remind you and ensure your torso is always held in a correct and healthy posture.

Final Product

The above video shows the posture corrector in action, where my hand movements simulate a person slouching, and the faint vibrating noise being the alert for the wearer to correct their posture.

Posture Corrector in action being worn on my back

Clearer picture of the overall finished product

Closeup of the accelerometer used for position detection, the conductive thread interweaved with the middle strap for tension detection, and the pancake motor for a vibration alert

Process

A lot of thought went into how exactly to detect slouching for my assistive device. I ended up with trying two different measures, separated into version 1 (V1) and version 2 (V2) based on their complexity of implementation. V1 was a simple accelerometer to detect the angle of my spine, and V2 involved somehow using tension to detect when my shoulders were slumped forward. The idea that developed was that having either method of measurement would be acceptable for the device, but having both would be nice.

Beginning stages of my ideation for the posture corrector – a sketch

In my ideation sketch, I purposely left the tension sensor area of the sketch vague and blank because I was unsure how to approach this, as it was the most complex part of my assistive device. After looking into load cells and other related sensors, I was directed to a homemade version using conductive thread that changed resistance depending on how stretched out it was. This significantly increased the complexity of the sensor, which later affected the effectiveness of my final outcome.

The initial stages of building – the general shape structure is there and I began wiring/testing code for the electronics to mount

Wiring up all the other parts and completing V1 was very straightforward, however when actually implementing the tension sensor as a V2 feature, several complication and design decisions changed as a result. I was going to use an elastic band originally to connect the two platform pieces, but the need for the conductive thread to be interwoven in convoluted loops resulted in me using finger knitting as the final process to create all the straps to accommodate the homemade sensor design.

A shot of the device almost completely assembled and mounted – only the tension thread was left to wire up completely

Discussion

Upon reflect on my overall project and the process through which I arrived at the final end result, I was definitely challenged in various aspects along the way. From the initial ideation stage to actually building the device on my own, given the amount of creativity and freedom we were given with the project, I realized the actual difficulty in translating an idea into a solid implementation plan and actually building it according to the plan.

While I am proud of the fact that I was able to build almost everything according to the original idea after I finalized my sketch, especially in terms of functionality, I was very dissatisfied with my general ability to build something sleek and elegant. My end product functioned properly and matched my sketch in terms of the components, with the only shortcoming being the complex tension sensor working unreliably at times, but I feel the general aesthetic was clunky and looked like it was an inconvenience. Coding and wiring came easily to me, but this made it apparent that a significant limitation of mine was designing.

In fact, the comments I received as critique both concerned the aesthetics of the product. Someone suggested that “this could be awesome integrated into a jacket or some type of clothing for more discrete wearing,” which I recognized as a potential solution to help improve the appearance of the product and make it more pleasing to view. Another person asked me “Any ideas for organizing the wires in your project? Is there any danger of getting disconnected while you are moving around?,” which prompted me to think about the fact that wiring placement was definitely a detail I would pay more attention to in the future for general design considerations for the user.

Other than these specific suggestions, looking back, I definitely would have spent more time in the planning stage on all the miniscule details concerning design decisions specifically, and put more effort and importance into the prototype, especially for the base structure that would hold everything together.

Technical Information

Schematic:

Schematic diagram for posture corrector

Code:

/*
 * Project 2: Assistive Technology
 * Arleen Liu
 * 
 * Collaboration: Plusea, for the tension sensor idea using
 * conductive yarn.
 * 
 * Challenge: Figuring out how to implement the tension sensor in
 * a stable and consistent manner to maximize its effectiveness
 * 
 * Next Time: For projects with many components, test each 
 * individual part more thoroughly to make the assembly portion
 * of the building process more smooth.
 * 
 * Description: An accelerometer detects the angle of the spine 
 * and a tension sensor built from conductive thread uses the 
 * difference in resistance to detect shoulder slumping, and if 
 * either measurement goes beyond a certain tuned threshold, the
 * pancake motor vibrates to give an alert.
 * 
 * Pin mapping: 
 * 
 * pin | mode | description
 * ----|------|------------
 * 6    OUTPUT pancake motor
 * A0   INPUT  accelerometer 
 * A1   INPUT  accelerometer 
 * A2   INPUT  accelerometer 
 * A3   INPUT  tension sensor
*/ 

const int X_PIN = A2;
const int Y_PIN = A1;
const int Z_PIN = A0;
const int YARN_PIN = A3;
const int MOTOR_PIN = 6;

// Volts per G-Force
const float sensitivity = 0.206;
const float threshold = -3.92;
const int threshold2 = 700;

void setup() {
  //Initializing pins
  pinMode(MOTOR_PIN, OUTPUT);
  //analogReference(EXTERNAL);
  pinMode(X_PIN, INPUT);
  pinMode(Y_PIN, INPUT);
  pinMode(Z_PIN, INPUT);
  pinMode(YARN_PIN, INPUT);
  
  //Initializing other elements   
  Serial.begin(9600);
}

void loop() {

  float x;
  float y;
  float z;
  
  // Read acceleration pins and handle sensitivity
  x = (analogRead(X_PIN) - 512) * 3.3 / (sensitivity * 1023);
  y = (analogRead(Y_PIN) - 512) * 3.3 / (sensitivity * 1023);
  z = (analogRead(Z_PIN) - 512) * 3.3 / (sensitivity * 1023);
  Serial.print("x: ");
  Serial.print(x);
  Serial.print(", y: ");
  Serial.print(y);
  Serial.print(", z: ");
  Serial.println(z);
  Serial.println(analogRead(YARN_PIN));

  int aDist = sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2));

  if (y > threshold || analogRead(YARN_PIN) > threshold2) {
    digitalWrite(MOTOR_PIN, HIGH);
  } else {
    digitalWrite(MOTOR_PIN, LOW);
  }

  delay(10);
}

 

]]>
Arduino Air Bonsai Levitation https://courses.ideate.cmu.edu/60-223/f2020/work/arduino-air-bonsai-levitation/ Wed, 02 Sep 2020 21:13:28 +0000 https://courses.ideate.cmu.edu/60-223/f2020/work/?p=11366 Title: Arduion Air Bonsai Levitation

Author: funelab

 

Short Description: This device uses neodymium magnets to suspend a plant in a magnetic field. The arduino is being used to connect sensors that read the magnetic field levels based on the position of the floating plant. The magnetic field is then corrected in order to maintain floating status.

Response: This is a fantastic project! Very cool to put a plant there. What I might do differently would potentially be to add some sort of lighting  into the build. Floating objects are very cool and this one has a very nice, clean design, but something about LEDs in the dark could take this to the next level. Might also add a design for a phone case that could protect your phone if you wanted to float that in the field.

]]>