[Project 24] – 3 Floor Elevator Using DC Gear Motor + Arduino Mega

The project is 3 floor evelator design and implementation using Arduino Mega. The Project is same prototype of real evelator system. After designing the scheme , electronic circuit design was performed .Before start the Project , researched about how real evelator systems works. And about principle of evelator informations was obtained.In this system I used dc gear motor to move cabin that  I place at the top of the cabin. DC gear motors are chosen based on their low speed and high torque.

 

Electronic Circuit Schema I :


electronic-circuit-schema

 

Electronic Circuit Schema II :


electronic-circuit-schema-ii

Arduino Program:


 
	

int configuration = 0; // Reset to Null Movement Condition
int ELV_MUSIC;

int level = 1; // First Floor level for seven segment display, DEFAULT

// Floor Switches for Elevator Car
const int floor_sw_1 = 4;
const int floor_sw_2 = 3;
const int floor_sw_3 = 2;
// -------------------------------



// Floor Buttons for users to select which floor they require elevator car
const int floor_btn_1 = 5;
const int floor_btn_2 = 6;
const int floor_btn_3 = 7;
// -----------------------------------------------------------------------


// Relay Module Commands for Elevator Car Movement
const int car_up = 8;
const int car_dn = 9;
// -----------------------------------------------


// LED Directional Lights for Elevator Car
const int led_up = 44;
const int led_dn = 42;
// --------------------------------------- 


// Seven Segment Display Floor Numbers
const int a = 23;
const int b = 25;
const int e = 27;
const int f = 29;
const int g = 31;
const int h = 33;
const int i = 35;
// ------------------------------------

// LCD Picture Frame Constant
const int LCD_PWR = 50;



void setup() {
// Floor Switches for Elevator Car designated as inputs
pinMode(floor_sw_1, INPUT);
pinMode(floor_sw_2, INPUT);
pinMode(floor_sw_3, INPUT);
// ---------------------------------------------------


// Floor Buttons designated as inputs
pinMode(floor_btn_1, INPUT);
pinMode(floor_btn_2, INPUT);
pinMode(floor_btn_3, INPUT);
// -----------------------------------


// Relay Module Elevator Car as outputs
pinMode(car_up, OUTPUT);
pinMode(car_dn, OUTPUT);
// ------------------------------------

// LED Directional Lights for Elevaltor Car
pinMode(led_up, OUTPUT);
pinMode(led_dn, OUTPUT);
// ------------------------------------


// Seven Segment Display as OUTPUTS
pinMode(a, OUTPUT);
pinMode(b, OUTPUT);
pinMode(e, OUTPUT);
pinMode(f, OUTPUT);
pinMode(g, OUTPUT);
pinMode(h, OUTPUT);
pinMode(i, OUTPUT);
// ----------------------------------

//  Turns  ON  &  OFF  LCD 
pinMode(LCD_PWR, OUTPUT);
//------------------------

// Activates Elevator Music
pinMode(ELV_MUSIC, OUTPUT);
//-------------------------


} // END of void setup()



void loop() {
floor_num(); // Detects which floor number to display
// Turns on LCD 
digitalWrite(LCD_PWR, HIGH);
digitalWrite(ELV_MUSIC, HIGH);

// Car on First Floor, Second Floor Button Pressed. Car Rises
if (digitalRead(floor_sw_1) == HIGH && digitalRead(floor_btn_2) == HIGH){
         configuration = 1;
         configurations();
}

// Car on First Floor, Third Floor Button Pressed. Car Rises
else if(digitalRead(floor_sw_1) == HIGH && digitalRead(floor_btn_3) == HIGH){
        configuration = 2;
        configurations();
}

// Car on Second Floor, Third Floor Button Pressed. Car Rises
else if(digitalRead(floor_sw_2) == HIGH && digitalRead(floor_btn_3) == HIGH){
        configuration = 3;
        configurations();
}

// Car on Third Floor, Second Floor Button Pressed. Car Lowers
else if(digitalRead(floor_sw_3) == HIGH && digitalRead(floor_btn_2) == HIGH){
        configuration = 4;
        configurations();
}

// Car on Third Floor, First Floor Button Pressed. Car Lowers
else if(digitalRead(floor_sw_3) == HIGH && digitalRead(floor_btn_1) == HIGH){
        configuration = 5;
        configurations();
}

// Car on Second Floor,First Floor Button is Pressed. Car Lowers
else if(digitalRead(floor_sw_2) == HIGH && digitalRead(floor_btn_1) == HIGH){
        configuration = 6;
        configurations();
}



} // END of void loop()







// Movement Configurations for Each Floor Combination
void configurations() { 

// BELOW: Elevator Rise From First to Second Floor.

if(configuration == 1){
       while(digitalRead(floor_sw_2) == LOW){ 
       digitalWrite(car_up, HIGH);
       digitalWrite(led_up, HIGH);
       level=0; // No LEVEL
       floor_num();
       }
configuration = 0; // Reset to Null Movement Condition
level=2; 
digitalWrite(car_up, LOW); // Cease car Movement
digitalWrite(led_up, LOW);
}

// BELOW: Elevator Rise From First to Third Floor
else if(configuration == 2){
        while(digitalRead(floor_sw_3) == LOW){
        digitalWrite(car_up, HIGH);
        digitalWrite(led_up, HIGH); 
        level=0; // No LEVEL
        floor_num();
        }
configuration = 0; // Reset to Null Movement Condition
level=3; 
digitalWrite(car_up, LOW); // Cease car Movement
digitalWrite(led_up, LOW);
}

// BELOW: Elevator Rise from Second to Third Floor
else if(configuration == 3){
        while(digitalRead(floor_sw_3) == LOW){
        digitalWrite(car_up, HIGH);
        digitalWrite(led_up, HIGH);
        level=0; // No LEVEL
        floor_num();
        }
configuration = 0; // Reset to Null Movement Condition
level=3; 
digitalWrite(car_up, LOW); // Cease car Movement
digitalWrite(led_up, LOW);
}

// BELOW: Elevator Lowers from Third to Second Floor
else if(configuration == 4){
        while(digitalRead(floor_sw_2) == LOW){
        digitalWrite(car_dn, HIGH); 
        digitalWrite(led_dn, HIGH); 
        level=0; // No LEVEL
        floor_num();
        }
configuration = 0; // Reset to Null Movement Condition
level=2; 
digitalWrite(car_dn, LOW); // Cease car Movement
digitalWrite(led_dn, LOW);
}

// BELOW: Elevator Lowers from Third to First Floor
else if(configuration == 5){
        while(digitalRead(floor_sw_1) == LOW){
        digitalWrite(car_dn, HIGH); 
        digitalWrite(led_dn, HIGH);
        level=0; // No LEVEL
        floor_num();
        }
configuration = 0; // Reset to Null Movement Condition
level=1; 
digitalWrite(car_dn, LOW); // Cease car Movement
digitalWrite(led_dn, LOW);
}

// BELOW: Elevator Lowers from Second to First Floor
else if(configuration == 6){
        while(digitalRead(floor_sw_1) == LOW){
        digitalWrite(car_dn, HIGH);
        digitalWrite(led_dn, HIGH);
        level=0; // No LEVEL
        floor_num();
        }
configuration = 0;  // Reset to Null Movement Condition 
level=1; 
digitalWrite(car_dn, LOW); // Cease car Movement
digitalWrite(led_dn, LOW);
}

}// End of VOID configuration() function






void floor_num() {
// Displays middle led, signifying in motion
if (level == 0){
digitalWrite(a, HIGH);
digitalWrite(f, HIGH);
digitalWrite(b, HIGH);
digitalWrite(e, LOW);
digitalWrite(h, HIGH);
digitalWrite(i, HIGH);
digitalWrite(g, HIGH);
}

else if(level == 1){
// First Floor 7-segment display
digitalWrite(a, LOW);
digitalWrite(f, LOW);
digitalWrite(b, HIGH);
digitalWrite(e, HIGH);
digitalWrite(h, HIGH);
digitalWrite(i, HIGH);
digitalWrite(g, HIGH);
// -----------------------------
}

else if(level == 2){
// Second Floor 7-segment display
 digitalWrite(a, LOW);
 digitalWrite(b, LOW);
 digitalWrite(e, LOW);
 digitalWrite(h, LOW);
 digitalWrite(i, LOW);
 digitalWrite(f, HIGH);
 digitalWrite(g, HIGH);
// ------------------------------
}

else if(level == 3){
// Third Floor 7-segment display
digitalWrite(a, LOW);
digitalWrite(b, LOW);
digitalWrite(e, LOW);
digitalWrite(f, LOW);
digitalWrite(g, LOW);
digitalWrite(h, LOW);
digitalWrite(i, HIGH);
// ----------------------------- 
}
} // END of Floor_



 

3D Design:


3d-desin-elevator

 

The Placement Of Materials:


the-placement-of-materials



 

You may also like...