Aquí tenemos una maqueta de ascensor hecha con Arduino Nano que incluye una pantalla LCD y un teclado matricial para realizar las configuraciones y prácticas necesarias. Como pueden ver, subimos al segundo nivel… y al tercer nivel…
Esta maqueta se diseñó con la finalidad de hacer prácticas y experimentar con el funcionamiento de un ascensor real. Dado que la tarjeta de control utiliza un microcontrolador Arduino Nano, a través de este puerto USB tipo C podemos cargar el programa y al mismo tiempo nos sirve de alimentación. Prácticamente es como tener un circuito en un protoboard con una tarjeta Arduino Nano, con la diferencia de que todo está integrado en esta tarjeta compacta.
¿Te gustaría saber cómo se desarrolló este proyecto desde cero? Desde el diseño del esquemático electrónico, el diseño de la tarjeta PCB hasta el armado de la estructura completa. Pues no te despegues de este artículo.
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í
- I2C comunicación…………………………………………………………..Sí
- Comunicacion Serial………………………………………………………Sí
- Teclado matricial……………………………………………………………..Sí
- Pantalla LCD i2c……………………………………………………………….Sí
- Buzzer………………………………………………………………………………..Sí
LISTA DE MATERIALES

Quantity | Comment | Designator | Footprint | Value | Manufacturer Part | Manufacturer | Supplier Part |
1 | 3kHz | BUZZER1 | BUZ-TH_BD9.0-P5.00-D0.6-FD | 3kHz | HNB09A03 | 华能 | C96102 |
14 | 100nF | C1,C2,C3,C4,C5,C6,C7, C8,C9,C10,C11,C13,C14,C15 |
C0603 | 100nF | CC0603KRX7R9BB104 | YAGEO(国巨) | C14663 |
1 | 2.2uF | C12 | CAP-SMD_BD4.0-L4.3-W4.3-LS5.3-FD | 2.2uF | RVT1C2R2M0405 | ROQANG(容强) | C72492 |
1 | 470uF | C16 | CAP-SMD_BD10.0-L10.3-W10.3-LS11.3-FD | 470uF | VT1V471M1010 | ROQANG(容强) | C310845 |
1 | 1uF | C17 | C1206 | 1uF | CL31B105KBHNNNE | SAMSUNG(三星) | C1848 |
1 | 220uF | C18 | CAP-SMD_BD6.3-L6.6-W6.6-LS7.2-R-RD | 220uF | RVE1C221M0607 | ROQANG(容强) | C99836 |
1 | 2.0-2*8P直简牛 | CN1 | IDC-TH_16P-P2.00-V-R2-C8-S2.00 | 2.0-2*8P直简牛 | BOOMELE(博穆精密) | C56602 | |
1 | ZX-XH2.54-4PZZ | CN2 | CONN-TH_4P-P2.50_4PIN | ZX-XH2.54-4PZZ | Megastar(兆星) | C7429634 | |
1 | 1N4148W | D1 | SOD-123F_L2.7-W1.6-LS3.8-RD | 1N4148W | ST(先科) | C81598 | |
4 | SS210 | D2,D3,D4,D5 | SMA_L4.3-W2.6-LS5.2-RD | SS210 | MDD | C14996 | |
1 | 2.54-1x6P直针 | H1 | HDR-TH_6P-P2.54-V-M-1 | 2.54-1x6P直针 | BOOMELE(博穆精密) | C37208 | |
2 | PZ254V-11-04P | H2,H3 | HDR-TH_4P-P2.54-V-M | PZ254V-11-04P | XFCN(兴飞) | C2691448 | |
3 | 2.54-1*3P针 | H4,H5,H6 | HDR-TH_3P-P2.54-V-M-1 | 2.54-1*3P针 | BOOMELE(博穆精密) | C49257 | |
1 | 68uH | L1 | IND-SMD_L7.1-W6.6-1 | 68uH | PSPMAA0605H-680M-IGF | PROD(谱罗德) | C2983094 |
9 | 19-217/GHC-YR1S2/3T | LED1,LED2,LED3,LED4 ,LED5,LED6,LED7,LED8,LED9 |
LED0603-RD | 19-217/GHC-YR1S2/3T | EVERLIGHT(亿光) | C72043 | |
2 | WJ128V-5.0-2P | P1,P5 | CONN-TH_2P-P5.00_WJ128V-5.0-2P | WJ128V-5.0-2P | KANGNEX(康奈克斯电气) | C8269 | |
3 | WJ128V-5.0-3P | P2,P3,P4 | CONN-TH_3P-P5.00_WJ128V-5.0-3P | WJ128V-5.0-3P | KANGNEX(康奈克斯电气) | C8270 | |
9 | AO3401A | Q1,Q2,Q4,Q5,Q6,Q7, Q8,Q9,Q10 |
SOT-23_L2.9-W1.3-P1.90-LS2.4-BR | AO3401A | AOS | C15127 | |
1 | MMBT3904 | Q3 | SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BR | MMBT3904 | CJ(江苏长电/长晶) | C20526 | |
12 | 1kΩ | R1,R2,R3,R4,R5,R6,R7, R8,R9,R26,R39,R40 |
R0603 | 1kΩ | 0603WAF1001T5E | UNI-ROYAL(厚声) | C21190 |
12 | 10kΩ | R10,R11,R12,R13,R14 ,R15,R16,R17,R18,R30,R35,R45 |
R0603 | 10kΩ | 0603WAF1002T5E | UNI-ROYAL(厚声) | C25804 |
1 | 1MΩ | R19 | R0603 | 1MΩ | 0603WAF1004T5E | UNI-ROYAL(厚声) | C22935 |
11 | 10kΩ | R20,R23,R27,R31,R34, R36,R41,R44,R46,R49,R52 |
R0805 | 10kΩ | 0805W8F1002T5E | UNI-ROYAL(厚声) | C17414 |
18 | 470Ω | R21,R22,R24,R25,R28,R29, R32,R33,R37,R38,R42,R43, R47,R48,R50,R51,R53,R54 |
R0603 | 470Ω | 0603WAF4700T5E | UNI-ROYAL(厚声) | C23179 |
1 | TS-1187A-B-A-B | SW1 | SW-SMD_4P-L5.1-W5.1-P3.70-LS6.5-TL-2 | TS-1187A-B-A-B | XKB Connectivity(中国星坤) | C318884 | |
1 | MSS22D18G2 | SW2 | SW-TH_MSS22D18GX | MSS22D18G2 | SHOU HAN(首韩) | C431542 | |
2 | Test-Point | TP1,TP2 | Test-Point-0.5mm | ||||
1 | ATMEGA328P-AU | U1 | TQFP-32_L7.0-W7.0-P0.80-LS9.0-BL | ATMEGA328P-AU | MICROCHIP(美国微芯) | C14877 | |
11 | EL357N(C)(TA)-G | U2,U3,U5,U6,U7, U8,U9,U10,U12,U13,U15 |
OPTO-SMD-4_L4.4-W4.1-P2.54-LS7.0-TL | EL357N(C)(TA)-G | EVERLIGHT(亿光) | C42379244 | |
1 | BDR6121H | U4 | SOP-8_L4.9-W3.8-P1.27-LS6.0-BL | BDR6121H | 巴丁微 | C3007875 | |
1 | CH340C | U11 | SOP-16_L10.0-W3.9-P1.27-LS6.0-BL | CH340C | WCH(南京沁恒) | C84681 | |
1 | XL1509-5.0E1 | U14 | SOIC-8_L5.0-W4.0-P1.27-LS6.0-BL | XL1509-5.0E1 | XLSEMI(芯龙) | C61063 | |
1 | USB-TYPE-C-018 | USB1 | USB-C_SMD-TYPE-C-31-M-12 | USB-TYPE-C-018 | DEALON(德艺隆) | C2927038 | |
1 | 16MHz | X1 | OSC-SMD_3P-L3.2-W1.3-P0.95-L | 16MHz | CSTCE16M0V53-R0 | muRata(村田) | C32180 |
CODIGO

#include <Wire.h> #include <LiquidCrystal_I2C.h> #include <Keypad_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); // Dirección I2C del LCD // Configuración del teclado con Keypad_I2C const byte ROWS = 4; // Número de filas const byte COLS = 4; // Número de columnas char keys[ROWS][COLS] = { { '1', '2', '3', 'A' }, { '4', '5', '6', 'B' }, { '7', '8', '9', 'C' }, { '*', '0', '#', 'D' } }; byte rowPins[ROWS] = { 3, 2, 1, 0 }; // Filas conectadas a P0-P3 del PCF8574 byte colPins[COLS] = { 7, 6, 5, 4 }; // Columnas conectadas a P4-P7 del PCF8574 Keypad_I2C keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS, 0x20); // Dirección del PCF8574 int buzzerPin = 16; const int tonoTecla = 1000; // Frecuencia en Hz para pulsación normal const int duracionCorta = 50; // Duración en ms para tecla normal 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 = 500; unsigned long t = 0; //physical inputs const int in1 = 2; // sensor de piso con interruptor externo const int in2 = 3; // final de carrera inferior const int in3 = 4; // final de carrera superior const int in4 = 14; // boton 1 const int in5 = 15; // boton 2 const int in6 = 7; // boton 3 const int in7 = 8; // boton 4 const int in8 = 9; // boton 5 const int in9 = 10; // boton de emergencia // physical outputs const int m_up = 5; //motor subir const int m_down = 6; // motor bajar const int buzzer = 16; // BUZER // 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; bool acceso = false; void setup() { lcd.init(); // Inicializa LCD lcd.backlight(); // Habilita retroiluminación lcd.setCursor(0, 0); lcd.print("buscando posicion:"); lcd.setCursor(0, 1); lcd.print(" INICIAL:"); // Inicializar teclado I2C Wire.begin(); keypad.begin(makeKeymap(keys)); //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(buzzer, 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; lcd.clear(); } cont(); digitalWrite(m_down, 0); digitalWrite(buzzer, 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 (F_D || F_U || b1 || b2 || b3 || s2 || s3 || B_E) { sonidoTecla(); } 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; sonidoTecla(); } } if (e4 || e5 || e6 == true) { if (S_I_cont > 1) { S_I_cont--; contador = 0; sonidoTecla(); } } } } } 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) { acceso = false; 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); lcd.setCursor(0, 0); lcd.print(" CABINA "); lcd.setCursor(0, 1); lcd.print(" SUBIENDO "); cont(); } //Reposo if (e0 || F_D || F_U || B_EM == true) { digitalWrite(m_up, LOW); digitalWrite(m_down, LOW); lcd.setCursor(0, 0); lcd.print(" DETENIDO...."); lcd.setCursor(0, 1); lcd.print(" STOP...."); cont(); } //motor bajando if ((e4 || e5 || e6 == true) && (!F_D && !F_U && !B_EM == true)) { lcd.setCursor(0, 0); lcd.print(" CABINA "); lcd.setCursor(0, 1); lcd.print(" BAJANDO. "); 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); } void sonidoTecla() { tone(buzzerPin, tonoTecla, duracionCorta); delay(duracionCorta); // Pequeña pausa para evitar solapamientos }