INTRODUCCIÓN
Yo sé que muchos de nosotros en algún momento hemos querido controlar cualquier aparato eléctrico desde nuestro celular a través del reconocimiento de voz. Por ejemplo, si quisiera encender la luz de mi habitación; simplemente digo, – “encender foto habitación” y, automáticamente se encenderá la luz respectiva. Además reproducirá un sonido, – “foco habitación encendido”. de esta manera podemos tener el control absoluto de todos nuestros aparatos electrodomésticos que tenemos instalados en nuestro hogar.
Precisamente en este video crearemos una tarjeta PCB capaz de controlar 12 salidas de corriente alterna de 110 – 220V desde nuestro celular a través del reconocimiento de voz.
DATOS TÉCNICOS
-
- Tensión de alimentación……………………….…………12VDC
- Corriente de alimentación………………….……………120mA
- Programación Directa………………………………….….Ordenador – Tarjeta
- Entorno de programación………………………..……..Arduino IDE
- Serial PORT……………………………………………………..SÍ
- Entradas digitales (5-12V)…………………………….…..2
- Bluetooth………………………………………………………………..Sí
- Reproductor mp3 (DFPlayer)……………………………….Sí
- Salida TRIAC…………………………………………………….12
- Tensión salida AC…………………………….……110-250V
- Corriente AC……………………….……………….2A
LISTA DE COMPONENTES ELECTRÓNICOS
- U1, U2; Optoacoplador TLP127 (see & buy)
- U3; Circuito Integrado Transceiver USB CH340C ( see & buy )
- U4,U7,U9,U11,U13,U15,U17,U19,U21,U23,U25,U28; Two-way thyristor 600V 4A 1.3V 5mA TO-252-2(DPAK) Thyristors – TRIACs RoHS ( see & buy )
- U5,U6,U8,U10,U12,U14,U16,U18,U20,U22,U24,U26; Triac 3750Vrms 70mA SOP-4_P2.54 Triac Optocouplers (see & buy)
- U27; Fixed 18V 5V 1.3V @ 800mA SOT-223 Dropout Regulators (see & buy)
- U29; Microcontrolador ATmega328p AU (see & buy)
- J1,J2,J12,J13; Borneras 2PIN (see & buy)
- J3; Jack power 12V (see & buy)
- J4; Modulo Bluetooth hc -06
- J5; Micro USB tipo B (see & buy)
- J6,J7; DFPlayer (Reproductor mp3) (see & buy)
- J8; Plug-in headphone holder 5 Female Horizontal(see & buy)
- J9, J10,J11; borneras 3PIN (see & buy)
- D3; Diodo Schottky SS14-T (see & buy)
- D4,D17; Led smd 1206 ( see & buy )
- C3; Capacitor ceramico 0.1uF(1206) (see & buy)
- C4; Capacitor electrolítico SMD 220uF ( see & buy )
- C5; Capacitor electrolítico SMD 47uF ( see & buy )
- C1,C2,C6-C9; Capacitor cerámico 0.1uF (0603) ( see & buy )
- R1-R2; Resistencia SMD 1/8W, 10k Ohm, package 0805 ( see & buy )
- R3; Resistencia SMD 1/10W, 3.3k Ohm, package 0603 ( see & buy )
- R4,R5,R7; Resistencia SMD 1/10W, 1k Ohm, package 0603 ( see & buy )
- R6; Resistencia SMD 1/10W, 10k Ohm, package 0603 ( see & buy )
- R8,R10,R12,R14,R16,R18,R20,R22,R24,R26,R28,R30; Resistencia SMD 1/8W, 470 Ohm, package 0805 ( see & buy )
- R9,R11,R13,R15,R17,R19,R21,R23,R25,R27,R39,R31; Resistencia SMD 1/10W, 220 Ohm, package 0603 ( see & buy )
- R32; Resistencia SMD 1/10W, 1M Ohm, package 0603 ( see & buy )
- BTN1; Pulsador SMD (see & buy)
- X1; Crystal SMD 16Mhz ( see & buy )
PASOS PARA SUBIR UN PROGRAMA
PASO 1 : SUBIR GESTOR DE ARRANQUE (BOOTLOADER)
Para poder usar un microcontrolador nuevo (atmega328p-pu), es necesario subir un un gestor de arranque como también llamado “BOOTLOADER”, esto nos facilitará subir programas en futuras ocasiones.
finalmente para quemar el bootloader se tendrá que realizar a través de los pines ISP, que prácticamente serían los pines [ (MOSI=11) (MISO = PIN12) (SCK=PIN13) (Slave=PIN10) ]. Para subir y quemar el gestor de arranque necesitaremos un arduino UNO ó MEGA y realizar las siguientes conexiones (ARDUINO UNO – MAIN BOARD).
PASO 2 : SUBIR PROGRAMA; PC – MAIN BOARD
Después de haber subido el gestor de arranque finalmente ya podremos subir cualquier programa como normalmente lo realizamos a través del puerto serie.
PARTES Y CONEXIONES EXTERNAS
CÓDIGO DEMO ARDUINO
#include "Arduino.h" #include "SoftwareSerial.h" #include "DFRobotDFPlayerMini.h" const int out1 = 17; // cocina const int out2 = 16; // comedor const int out3 = 15; // sala const int out4 = 14; // habitación 1 const int out5 = 13; // habitación 2 const int out6 = 12; // habitación 3 const int out7 = 9; // habitación 4 const int out8 = 8; // habitación 5 const int out9 = 7; // habitación ventilador const int out10 = 6; // habitación radio const int out11 = 5; // habitación puerta 1 const int out12 = 4; // habitación puerta 2 SoftwareSerial mySoftwareSerial(11, 10); // RX, TX DFRobotDFPlayerMini myDFPlayer; void printDetail(uint8_t type, int value); char dato; void setup() { mySoftwareSerial.begin(9600); Serial.begin(9600); Serial.println(); Serial.println(F("DFRobot DFPlayer Mini Demo")); Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)")); if (!myDFPlayer.begin(mySoftwareSerial)) { //Use softwareSerial to communicate with mp3. Serial.println(F("Unable to begin:")); Serial.println(F("1.Please recheck the connection!")); Serial.println(F("2.Please insert the SD card!")); while (true); } Serial.println(F("DFPlayer Mini online.")); myDFPlayer.setTimeOut(500); //Set serial communictaion time out 500ms //----Set volume---- myDFPlayer.volume(25); //Set volume value (0~30). myDFPlayer.volumeUp(); //Volume Up myDFPlayer.volumeDown(); //Volume Down //----Set different EQ---- myDFPlayer.EQ(DFPLAYER_EQ_NORMAL); //----Set device we use SD as default---- myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD); pinMode(out1, OUTPUT); pinMode(out2, OUTPUT); pinMode(out3, OUTPUT); pinMode(out4, OUTPUT); pinMode(out5, OUTPUT); pinMode(out6, OUTPUT); pinMode(out7, OUTPUT); pinMode(out8, OUTPUT); pinMode(out9, OUTPUT); pinMode(out10, OUTPUT); pinMode(out11, OUTPUT); pinMode(out12, OUTPUT); } void loop() { if (Serial.available()) { dato = Serial.read(); switch (dato) { case 'A' : digitalWrite (out1, HIGH); myDFPlayer.play(1); break ; case 'a' : digitalWrite (out1, LOW); myDFPlayer.play(2); break ; case 'B' : digitalWrite (out2, HIGH); myDFPlayer.play(3); break ; case 'b' : digitalWrite (out2, LOW); myDFPlayer.play(4); break ; case 'C' : digitalWrite (out3, HIGH); myDFPlayer.play(5); break ; case 'c' : digitalWrite (out3, LOW); myDFPlayer.play(6); break ; case 'D' : digitalWrite (out4, HIGH); myDFPlayer.play(7); break ; case 'd' : digitalWrite (out4, LOW); myDFPlayer.play(8); break ; case 'E' : digitalWrite (out5, HIGH); myDFPlayer.play(9); break ; case 'e' : digitalWrite (out5, LOW); myDFPlayer.play(10); break ; case 'F' : digitalWrite (out6, HIGH); myDFPlayer.play(11); break ; case 'f' : digitalWrite (out6, LOW); myDFPlayer.play(12); break ; case 'G' : digitalWrite (out7, HIGH); myDFPlayer.play(13); break ; case 'g' : digitalWrite (out7, LOW); myDFPlayer.play(14); break ; case 'H' : digitalWrite (out8, HIGH); myDFPlayer.play(15); break ; case 'h' : digitalWrite (out8, LOW); myDFPlayer.play(16); break ; case 'I' : digitalWrite (out9, HIGH); myDFPlayer.play(17); break ; case 'i' : digitalWrite (out9, LOW); myDFPlayer.play(18); break ; case 'J' : digitalWrite (out10, HIGH); myDFPlayer.play(19); break ; case 'j' : digitalWrite (out10, LOW); myDFPlayer.play(20); break ; case 'K' : digitalWrite (out11, HIGH); myDFPlayer.play(21); break ; case 'k' : digitalWrite (out11, LOW); myDFPlayer.play(22); break ; case 'L' : digitalWrite (out12, HIGH); myDFPlayer.play(23); break ; case 'l' : digitalWrite (out12, LOW); myDFPlayer.play(24); break ; } } }
6 comentarios. Dejar nuevo
Me parece un excelente proyecto.
Como puedo obtener la programacion y conseguir los componentes.
Gracias.
Me a gustado mucho tu proyecto, pero tengo una duda, se puede usar con iPhone? y con siri
ya que la App es para Android.
Gracias.
Como puedo contactarme con ustedes
escríbenos a nuestro correo [email protected]
Este montaje es completamente operativo….o es una demo?
Completamente operativo 🙂