Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Campus Querétaro
Que presentan:
Estudiantes de la carrera:
Ingeniera en Electrónica
Docente
Armando Mora Campos
Fecha:
12/12/2022
1
Contenido
1.- ANTECEDENTES:...........................................................................................................3
2.- OBJETIVO........................................................................................................................3
3.-COMPETENCIAS A DESARROLLAR............................................................................3
4.MARCO TEÓRICO.............................................................................................................4
4.1.- Teclado matricial 4x4.................................................................................................4
4.1.1.- Pantalla LCD...........................................................................................................4
4.2.- Buzzer Activo.............................................................................................................4
4.3 Relevador......................................................................................................................4
5-. EQUIPO Y MATERIALES..............................................................................................5
6.- PROCEDIMIENTO...........................................................................................................5
6.1.- Código de Arduino.....................................................................................................5
6.2.- Diagrama esquematico..............................................................................................14
7.- RESULTADOS...............................................................................................................15
2
1.- ANTECEDENTES:
2.- OBJETIVO
El objetivo de esta practica será el experimentar con procesos de control de ingreso, ya sea
por contraseña con un teclado matricial 4x4 u algún hardware para ingresar clave, y
pantalla lcd para mostrar dicho proceso, también se contara con 2 leds (Abierto y Cerrado),
y se usara Arduino para la misma.
3.-COMPETENCIAS A DESARROLLAR.
Especifica:
Realiza programas de control que permitan monitorear señales de entrada.
Aplicar un sistema de seguridad.
Generar señales de visualización del proceso de control.
Genéricas:
Capacidad de generar nuevas ideas (creatividad).
Capacidad de aplicar los conocimientos en la práctica.
Capacidad de trabajar en equipo Interdisciplinario y multidisciplinario.
Destrezas tecnológicas relacionadas con el uso de maquinaria, destrezas de
computación; así como, de búsqueda y manejo de información.
3
4.MARCO TEÓRICO.
4.3 Relevador
4
5-. EQUIPO Y MATERIALES
Fuente de alimentación.
Arduino.
Leds.
Resistencias.
Buzzer.
Pantalla LCD
Protoboard.
6.- PROCEDIMIENTO
#include <Servo.h>
#include <Keypad.h>
//Variables
int mot_min = 90; //min servo angle (set
yours)
int mot_max = 180; //Max servo angle (set
yours)
int character = 0;
int activated =0;
5
char Str[16] = {' ', ' ', ' ', ' ', ' ', '
', '-', '*', '*', '*', ' ', ' ', ' ', ' ', '
', ' '};
//Pins
Servo myservo;
int buzzer=11; //pin for the buzzer beep
int external = 12; //pin to inside open
int internal = 13; //pin to inside close
//Keypad config
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the
keypads
char hexaKeys[ROWS][COLS] = {
{'1','4','7','*'},
{'2','5','8','0'},
{'3','6','9','#'},
{'A','B','C','D'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect
to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; //connect
to the column pinouts of the keypad
6
void setup(){
myservo.attach(10); //attach the servo to
pin D10
pinMode(buzzer,OUTPUT);
pinMode(external,INPUT);
pinMode(internal,INPUT);
//Init the screen and print the first text
lcd.init();
lcd.backlight();
lcd.clear();
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(" -*** ");
//put the servo in the close position
first
myservo.write(mot_min);
void loop(){
///////////////EMERGENCY OPEN/CLOSE/////////
if (digitalRead(external))
{
myservo.write(mot_max);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("INSIDE OPEN");
activated = 2;
analogWrite(buzzer,240);
delay(250);
analogWrite(buzzer,200);
7
delay(250);
analogWrite(buzzer,180);
delay(250);
analogWrite(buzzer,250);
delay(250);
analogWrite(buzzer,LOW);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("WELLCOME");
lcd.setCursor(2,1);
lcd.print("ELECTRONOOBS");
lcd.clear();
lcd.setCursor(3,0);
lcd.print("DOOR OPEN");
lcd.setCursor(2,1);
lcd.print("ELECTRONOOBS");
delay(500);
if (digitalRead(internal))
{
myservo.write(mot_min);
activated = 0;
character=0;
Str[6]= '-';
8
Str[7]= '*';
Str[8]= '*';
Str[9]= '*';
Str[10]= ' ';
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
///////////////KEYPAD OPEN/CLOSE////////////
char customKey = customKeypad.getKey();
//this function reads the presed key
if (customKey){
if (character ==0)
{
Serial.println(customKey);
Str[6]= customKey;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
if (character ==1)
{
9
Serial.println(customKey);
Str[7]= customKey;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
if (character ==2)
{
Serial.println(customKey);
Str[8]= customKey;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
if (character ==3)
{
Serial.println(customKey);
Str[9]= customKey;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
10
}
if (character ==4)
{
Serial.println(customKey);
Str[10]= customKey;
activated=1;
}
character=character+1;
}
if (activated == 1)
{
/*Change your password below!!!
Change each of Str[6], Str[7], Str[8],
Str[9]*/
11
delay(250);
analogWrite(buzzer,180);
delay(250);
analogWrite(buzzer,250);
delay(250);
analogWrite(buzzer,LOW);
delay(1000);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("WELLCOME");
delay(500);
lcd.setCursor(2,1);
lcd.print("ELECTRONOOBS");
delay(1000);
lcd.clear();
lcd.setCursor(3,0);
lcd.print("DOOR OPEN");
lcd.setCursor(2,1);
lcd.print("ELECTRONOOBS");
}
else
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print("PASSWORD ERROR");
lcd.setCursor(3,1);
lcd.print("TRY AGAIN");
analogWrite(buzzer,150);
12
delay(3000);
analogWrite(buzzer,LOW);
character=0;
Str[6]= '-';
Str[7]= '*';
Str[8]= '*';
Str[9]= '*';
Str[10]= ' ';
activated = 0;
lcd.clear();
lcd.setCursor(4,0);
lcd.print("PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
}
if (activated == 2)
{
if(customKey == 'B' )
{
myservo.write(mot_min);
activated = 0;
character=0;
Str[6]= '-';
Str[7]= '*';
Str[8]= '*';
Str[9]= '*';
Str[10]= ' ';
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
13
lcd.setCursor(0,1);
lcd.print(Str);
}
}
}
14
7.- RESULTADOS
15