HERRAMIENTAS Y MATERIALES
Descripción Cantidad
Pic 18f4550 01
Motor paso a paso 01
Transformador de 110v a 12v 01
Transistores BD136 04
BS548 04
Diodos 1n4004. 08
Resistencias varios valores 32
Potenciómetros. 01
Diodos leds 05
Regulador 7805. 02
Compuertas lógicas. 02
LCD. 01
Condensadores 220nf a 150V 02
Triac BT 137. 02
Moc 3021 02
Focos de luz. 02
Foto celda. 01
Diodo laser. 01
Protoboard 01
Caimanes. 02
Multimetro Digital. 01
Programa Control del motor elaborado en MPLAB
#include <18F4550.h>
#device adc=10
#include <usb_bootloader.h>
#fuses PLL1,CPUDIV4,USBDIV,HSPLL,FCMEN,IESO,PUT,BROWNOUT_SW,BORV20,VREGEN
#fuses NOWDT,WDT32768,CCP2C1,NOPBADEN,LPT1OSC,MCLR,STVREN,NOLVP,NOXINST
#fuses NOPROTECT,NOCPB,NOCPD,NOWRT,NOWRTC,NOWRTB,NOWRTD,NOEBTR,NOEBTRB
#use delay(clock=16000000)
#ZERO_RAM
#define LCD_DATA_PORT getenv("SFR:PORTB")
#include <lcd.c>
void main()
{
set_tris_a(0b00001000);
set_tris_d(0b00000000);
set_tris_b(0b00000000);
set_tris_c(0b00000000);
set_tris_e(0b00000001);
output_low(pin_c0);
output_low(pin_c1);
output_low(pin_c7);
output_low(pin_c6);
output_low(pin_d0);
output_low(pin_d1);
lcd_init();
inicio:
lcd_gotoxy(1,1);
lcd_putc(" PARKING OF ");
lcd_gotoxy(1,2);
lcd_putc(" CARS ");
if(input_state(pin_a3)==1)// ACTIVACION DEL PULSO QUE ENVIA LAS COMPUERTAS LOGICAS
{
output_high(pin_d0);// PULSO ENVIADO PARA ACTIVAR PRIMERA BOMBILLA, VA AL MOC
lcd_putc('\f');
lcd_putc(" BIENVENIDO AL ");
lcd_gotoxy(1,2);
lcd_putc(" PARKING CAR'S ");
output_high(pin_c7);// CONTROL MOTOR PASO A PASO
delay_ms(350);
output_low(pin_c7);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c0);
output_low(pin_c0);
delay_ms(6000);
output_high(pin_d1);// PRENDE SEGUNDO BOMBILLO, PULSO AL SEGUNDO MOC
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c6);
output_low(pin_c6);
lcd_putc('\f');
output_low(pin_d0);// APAGA BOMBILLA No. 1
lcd_gotoxy(1,1);
lcd_putc(" PARKING OF ");
lcd_gotoxy(1,2);
lcd_putc(" CARS ");
delay_ms(4000);
output_low(pin_d1);// APAGA BOMBILLA No. 2
goto inicio;
}
else
{
goto inicio;
}
}
DATASHEET BT137
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVfneHuPG8xjhkl-diIo96zYCArBhiqVbuaLC7MbQ9fsblZjZSliVepGewzJRdq9URfUFB9MSjPA5fWD3-FKLv0ko8x-BMsI42SheS9P2IN08Vkg277uVEO4CIMao4LMEyFRxZUrqUujK8/s400/DATASHEET+BT137+2.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG-eLC1-R_MNs_SPWfoo8McJi0C4n3liwOz9MBqSSlBQukN_PNb0Nd88jdx1_CXfGoc9KkAXK6Zh5uWy0yA0r1B-GL50JDssDQhv8GcshcGbGuIktf5l90oS3oSZ_4Gw4eUUejABIURiup/s400/DATASHEET+BT137+3.png)
DATASHEET MOC 3021
3. ENSAYO EN LA PROTOBOARD.
#include <18F4550.h>
#device adc=10
#include <usb_bootloader.h>
#fuses PLL1,CPUDIV4,USBDIV,HSPLL,FCMEN,IESO,PUT,BROWNOUT_SW,BORV20,VREGEN
#fuses NOWDT,WDT32768,CCP2C1,NOPBADEN,LPT1OSC,MCLR,STVREN,NOLVP,NOXINST
#fuses NOPROTECT,NOCPB,NOCPD,NOWRT,NOWRTC,NOWRTB,NOWRTD,NOEBTR,NOEBTRB
#use delay(clock=16000000)
#ZERO_RAM
#define LCD_DATA_PORT getenv("SFR:PORTB")
#include <lcd.c>
void main()
{
set_tris_a(0b00001000);
set_tris_d(0b00000000);
set_tris_b(0b00000000);
set_tris_c(0b00000000);
set_tris_e(0b00000001);
output_low(pin_c0);
output_low(pin_c1);
output_low(pin_c7);
output_low(pin_c6);
output_low(pin_d0);
output_low(pin_d1);
lcd_init();
inicio:
lcd_gotoxy(1,1);
lcd_putc(" PARKING OF ");
lcd_gotoxy(1,2);
lcd_putc(" CARS ");
if(input_state(pin_a3)==1)// ACTIVACION DEL PULSO QUE ENVIA LAS COMPUERTAS LOGICAS
{
output_high(pin_d0);// PULSO ENVIADO PARA ACTIVAR PRIMERA BOMBILLA, VA AL MOC
lcd_putc('\f');
lcd_putc(" BIENVENIDO AL ");
lcd_gotoxy(1,2);
lcd_putc(" PARKING CAR'S ");
output_high(pin_c7);// CONTROL MOTOR PASO A PASO
delay_ms(350);
output_low(pin_c7);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c0);
output_low(pin_c0);
delay_ms(6000);
output_high(pin_d1);// PRENDE SEGUNDO BOMBILLO, PULSO AL SEGUNDO MOC
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c6);
delay_ms(350);
output_low(pin_c6);
output_high(pin_c0);
delay_ms(350);
output_low(pin_c0);
output_high(pin_c1);
delay_ms(350);
output_low(pin_c1);
output_high(pin_c7);
delay_ms(350);
output_low(pin_c7);
output_high(pin_c6);
output_low(pin_c6);
lcd_putc('\f');
output_low(pin_d0);// APAGA BOMBILLA No. 1
lcd_gotoxy(1,1);
lcd_putc(" PARKING OF ");
lcd_gotoxy(1,2);
lcd_putc(" CARS ");
delay_ms(4000);
output_low(pin_d1);// APAGA BOMBILLA No. 2
goto inicio;
}
else
{
goto inicio;
}
}
DATASHEET BT137
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVfneHuPG8xjhkl-diIo96zYCArBhiqVbuaLC7MbQ9fsblZjZSliVepGewzJRdq9URfUFB9MSjPA5fWD3-FKLv0ko8x-BMsI42SheS9P2IN08Vkg277uVEO4CIMao4LMEyFRxZUrqUujK8/s400/DATASHEET+BT137+2.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG-eLC1-R_MNs_SPWfoo8McJi0C4n3liwOz9MBqSSlBQukN_PNb0Nd88jdx1_CXfGoc9KkAXK6Zh5uWy0yA0r1B-GL50JDssDQhv8GcshcGbGuIktf5l90oS3oSZ_4Gw4eUUejABIURiup/s400/DATASHEET+BT137+3.png)
DATASHEET MOC 3021
3. ENSAYO EN LA PROTOBOARD.
No hay comentarios:
Publicar un comentario