Arduino Door Catcher
For the 50 per cent of the population whose spatial and auditory senses are diminished by what one could only presume is due to massive brain damage caused by a series of tragic falls down several flights of stairs, this heroic ballet-ing robit will reserve your obnoxiousness from the rest of us who acknowledge that other people exist.


Ingredients
Arduino Nano
Magnetic Spring Module
MG995 Servo (3)
9G Servo
Magnet

Notations
1. 9G servos (plastic gears) torque limited - remodeled with MG995s.
2. Divvyed up the segments for printing sake - to make alterations and not rehash the entire build.
3. 33 hours remaining in the MacroFab contest - wrote a new Arduino serial testing script for multiple servos. https://hackaday.io/project/166931-arduino-door-catcher/log/166873-arduino-control-multiple-servos-thru-serial-monitor
4. MacroFab extended the deadline by 20 days - sigh of unnecessary relief. https://macrofab.com/blog/macrofab-design-contest-useless-machine-sponsored-by-mouser-electronics/
5. The door handle 'grasp' -er relies a bit on circumstance - tension must be applied by pressure to the knob to initiate rotational shift of the grasp which then applies tension to the handle permitting the turning subsequent of the turning. Got it?! Rotation tensions rotation that tensions rotation.
6. 5V 2A power supply was insufficient for VarServoSpeed code which runs servo simultaneously. Separated the Nano and magnetic module to another 5V - gnd together.
7. VarServoSpeed is magic! https://github.com/netlabtoolkit/VarSpeedServo

8. MacroFab contest 'entry' suffixed to the video -> The Door Uncloser

9. It was brought to our (my) attention that this project in fact could be un-useless - by permitting those with arthritis to open/close doors with ease while still fulfilling need for closed doors - say for while watching grandchildren or pets or et cetera. [sneer]



Code You Not Plz?!
// Arduino Door Catcher
// Vije Miller

#include <VarSpeedServo.h>

VarSpeedServo stopper;
VarSpeedServo base;
VarSpeedServo mid;
VarSpeedServo handle;

int pos;

// Magnetic Sensor
int hall = 2;
int magnet;
int state = 0;

void setup() {

Serial.begin(9600);

pinMode(hall, INPUT);

stopper.attach(3);
stopper.write(140, 60, true);

handle.attach(6);
handle.write(95, 60, true);

base.attach(4);
mid.attach(5);
base.write(180, 70);
mid.write(25, 50);
base.wait();
mid.wait();

}

void loop() {

// Did Door Open?
magnet = digitalRead(hall);

// Door Opened
if (magnet == HIGH) {
// Door Was Closed
if (state == 0) {
Serial.println("Active");
delay(1000);
engage();
state = 1;
// Door Was Open
} else if (state == 1) {
do_it();
Serial.println("Deactived");
delay(1000);
state = 0;
}
}
delay(47);
}

// Release Door Slide
void engage() {
stopper.write(40, 80, true);
}

void do_it() {
// Retract
stopper.write(140, 80, true);
// Set
mid.write(90, 50);
base.write(130, 30);
mid.wait();
base.wait();
handle.write(0, 50, true);
// Push
mid.write(70, 40);
base.write(90, 40);
mid.wait();
base.wait();
// Retract
mid.write(90, 50, false);
base.write(130, 50, true);
// Set to Grab
handle.write(95, 50, true);
mid.write(85, 50, true);
// Grab Door Handle
base.write(95, 100, true);
handle.write(0, 50, true);
// Close Door
mid.write(77, 50, false);
base.write(77, 50, true);
handle.write(95, 50, true);
// Retract
mid.write(90, 50);
base.write(120, 30);
mid.wait();
base.wait();
// Home
mid.write(25, 50);
base.write(180, 70);
mid.wait();
base.wait();
}

Archive
https://hackaday.io/project/166931-arduino-door-catcher