INTRODUCCIÓN
Si bien es cierto, ya habíamos publicado elevadores o ascensores de carga. Pero la diferencia con los anteriores es que esta nueva versión solo tiene un sensor de piso, cosa que los anteriores tenían un final de carrera para cada piso. Además, hoy les mostraré 2 tipos de ascensores; uno hasta tercer piso y el otro hasta 4 piso. Finalmente, esta maqueta se puede programar con cualquier tipo de plc, para esta demostración usaremos un plc de Siemens. Te gustaría saber cómo se hizo este proyecto desde la creación del esquemático electrónico, diseño pcb, la lógica de programación y la creación de la estructura? Pues no te despegues de esta pagina.
DATOS TECNICOS

- Tensión de alimentación……………………….…………12 Ó 24VDC
- Corriente de alimentación………………….……………90mA
- Entadas digitales 12-24VDC……………………….……2
- Salidas digitales 12-24VDC ……………………………9
- Entorno de programación………………………..………..Arduino IDE
- Vinculación con cualquier PLC……………………………… Sí
- Condiciones ambientales min……………………….….-40°
- Condiciones ambientales max…………………..……….150°
- Dimensiones……………………………………………………….80x90mm
- Empotrable………………………………….……………………Sí
- Programación directa (PC-Tarjeta electrónica)…………Sí
ESQUEMATICO ELECTRÓNICO

TARJETA DE CONTROL
OTROS
MAQUETA DISEÑADO EN SOLIDWORKS

CORTE LASER DE MAQUETA

Este corte funcionar con cualquier tipo de material, la unica condición es que solo sea de 3mm
CODIGO ARDUINO

int clockpin = 11; //Cuando ay que leer los bit SH
int data = 12; //Envio datos DS
int latch = 13; //indica pin de salida en el chip ST
int S_I_cont = 0;
int contador = 0;
int valor = 0;
int valor1 = 0;
int B_EM = 0;
const int NUM[] = {
// display katodo comun
63, //Numero 0 en binario es : 00111111
6, //Numero 1 en binario es : 00000110
91, //Numero 2 en binario es : 01011011
79, //Numero 3 en binario es : 01001111
102, //Numero 4 en binario es : 01100110
109, //Numero 5 en binario es : 01101101
125, //Numero 6 en binario es : 01111101
7, //Numero 7 en binario es : 00000111
127, //Numero 8 en binario es : 01111111
111, //Numero 9 en binario es : 01101111
63, //Numero 0 en binario es : 00111111
28, //NUM 0 en binario es : 00011100 puerta bajando, para posicion inicial
};
unsigned long time;
float tiempo = 2000;
unsigned long t = 0;
//physical inputs
const int in1 = 2;
const int in2 = 3;
const int in3 = 4;
const int in4 = 5;
const int in5 = 6;
const int in6 = 7;
const int in7 = 8;
const int in8 = 9;
const int in9 = 10;
// physical outputs
const int m_up = 14; //motor up
const int m_down = 15; // motor down
const int booking = 16; // reserva
const int booking1 = 17; // reserva
// Memories
//ETAPA
boolean e0, e1, e2, e3, e4, e5, e6 = false;
//TRANSITION
boolean t01, t02, t03, t04, t05, t06, t10, t20, t30, t40, t50, t60 = false;
int last_S_I = 0;
int retard = 0;
void setup() {
Serial.begin(9600);
//salidas para display
pinMode(latch, OUTPUT);
pinMode(clockpin, OUTPUT);
pinMode(data, OUTPUT);
//sensores infrarrojo
pinMode(in1, INPUT);
//final de carrera de seguridad
pinMode(in2, INPUT);
pinMode(in3, INPUT);
//pusadores de llamada
pinMode(in4, INPUT); //1er piso
pinMode(in5, INPUT); //2do piso
pinMode(in6, INPUT); //3to piso
pinMode(in7, INPUT); //4to piso
pinMode(in8, INPUT); //5to piso
pinMode(in9, INPUT); // Pulsador de emergencia
//salidas motor
pinMode(m_up, OUTPUT);
pinMode(m_down, OUTPUT);
pinMode(booking, OUTPUT);
pinMode(booking1, OUTPUT);
//delay(2000);
while (!digitalRead(in2) == HIGH) {
digitalWrite(m_down, 1);
digitalWrite(latch, LOW);
shiftOut(data, clockpin, MSBFIRST, NUM[11]); // lee el arreglo y pasa cada NUM a lectura binaria
digitalWrite(latch, HIGH);
}
//delay(500);
while (!digitalRead(in1) == HIGH) {
digitalWrite(m_down, 0);
digitalWrite(m_up, 1);
}
if (digitalRead(in1) == true) {
digitalWrite(m_up, 0);
S_I_cont = 1;
}
digitalWrite(m_down, 0);
digitalWrite(booking, 0);
digitalWrite(booking1, 0);
}
void loop() {
//Inputs
int S_I = digitalRead(in1);
int F_D = digitalRead(in2);
int F_U = digitalRead(in3);
int b1 = digitalRead(in4);
int b2 = digitalRead(in5);
int b3 = digitalRead(in6);
int s2 = digitalRead(in7);
int s3 = digitalRead(in8);
int B_E = digitalRead(in9); //Boton de energencia
if (B_E != valor) {
if (B_E == LOW) {
valor1++;
delay(200);
}
}
valor = B_E;
if (valor1 == 1) {
B_EM = true;
}
if (valor1 == 2) {
B_EM = false;
valor1 = 0;
}
if (e1 || e2 || e3 || e4 || e5 || e6 == true) {
time = millis();
if (time - t > tiempo) {
t = time;
contador++;
//Serial.println(contador);
}
}
if (S_I != last_S_I) {
if (S_I == LOW) {
if (contador > 3) {
if (e1 || e2 || e3 == true) {
if (S_I_cont < 3) {
S_I_cont++;
contador = 0;
}
}
if (e4 || e5 || e6 == true) {
if (S_I_cont > 1) {
S_I_cont--;
contador = 0;
}
}
}
}
}
last_S_I = S_I;
//INICIALIZACION***************************
if ((!e1 && !e2 && !e3 && !e4 && !e5 && !e6) == true) {
e0 = true;
}
//TRANSITION*********************************
//from 1 to 2 floor
if (e0 == true && S_I_cont == 1 && b2 == true) {
t01 = true;
t10 = false;
}
if (e1 && S_I_cont == 2) {
t10 = true;
t01 = false;
}
//from 1 to 3 floor
if (e0 && S_I_cont == 1 && b3 == true) {
t02 = true;
t20 = false;
}
if (e2 && S_I_cont == 3) {
t20 = true;
t02 = false;
}
//from 2 to 3 floor
if (e0 && S_I_cont == 2 && b3 == true) {
t03 = true;
t30 = false;
}
if (e3 && S_I_cont == 3) {
t30 = true;
t03 = false;
}
//from 3 to 2 floor
if (e0 && S_I_cont == 3 && b2 == true) {
t04 = true;
t40 = false;
}
if (e4 && S_I_cont == 2) {
t40 = true;
t04 = false;
}
//from 3 to 1 floor
if (e0 && S_I_cont == 3 && b1 == true) {
t05 = true;
t50 = false;
}
if (e5 && S_I_cont == 1) {
t50 = true;
t05 = false;
}
//from 2 to 1 floor
if (e0 && S_I_cont == 2 && b1 == true) {
t06 = true;
t60 = false;
}
if (e6 && S_I_cont == 1) {
t60 = true;
t06 = false;
}
//ETAPA**************************************
if (e0 && t01 == true) {
e0 = false;
e1 = true;
}
if (e1 && t10 == true) {
e1 = false;
e0 = true;
}
if (e0 && t02 == true) {
e0 = false;
e2 = true;
}
if (e2 && t20 == true) {
e2 = false;
e0 = true;
}
if (e0 && t03 == true) {
e0 = false;
e3 = true;
}
if (e3 && t30 == true) {
e3 = false;
e0 = true;
}
if (e0 && t04 == true) {
e0 = false;
e4 = true;
}
if (e4 && t40 == true) {
e4 = false;
e0 = true;
}
if (e0 && t05 == true) {
e0 = false;
e5 = true;
}
if (e5 && t50 == true) {
e5 = false;
e0 = true;
}
if (e0 && t06 == true) {
e0 = false;
e6 = true;
}
if (e6 && t60 == true) {
e6 = false;
e0 = true;
}
//ACTUADORES*********************************
// Motor subiendo
if ((e1 || e2 || e3 == true) && (!F_D && !F_U && !B_EM == true)) {
digitalWrite(m_up, HIGH);
digitalWrite(m_down, LOW);
cont();
}
//Reposo
if (e0 || F_D || F_U || B_EM == true) {
digitalWrite(m_up, LOW);
digitalWrite(m_down, LOW);
cont();
}
//motor bajando
if ((e4 || e5 || e6 == true) && (!F_D && !F_U && !B_EM == true)) {
digitalWrite(m_up, LOW);
digitalWrite(m_down, HIGH);
cont();
}
}
void cont() {
digitalWrite(latch, LOW);
shiftOut(data, clockpin, MSBFIRST, NUM[S_I_cont]); // lee el arreglo y pasa cada NUM a lectura binaria
digitalWrite(latch, HIGH);
}







