Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Mark Lewis
Created October 4, 2019

Automatic Door Opener

Open a door via voice command or other sensor to assist those with mobility issues like a walker or wheelchair.

IntermediateFull instructions provided5 hours36
Automatic Door Opener

Things used in this project

Hardware components

Photon
Particle Photon
×1
linear actuator
×1
Roomba Wheel
×1
4 channel 12V (3.3V action) DPDT Relay
Only 3 channels are required.
×1
12V to 3.3V convertor module
×1
Bolts and nuts 1/4"
×3
Command adhesive strips
×6
Small spring and picture hanging wire
×1
12V 3A Power Supply
×1

Software apps and online services

IFTTT IFTT Trigger

Hand tools and fabrication machines

RAISE N2 3D Printer

Story

Read more

Custom parts and enclosures

Base

This is the base that hold the circuit boards and actuator.

Motor Mount

This part mounts the motor to the actuator.

Schematics

Basic Schmatic

Code

DoorV5..ino

C/C++
Code that runs on Proton
/*
 * Project DoorWheel
 * Description:
 * Author:Mark Lewis
 * Date: 10/1/2019
 */

int rlBar = D0;
int ocWheel = D1;
int motorPower = D2;
int DOWNTIME = 16000;
int OPENTIME = 3000;
int CLOSETIME = 4000;
int lastData;


void setup() {
  pinMode(rlBar, OUTPUT);
  pinMode(ocWheel, OUTPUT);
  pinMode(motorPower, OUTPUT);

  Particle.function("openDoor", openDoor);
  Particle.function("closeDoor", closeDoor);
  Particle.subscribe("let_the_dog_out", myHandler);  
 
}

void loop() {
  // Nothing to see here....

}

void oDoor()  {
  //  if (lastData = 1) {
  digitalWrite( rlBar, HIGH);
  delay (DOWNTIME);
  digitalWrite( ocWheel, HIGH);
  digitalWrite( motorPower, HIGH);
  delay (OPENTIME);
  digitalWrite( motorPower, LOW);
  //lastData = 0;
 // }
}

void cDoor()  {
    //if (lastData = 0) {
  digitalWrite( ocWheel, LOW);
  digitalWrite( motorPower, HIGH);
  digitalWrite( rlBar, LOW); 
  delay (CLOSETIME);
  digitalWrite( motorPower, LOW);
  //lastData = 1;
  //  }
}

void myHandler(const char *event, const char *data)
{
    if (strcmp(data,"open")==0)  {
       oDoor();
       delay (OPENTIME);

   }
    if  (strcmp(data,"close")==0) {  
       cDoor();
       delay (CLOSETIME);
   }
}

//Invoked by alexa 
int openDoor(String Command) {
    oDoor();
    return 1;
}

//Invoked by alexa
int closeDoor(String Command) {
    cDoor();
    return 1;
}

Credits

Mark Lewis

Mark Lewis

3 projects • 2 followers

Comments