loading

After several dismissive attempts (3) -- we have haphazardly weaved together an Arduino Uno with cardboard, ultrasonic sensor, servo(s) and stepper(s) to remind, pester and intolerate your posture.

This project was hobbled together as a slight against the current incarnation of the maker community that at one time had been invested in improving humanity -- now succumbed to vanity and novelty. This project demonstrates that even with little to nothing applied, useless can harbor solution. Plaguing social venues with the antithesis breeds a consequence of evolutionary latency.

Step 1: Ingredients

  1. Arduino Uno
  2. Stepper Motor (28BYJ-48 aka Crap)
  3. Stepper Driver (ULN2003)
  4. Ultrasonic Sensor (HC-SR04)
  5. Servos (High Torque)
  6. Cardboard
  7. Spite

Step 2: Are You Board?

  1. Find Cardboard
  2. Cut Cardboard
  3. Poke Cardboard
  4. Assemble Cardboard (See Photographs)

Step 3: Domo Arigato

  1. Find Electronics
  2. Connect Electronics (See Schematic)
  3. Program Electronics (See Code)
  4. Test Electronics (See Fore Head)

Step 4: Slouchy Code

// Simone Slouchy (3)
// VijeMiller
// TVMiller.com
#include <Servo.h>
#include <Stepper.h>

// Hand
const int stepsPerRevolution = 64;
Stepper hander(stepsPerRevolution, 19, 17, 18, 16);
// Shoulder
Servo shoulder;
// Elbow
Servo elbow;

// Sensor
#define trigPin 2
#define echoPin 3

// Servo Position
int pos = 30;

// What Action Next?
int state = 0;

// Distance Adjust (Version 2)
// int newdis = 0;

// Serial For  Testing
char incom = 0;

void setup() {
  Serial.begin(9600);
  shoulder.attach(12);
  elbow.attach(5);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  // Set Start Position (Servo)
  shoulder.write(15);
  elbow.write(30);
  // Stepper Starts 0
}

void loop() {

  // Sensor Sequence
  long duration, distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  // Centimeter Conversion
  distance = (duration / 2) / 29.1;
  // Print for Testing
  Serial.print(distance); Serial.println(" cm");

  // IF Slouching || > 5cm
  // But Not NOT In Chair || < 40cm
  if (distance > 5 && distance < 40) {
    if (state == 0) {
      tap();
      // Change State
      state = 1;
    }
    else if (state == 1) {
      grab();
      state = 2;
    }
    else if (state == 2) {
      assault();
      // Reset
      state = 0;
    }
  }
  delay(5000);

  // Serial For Testing
  //  if (Serial.available() > 0) {
  //    incom = Serial.read();
  //    if (incom == '1') {
  //      tap();
  //    }
  //   else if (incom == '2') {
  //      grab();
  //    }
  //    else if (incom == '3') {
  //      assault();
  //    }
  //  }

  // Reset Value (Else)
  incom = 0;
}

void tap() {
  // Map Distance for Extension (Coming Soon)
  // newdis = map(distance, 5, 20, 70, 110);

  // Extend Shoulder and Forearm
  // Open Hand
  for (int i = 0; i <= 600; i++) {
    hander.step(-1);
    Serial.println("Open");
  }
  for (pos = 15; pos <= 30; pos += 1) {
    shoulder.write(pos);
    delay(20);
  }
  for (pos = 30; pos <= 90; pos += 1) {
    shoulder.write(pos);
    elbow.write(pos);
    delay(20);
  }
  for (pos = 90; pos <= 145; pos += 1) {
    elbow.write(pos);
    delay(20);
  }
  for (pos = 90; pos <= 110; pos += 1) {
    shoulder.write(pos);
    delay(20);
  }
  delay(1000);
  // Tap
  for (pos = 145; pos >= 110; pos -= 1) {
    elbow.write(pos);
    delay(10);
  }
  for (pos = 110; pos <= 145; pos += 1) {
    elbow.write(pos);
    delay(10);
  }
  for (pos = 145; pos >= 110; pos -= 1) {
    elbow.write(pos);
    delay(10);
  }
  for (pos = 110; pos <= 145; pos += 1) {
    elbow.write(pos);
    delay(10);
  }
  // Fold Back
  for (pos = 110; pos >= 70; pos -= 1) {
    shoulder.write(pos);
    delay(50);
  }
  delay(750);
  for (pos = 145; pos >= 70; pos -= 1) {
    elbow.write(pos);
    delay(20);
  }
  for (pos = 70; pos >= 30; pos -= 1) {
    shoulder.write(pos);
    elbow.write(pos);
    delay(30);
  }
  for (pos = 30; pos >= 15; pos -= 1) {
    shoulder.write(pos);
    delay(30);
  }
  for (int i = 0; i <= 600; i++) {
    hander.step(1);
    Serial.println("Close");
  }
}

void grab() {
  // Open Hand
  for (int i = 0; i <= 600; i++) {
    hander.step(-1);
    Serial.println("Open");
  }
  for (pos = 15; pos <= 30; pos += 1) {
    shoulder.write(pos);
    delay(20);
  }
  for (pos = 30; pos <= 90; pos += 1) {
    shoulder.write(pos);
    elbow.write(pos);
    delay(20);
  }
  for (pos = 90; pos <= 145; pos += 1) {
    elbow.write(pos);
    delay(20);
  }
  for (pos = 90; pos <= 110; pos += 1) {
    shoulder.write(pos);
    delay(20);
  }
  delay(1000);
  // Close Hand
  for (int i = 0; i <= 250; i++) {
    hander.step(1);
    Serial.println("Close");
  }
  // Lower On Sloucher
  for (pos = 145; pos >= 115; pos -= 1) {
    elbow.write(pos);
    delay(30);
  }
  // Pull Back
  for (pos = 115; pos >= 80; pos -= 1) {
    shoulder.write(pos);
    elbow.write(pos);
    delay(30);
  }
  // Open Hand
  for (int i = 0; i <= 250; i++) {
    hander.step(-1);
    Serial.println("Open");
  }
  // Extend Forearm
  for (pos = 80; pos <= 145; pos += 1) {
    elbow.write(pos);
    delay(30);
  }
  // Fold Back
  for (pos = 80; pos >= 50; pos -= 1) {
    shoulder.write(pos);
    delay(40);
  }
  for (pos = 145; pos >= 50; pos -= 1) {
    elbow.write(pos);
    delay(30);
  }
  for (pos = 50; pos >= 30; pos -= 1) {
    elbow.write(pos);
    shoulder.write(pos);
    delay(40);
  }
  for (pos = 30; pos >= 15; pos -= 1) {
    shoulder.write(pos);
    delay(40);
  }
  // Close Hand
  for (int i = 0; i <= 600; i++) {
    hander.step(1);
    Serial.println("Close");
  }
}

void assault() {
  for (int i = 0; i <= 600; i++) {
    hander.step(-1);
    Serial.println("Open");
  }
  for (pos = 15; pos <= 30; pos += 1) {
    shoulder.write(pos);
    delay(20);
  }
  for (pos = 30; pos <= 90; pos += 1) {
    shoulder.write(pos);
    elbow.write(pos);
    delay(20);
  }
  for (pos = 90; pos <= 145; pos += 1) {
    elbow.write(pos);
    delay(20);
  }
  for (pos = 90; pos <= 110; pos += 1) {
    shoulder.write(pos);
    delay(20);
  }
  delay(1000);
  for (int i = 0; i <= 250; i++) {
    hander.step(1);
    Serial.println("Close");
  }
  for (pos = 145; pos >= 115; pos -= 1) {
    elbow.write(pos);
    delay(30);
  }
  for (pos = 115; pos >= 60; pos -= 1) {
    shoulder.write(pos);
    elbow.write(pos);
    delay(30);
  }
  for (int i = 0; i <= 250; i++) {
    hander.step(-1);
    Serial.println("Open");
  }
  for (pos = 60; pos <= 80; pos += 1) {
    elbow.write(pos);
    delay(30);
  }
  delay(1500);
  for (pos = 60; pos <= 80; pos += 1) {
    shoulder.write(pos);
    delay(20);
  }
  for (pos = 80; pos <= 115; pos += 1) {
    shoulder.write(pos);
    elbow.write(pos);
    delay(5);
  }
  for (pos = 115; pos <= 135; pos += 1) {
    elbow.write(pos);
    delay(5);
  }
  delay(500);
  for (pos = 115; pos >= 80; pos -= 1) {
    shoulder.write(pos);
    delay(10);
  }
  for (pos = 135; pos <= 80; pos += 1) {
    elbow.write(pos);
    delay(30);
  }
  for (pos = 80; pos >= 30; pos -= 1) {
    shoulder.write(pos);
    elbow.write(pos);
    delay(40);
  }
  for (pos = 30; pos >= 15; pos -= 1) {
    shoulder.write(pos);
    delay(40);
  }
  for (int i = 0; i <= 600; i++) {
    hander.step(1);
    Serial.println("Close");
  }
}

Step 5: Notations

1. 28BYJ-48 are cheap bcz they are in fact, rubbish -- do not be fooled by reviews documenting "high torque" and "power" bcz they fail to mention they only used these stepper motors to propel insignificantly sized wheeled robots a few paces before over heating and seizing.

2. Per my review above (Notation 1) may I suggest the alternative of either the purchase of or the modification of a servo to operate at 360 degree rotation -- ref. http://tvmiller.com/index.php?entry=entry160123-07...

3. A modified version of this code applied distance reference to alter the position of the shoulder servo relative to the actual distance of the sloucher -- due to impatience, disinterest and coherence of my typical distance, the code is commented but easily accessible.

Hello there!<br/><br/>We're glad you want to share something with the Instructables community!<br/><br/>And we’re here to help you out.<br /><br />In order to be published live on the site, Instructables must consist of the following things:<br /><br /> - Multiple steps showing how you made your project<br/><br /> - Written instructions in each step<br/><br /> - Your own original images<br /><br />Beyond making your Instructable simply publishable, this guide (https://www.instructables.com/id/How-to-Create-a-Feature-Worthy-Instructable/) explains what is required to have your Instructables featured by our site editors. It’s very helpful, and definitely worth checking out. <br /><br />We would love to review your project again after you have made the necessary edits, and we will publish your project if it is eligible.<br /><br />If you have any questions, please feel free to ask right here!<br /><br />Best,<br /><br />Instructables Community Manager
<p>The core of my project is given by code -- the rest is exampled by the ORIGINAL photographs taken. I am not going to write, &quot;cut this piece like this&quot; 47 times when it is not needed nor the intent of my project authoring. The purpose of this open sourcing is found in the code and schematic -- as has been suitable for the previous 31 projects numerous people have found acceptable. Please re-review your requirements.</p>

About This Instructable

51views

1favorite

License:

Bio: Privateer
More by TVMiller:Arduino Splash Resistant Toilet Foamer Arduino Motion Mute 1992 Isuzu Trooper Windshield Wiper Single Button Hack 
Add instructable to: