PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING
description
Transcript of PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING
![Page 1: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/1.jpg)
PROGRAMACIÓN DE OBJETOS TECNOLÓGICOSCONTROL DE BARRERA DE PARKING
PREMIOS CIENTÍFICOS-TECNOLÓGIOCOS“DON BOSCO”
PRIMERA EDICIÓN, CURSO 2011-2012
IES “PINTOR RAFAEL REQUENA”Caudete-AlbaceteTaller de RobóticaTutor: Manuel HIDALGO DÍAZ
![Page 2: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/2.jpg)
Taller de Robótica
• Actividad extraescolar.• Plan de dinamización de los recreos• Uno o dos recreos a la semana• Alumnos de 1º ESO
• Joel Serrano López • Ricardo Soler Bañón• Alejandro Vicente Cózar • Juan Conejero Sivó • Alejandro Cantó Rubio
![Page 3: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/3.jpg)
Taller de Robótica
• Actividades en grupo• Conocer objetos tecnológicos• Controlar los objetos por programación• Realizar pequeños proyectos
![Page 4: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/4.jpg)
Taller de Robótica
• Placa Arduino
![Page 5: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/5.jpg)
Taller de Arduino• IDE Arduino (Entorno de desarrollo)
![Page 6: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/6.jpg)
Taller de Arduino• Estructura de un programa
![Page 7: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/7.jpg)
Taller de Robótica
• Placa de actividades
![Page 8: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/8.jpg)
Taller de Robótica
![Page 9: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/9.jpg)
Maqueta del proyecto
• Diagrama de bloques
![Page 10: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/10.jpg)
Maqueta del proyecto
![Page 11: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/11.jpg)
Elementos tecnológicos
• Diodo LED
• Están conectados a los pines 3-4-5• Entrada digital• Semáforo
![Page 12: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/12.jpg)
Elementos tecnológicos• Actividad de prueba de LED
– Parpadeo de los LEDs
![Page 13: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/13.jpg)
Elementos tecnológicos
• Pulsador
• Controla encendido/apagado de los procesos• Entrada digital• Tensión 5V 1 digital• Tensión 0V 0 digital
![Page 14: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/14.jpg)
Elementos tecnológicos• Actividad de prueba de Pulsador
– Cambia temporalmente el LED
![Page 15: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/15.jpg)
Elementos tecnológicos• Servomotor
• Actuador que sube y baja la barrera• Partes
• Motor eléctrico de continua• Circuito electrónico de control • Reductora
![Page 16: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/16.jpg)
Elementos tecnológicos• Servomotor
– Se controla con una señal PWM (modulación por anchura de pulso)
Arduino utiliza la librería “Servo.h”
![Page 17: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/17.jpg)
Elementos tecnológicos• Actividad de prueba de Servomotor
– Cambia de posición la barrera durante un tiempo
![Page 18: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/18.jpg)
Elementos tecnológicos• Sensor de infrarrojos (IR)
– Detecta la presencia de un obstáculo a una distancia
• Da una tensión según la distancia• Entrada analógica• La tensión 0V a 5V pasa 0 a1023
• En el sensor IR varía:• 0,4V a 3,2V• 100 a 640
• Valor de seguridad 350
![Page 19: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/19.jpg)
Elementos tecnológicos• Actividad Sensor de infrarrojos (IR)
![Page 20: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/20.jpg)
Elementos tecnológicos• Actividad Sensor de infrarrojos (IR)
![Page 21: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/21.jpg)
Elementos tecnológicos• Los programas de las actividades están en la
memoria.• El resultado de la combinación de estos
elementos es la maqueta.• El siguiente video es el Control de la barrera
con pulsador.
![Page 22: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/22.jpg)
Control barrera con pulsador
![Page 23: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/23.jpg)
Control barrera con pulsadorCódigo de programa
• Variables#include <Servo.h> //libreriasServo servoBarrera; //Declaracion del objeto servomotor int pinLedRojo = 5; //Declaraciones de pines int pinLedAmarillo = 4; int pinLedVerde = 3; int pulsador = 2; int sensorIR = A5; int pulsaValor; //Declaracion variables int sensorValor;
![Page 24: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/24.jpg)
Control barrera con pulsadorCódigo de programa
• Configuracionvoid setup() { pinMode(pinLedRojo, OUTPUT); //configuracion de pines pinMode(pinLedAmarillo, OUTPUT); pinMode(pinLedVerde, OUTPUT); servoBarrera.attach(6); servoBarrera.write(5); //posicion inical de la barrera digitalWrite(pinLedRojo, 0); // Semaforo Verde digitalWrite(pinLedAmarillo, 0); digitalWrite(pinLedVerde, 1); }
![Page 25: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/25.jpg)
Control barrera con pulsadorCódigo de programa
• Programa principalvoid loop() //programa principal { pulsaValor = digitalRead(pulsador); //leemos el valor del pulsador if (pulsaValor == 1) //preguntamos el valor del pulsador y actuamos { digitalWrite(pinLedVerde, 0); digitalWrite(pinLedAmarillo, 1); delay(3000); digitalWrite(pinLedAmarillo, 0); digitalWrite(pinLedRojo, 1); delay(500); servoBarrera.write(90); //barrera abierta delay(10000); //semaforo en rojo 10seg
![Page 26: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/26.jpg)
Control barrera con pulsadorCódigo de programa
sensorValor = analogRead(sensorIR); //lee valor sensor while (sensorValor > 350) //repite la lectura { //porque hay un obstaculo sensorValor = analogRead(sensorIR); delay(10); } delay(2000); servoBarrera.write(5); //barrera cerrada delay(1000); } digitalWrite(pinLedRojo, 0); //semaforo en verde digitalWrite(pinLedAmarillo, 0); digitalWrite(pinLedVerde, 1); delay(10); }
![Page 27: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/27.jpg)
Elementos tecnológicos• Módulo Bluetooth
– Permite una comunicación con otro dispositivo que tenga bluetooth, como un móvil con SO Android.
• Se conecta los pines• Tx y Rx del módulo
• A los pines Rx y Tx de Arduino
![Page 28: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/28.jpg)
Elementos tecnológicos• Módulo Bluetooth
– La aplicación en el móvil Android utilizada es un mando con botones.
• Conectado el módulo de Arduino al móvil• Al pulsar el botón central verde envía la letra ‘C’• El programa de Arduino tiene una intsrucción que escucha el
puerto serie.• Si recibe la letra ‘C’ hace la misma función que el pulsador
Funcionamiento
![Page 29: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/29.jpg)
Maqueta del proyecto con Bluetooth
• Diagrama de bloques
![Page 30: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/30.jpg)
Control barrera por bluetooth
![Page 31: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/31.jpg)
Control barrera con BluetoothCódigo de programa
• Variables#include <Servo.h> //libreriasServo servoBarrera; //Declaracion del objeto servomotor int pinLedRojo = 5; //Declaraciones de pines int pinLedAmarillo = 4; int pinLedVerde = 3; int pulsador = 2; int sensorIR = A5; int sensorValor; //Declaracion variables int boton; //int pulsaValor;
![Page 32: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/32.jpg)
Control barrera con Bluetooth Código de programa
• Configuracionvoid setup() { pinMode(pinLedRojo, OUTPUT); //configuracion de pines pinMode(pinLedAmarillo, OUTPUT); pinMode(pinLedVerde, OUTPUT); servoBarrera.attach(6); servoBarrera.write(5); //posicion inical de la barrera digitalWrite(pinLedRojo, 0); // Semaforo Verde digitalWrite(pinLedAmarillo, 0); digitalWrite(pinLedVerde, 1);
Serial.begin(9600); }
![Page 33: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/33.jpg)
Control barrera con Bluetooth Código de programa
• Programa principalvoid loop() //programa principal { if (Serial.available()) //Escuchamos el puerto de comunicaciones { boton = Serial.read() { if (boton == ‘C’) //preguntamos el valor de boton y actuamos { digitalWrite(pinLedVerde, 0); digitalWrite(pinLedAmarillo, 1); delay(3000); digitalWrite(pinLedAmarillo, 0); digitalWrite(pinLedRojo, 1); delay(500); servoBarrera.write(90); //barrera abierta delay(10000); //semaforo en rojo 10seg
![Page 34: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/34.jpg)
Control barrera con Bluetooth Código de programa
sensorValor = analogRead(sensorIR); //lee valor sensor while (sensorValor > 350) //repite la lectura { //porque hay un obstaculo sensorValor = analogRead(sensorIR); delay(10); } delay(2000); servoBarrera.write(5); //barrera cerrada delay(1000); boton = ‘ ‘; } digitalWrite(pinLedRojo, 0); //semaforo en verde digitalWrite(pinLedAmarillo, 0); digitalWrite(pinLedVerde, 1); delay(10); }
![Page 35: PROGRAMACIÓN DE OBJETOS TECNOLÓGICOS CONTROL DE BARRERA DE PARKING](https://reader036.fdocuments.co/reader036/viewer/2022070421/5681609a550346895dcfc108/html5/thumbnails/35.jpg)
Gracias por su atención
IES “PINTOR RAFAEL REQUENA”Caudete-AlbaceteTaller de RobóticaTutor: Manuel HIDALGO DÍAZ