2537867363skyvf31jgj
Published © CC BY-NC

Touch-free Elevator

An affordable, easy, and touch-free solution to select floors in an elevator

IntermediateWork in progress2,381
Touch-free Elevator

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
One Arduino Nano can control 8 blocks. More buttons means more boards
×1
Photodiode, 35 °
Photodiode, 35 °
3 photodiode for each block. Unlike a infrared emitter, photodiodes are fine to connect to 5V directly.
×3
Infrared Emitter, 30 °
Infrared Emitter, 30 °
3 infrared emitter for each block. NOTICE: infrared emitter WILL BURN if not connected to a 220 ohm resistor.
×3
Resistor 220 ohm
Resistor 220 ohm
One resistor for each block. Connect the resistor to the positive side of the emitter.
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Print different numbers of blocks each time depending on your printer size and glue them together at the end
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Custom parts and enclosures

Block

"Blocks" build up the whole system and are the main frames.

Reference

The reference for the final effect. NOT an actual component. The big buttons on the back panel are the original buttons of a elevator and the cylinders on the blocks are infrared emitter and photodiodes. Arduino Nano will be placed into the big box on the bottom.

Schematics

Schematic for 1 block

This is the diagram for 1 block to show its connection to Arduino Nano

Schematics for 2 blocks

This is the diagram for 1 block to show its connection to Arduino Nano. This shows how multiple blocks are connected electrically.

Code

Infrared Detect and Select Floors

Arduino
This is the main code of our system. It determines which button is bushed and which floor is detected. Right now it is now linked to a specific elevator so the code is not workable. Figure out how your elevator communication works and then change the part that needs to be changed.
/*
  InfraredDetectAndSelectFloor

  This program is used to read values from all ports you assigned. Change the value of "NumberOfButton" to fit your target elevator. Be sure to assign the ports manually. 
  
  Now we have only assigned 1 port so only A0 is used. if you want to used both A0 and A1 for inputs, change NumberOfButton to 2 and set IR_REC[NumberOfButton] to {A0,A1}.

  Author: Sky Song
*/

int const NumberOfButton = 1; //Number of buttons of the target elevator. Remeber if there are more than 8 buttons, you need to use another Arduino Nano
int IR_REC[NumberOfButton] = {A0}; //Assign photodiodes analog port numbers, A0 is used for testing 1 block
int tolerance = 20; //variable that defines tolerance, 20 is generally a good value in our testing

int UpperBound[NumberOfButton], LowerBound[NumberOfButton];





void setup()
{
  Serial.begin(9600);
  for(int i = 0; i< NumberOfButton; i++)
  {
    pinMode(IR_REC[i], INPUT);
  }

  //Get the initial value of all ports when starting
  for(int i = 0; i< NumberOfButton; i++)
  {
    int InitValue[NumberOfButton];
    
    //Assign inital values to all ports
    for(int i = 0; i< NumberOfButton; i++)
    {
      InitValue[i] = analogRead(IR_REC[i]);
      for(int j = 0; j < 200; j++) //Sample 200 times and get a more accurate mean number of the inital value of the ith port
      {
        InitValue[i] = InitValue[i] + analogRead(IR_REC[i]);
        InitValue[i] = InitValue[i] / 2;
      }
    }
    
    //establish the tolerance range
    UpperBound[i] = InitValue[i] + tolerance;
    LowerBound[i] = InitValue[i] - tolerance;
  }
  

  Serial.println("Ready!");
}





void loop()
{
  for(int i = 0; i < NumberOfButton; i++)
  {
    int average = analogRead(IR_REC[i]); 
    for(int j = 0; j < 20; j++)//To get an average value to avoid fluctuations
     {
       average = average + analogRead(IR_REC[i]);
       average = average / 2;
     }      
     
      //if the port just scanned is within the tolerance range (been pressed), then do some action
      if(average <= UpperBound and average >= LowerBound){}
      else
      {
        Serial.println("pressed");//Here comes the actual action need to be done. We can change it to adapt the elevator control unit to select floors. Right now it's printing "pressed" onto the monitor
      }
    if(i < NumberOfButton) i = 0;//Reset when finish scaning all ports
  }
}

Credits

2537867363sky

2537867363sky

0 projects • 0 followers
vf31jgj

vf31jgj

0 projects • 1 follower

Comments