The Final Project :

Cube Inside Square : A Foldable Sitting System

Used Processes

Additive Manufacturing : 3D Printing

Subtractive Manufacturing : Laser Cutting

Subtractive Manufacturing : CNC Cutting

Input Devices

Output Devices

Outsourced Parts

The Board

The board I used here is the version 3 of the board I previously used in the electronics assignments earlier.

n&c

The Code - Test

During Output devices, I wrote this code to use the touch sensor and ultrasonic sensor to run the motor exactly as I wished to for my final project.

#define ctsPin A1 //defines input pin
const int trigPin = A2; 
const int echoPin = A3; //Constant Integer value
long duration;
int distance; 
int ledPin = 13;
int m1 = 6;
int m2 = 7; defines the specified pin numbers as integers

void setup()
{     
  Serial.begin(9600);     // Starts the serial communication
  pinMode(ledPin, OUTPUT); // defines output
  pinMode(m1, OUTPUT); // defines output
  pinMode(m2, OUTPUT); // defines output
  pinMode(ctsPin, INPUT); // defines input
  pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
}

void loop() // starts the loop
{     
  digitalWrite(trigPin, LOW); 
delayMicroseconds(2);  
digitalWrite(trigPin, HIGH);
delayMicroseconds(10); // Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2; // Calculating the distance
Serial.print("Distance: ");
Serial.println(distance); // Prints the distance on the Serial Monitor
  int ctsValue = analogRead(ctsPin);     

  if (ctsValue >= 400  && distance >6) // condition 1
  {    
    digitalWrite(ledPin, HIGH);   
    digitalWrite(m1,HIGH);
    digitalWrite(m2,LOW);  // output
    Serial.println("TOUCHED");  // Output in serial monitor

  }   
  if ( distance <5)  //condition 2
  {     
    digitalWrite(ledPin,LOW);  
    digitalWrite(m2,LOW);
    digitalWrite(m1,LOW);    // output
    Serial.println("not touched");  // Output in serial monitor

  }
  else // condition 3
  {
    digitalWrite(ledPin,LOW);  
    digitalWrite(m2,LOW);
    digitalWrite(m1,LOW);  // output
  }
}

Here, the ultrasonic will be fixed in front of the chair so the chair does not unfold on a person standing in front of it. The touch switch won’t take an input in th event of someone standing in front.

Project Slide

input

Presentation Video

Summary

Hence, the final design is not what I had planned, but after a roller coaster ride for the last few days, it finally worked. I didnot want to use the cables earlier as I wanted the mechanism to be invisible. But later I realised it was the right way to go considering the motor I had and the load of the chair. The chair weighed about 9.5 kgs which was about 20-30% more than my expectation.

Since the parts of the chair were designed to be used in a different way, the ergonimics of the chair havent come out perfectly. That is the first improvement it needs. The mounting box too is designed of this size to house the gear mechanism. For thr cable mechanism, I could make a much smaller mount and it could still function. These will be the first improvements I plan to make when I make my next prototype.

Overall, even afetr a lot of hurdles, the chair functioned and it was a good first step. Hopefully next prototype will be more practical for use in the real world.

Creative Commons License
2D chair by Dhruv Thakker