Would you high five a machine?

Working in the workshop can be quite lonely.. But not anymore! With this high five machine you can celebrate success on your own. It’s simple: every time there is something to high five for you just raise your hand to the high five machine and BOOM high five!

I don’t remember exactly how I got the idea for this project, but one of the reasons that I like it so much is because it takes a social action between two people and make it possible to do this on your own. Removing the other person, which kinda removes the reason why you’d high five..

During the design phase I went trough a couple of different concepts on how to drive the arm. Starting with pneumatics, solenoids and a direct drive system. I didn’t want the need to connect it to an air line so there went the pneumatics option. Then I realised that people will probably try to slap the hand on the high five machine, or high five it. This would break any direct connection with the motor in a couple of slaps.. And that’s when I came to the design I went with. 

The spring moves the arm forward that means, no hard connection between the arm and the motor. So if you slap it now you just push the arm back. Then when the motor spins the arm is pushed back.

There is just one flaw in this.. When the arm is in the back position and the batteries are empty it’s a bit of a fight to get the cover off..

The arm is controlled by an Arduino Nano, this Arduino gets a signal from the distance sensor (sharp: GP2Y0A21YK0F ) when there is a hand present and then switches the relay for the motor.

Anyway,. Time to watch the video.

#include <SharpIR.h>

int PinMotor = 3;
int PinSwitch = 2;
int PinSensor = A0;
int ReadSwitch;


int SwitchDist = 20;

SharpIR sensor( SharpIR::GP2Y0A21YK0F, PinSensor );

bool turn = false;
bool Mactive = false;

void setup() {
  // put your setup code here, to run once:
  pinMode (PinMotor, OUTPUT);
  pinMode (PinSwitch, INPUT);
  Serial.begin( 9600 ); //Enable the serial comunication
}

void loop() {
  // put your main code here, to run repeatedly:
  ReadSwitch = digitalRead(PinSwitch);

  int distance = sensor.getDistance();   //Calculate the distance in centimeters and store the value in a variable
  Serial.println( distance ); //Print the value to the serial monitor

  //Scant hand en activeert
  if (distance < SwitchDist && turn == false && ReadSwitch == HIGH && Mactive == false) {
    digitalWrite(PinMotor, HIGH);
    Mactive = true;
  }
//Schakelaar niet ingedrukt, dus draait
  if (ReadSwitch == LOW){
    turn = true;
  }
  // motor weer terug in start pos
  else if (ReadSwitch == HIGH && turn == true) {
    delay(50);  // in case there needs to be a delay before the motor stops
    digitalWrite(PinMotor, LOW);
    turn = false;
    Mactive = false;
    delay(1000);

  }

}