Escuela Superior Politécnica Del Litoral
Escuela Superior Politécnica Del Litoral
Presentado por:
GUAYAQUIL – ECUADOR
2015
II
AGRADECIMIENTO
vernos triunfantes.
profesionalismo.
DEDICATORIA
TRIBUNAL DE SUSTENTACIÓN
SUBDECANA FIEC
UNIDAD ACADÉMICA
DECLARACIÓN EXPRESA
RESUMEN
INDICE GENERAL
AGRADECIMIENTO ...................................................................................... II
RESUMEN .................................................................................................... VI
ABREVIATURAS ........................................................................................... X
CAPÍTULO 1 .................................................................................................. 1
CAPÍTULO 2 .................................................................................................. 6
CAPÍTULO 3 ................................................................................................ 15
VIII
METODOLOGÍA .......................................................................................... 15
CAPÍTULO 4 ................................................................................................ 33
CAPÍTULO 5 ................................................................................................ 44
ABREVIATURAS
HIGH Alto
ID Identidad
LOW Bajo
MISO Master Input, Slave Output - Entrada del Maestro y Salida del
Esclavo
MOSI Master Output, Slave Input - Salida del Maestro y Entrada del
Esclavo
OFF Apagado
ON Encendido
Radiofrecuencia
XI
RX Recepción
TX Transmisión
INDICE DE FIGURAS
Fig. 5.18 Control manual planta baja del panel frontal ............................ 61
Fig. 5.20 Control manual planta alta del panel frontal ............................. 63
Fig. 5.44 Prueba seis del control para ambientación ............................. 109
Fig. 7.1 Resultado uno en el cual se visualizan los LEDS encendidos .. 167
INDICE DE TABLAS
INTRODUCCION
domótica ofrece.
1
Véase el anexo3 en el cual se adjunta la proforma dada por Bticino.
3
1.3 JUSTIFICACIÓN
demostrados en la maqueta.
4
extremadamente elevado.
computadora.
2
Véase la tabla# 3 que es el cuadro comparativo de costos de software.
3
Véase la tabla# 2 en la que se describen algunos de los módulos eléctricos y domóticos de Bticino.
5
4
Es un toolkit o herramienta que permite la interface entre Labview y la webcam
5
Es un toolkit o herramienta que permite la interface entre Labview y la tarjeta Arduino mega2560
CAPÍTULO 2
FUNDAMENTO TEÓRICO
vivienda.
pulsadores, etc.) que desee el usuario, sino que limitan a los modelos
control.[4]
[2]
GESTIÓN DE LA SEGURIDAD:
GESTIÓN DE LA COMUNICACIÓN:
y costos.
GESTION ENERGÉTICA:
DISPOSITIVO DESCRIPCION
Será conectado directamente al
Arduino mega
computador y a los diferentes
2560
módulos.
Para la programación del módulo
Arduino UNO
Shield NFC PN532.
Usado para la programación del
Arduino UNO
módulo de reconocimiento de voz.
Usado para la programación de la
Arduino UNO
tira de LEDS.
Módulo Shield Módulo lector de tarjeta magnética
NFC pn532 compatible con Arduino.
Módulo de reconocimiento de voz
Módulo EasyVR
adaptable a la programación con
Shield 2.0
Arduino.
Usado para la captura de
Cámara zen
imágenes.
Incluye el integrado WS2812B6,
Tira led strip tira programable para el control de
los colores en los LEDS RGB. [7]
Tabla # 1 Módulos utilizados
6
Para conocer con más detalle el integrado véase el anexo en el cual se adjunta el datasheet.
12
SISTEMA
DOMOTICO
Gestiones presentes
en la maqueta
PERSIANAS
DE ACCESO
GARAJE
7
Arquitecto de la ciudad de San Diego California, premiado por su desarrollo y tendencia
única en arquitectura; para más información visite el sitio web:
http://www.jonathansegalarchitect.com/index.html
14
8
Véase el capítulo seis en el cual se describe el funcionamiento del mismo.
9
Examínese el capítulo seis en el cual se describe el funcionamiento y véase los anexos en el cual se
adjunta el datasheet.
10
Véase los anexos en el cual se adjunta el datasheet.
11
Obsérvese los anexos en el cual se adjunta el datasheet.
CAPÍTULO 3
METODOLOGÍA
Funciones de videoporteros y
HD4690 videocontrol, gestión de contenidos
HC4690 multimedia presentes en fuentes 1 2271,92
HS4690 externas (usb y SDCard), en red
LAN, IP.
N4578N
Interfaz de radio para la integración
NT4578N ------ 1 79,92
de los sistemas de radio.
L4578N
HD4607
Mando protegido con código,
HC4607 1 91,77
memoriza hasta 30 identificativos.
HS4607
391661
Telecámara de interior para
391662 1 4331,69
instalaciones de 2 hilos
391663
Touch LightManager
permite programar y
Touch
controlar todos los 1 1047,8
LightManager
elementos del sistema a
través de pantalla táctil.
Touch LightKeypad
permite el control desde
otro punto. Activa por
Touch LightKeypad
defecto: 6 escenas +
1 200,60
subida/bajada de
persianas y apagado.
Módulo control de
Módulo Control persianas para el control
- 1 179,30
persianas de motores con finales de
carrera.
Módulo conversor de
Conversor señales señales digitales para la
- 1 134,48
Digitales vinculación de una señal
230V en función scena.
23
Módulo conversor de
señales analógicas para
Conversor señales la vinculación de una
-- 1 151,29
Analógicas señal tipo 1-10V en
función scena detector
para el control de luz.
Escenarios de iluminación
y ahorro de energía de
Sensor Daylight 1-
hasta un 40 %. 1 -
10V standalone
Compensa el 100% de la
luz entrante
Central de telecontrol de
servicios domésticos a
Central SimonVox través del teléfono,
mediante la previa 1 172,52
basic
introducción de un código
personal.
Central telecontrol
5 entradas (NA-NC). 5
230V~ 50/60 Hz 1 723,39
salidas de relé
CRA
El detector de movimiento
debe colocarse en el
Detector de
techo a una altura ideal
movimiento de 1 93,92
de 2,4 mt. Dispone de un
techo
ángulo de cobertura de
360º.
Detector de
presencia Regula la intensidad de
1 116,10
regulador de luz luz de las luminarias.
techo empotrar
Detector pasivo de
infrarrojos con
Detector de alimentación a 24 V c.c.
infrarrojos pasivo desde la fuente, ángulo 1 115,57
PIR de cobertura 110 vertical
y 80 horizontal, alcance
de 6 a 8m.
Detector crepuscular con
alimentación a 24V c.c.
Detector desde la fuente, regulable
1 137,11
crepuscular de 5 a 100 lux con led
indicador de contacto
cerrado.
Protocolo de
Software de comunicaciones, software
instalación SIMON y sistema operativo 1 765,12
Vit@ común para la tecnología
Lonworks.
Kit de control de
El kit controla los
acceso autónomo
accesos utilizando tarjetas 240,04
por tarjeta
RFID.
RFID
Registro de usuarios,
restricción de acceso,
posibilidad de control y
Lector biométrico y
monitorización a través de
RFID. Incluye 843,43
Internet. Combina el
Software
acceso con cámaras de
seguridad y ahorro
energético.
Terminal de bloqueo.
Simétrico.
Abre puertas Funcionamiento normal o
1 28,79
eléctrico 12 Vdc autónomo.
Funcionamiento normal o
invertido.
Tiene la función de un
Controlador de lector de control de
1 739,81
puerta 2 relés acceso o de un interruptor
de llave.
Fuente de alimentación
switching 12VDC - 2A
Fuente de Ideal para Alimentar
alimentación 12 Varias Cámaras ( Según 1 58,02
Vdc 2A Modelo) o Cámaras con
Movimiento
Sensor CMOS de 2-
megapixel
Cámara Domo Filtro de corte IR con
Día/Noche función Día / Noche,
recorte de vídeo para 1 207,32
Antivandálica
Exterior IP66 ahorrar ancho de banda,
detección de
manipulación y sabotaje
Juego 4
Juego de 4 Conectores
Conectores DC 1 13,85
para alimentación DC
alimentación
Monitor profesional de
Monitor de video alto rendimiento, especial
vigilancia para funcionar de forma 1 516,90
profesional ininterrumpida.
Domobak:
Switchlinc-
Interruptor dimmer para
INSTEON
aumentar o disminuir la luz de 1 59,99
Dimmer (Dual-
un espacio.
Band)
27
La ENV- VST -C es un
termostato de comunicación
programable para la
programación automática de 1 400,25
ENV-VST-C
la temperatura y los ajustes de
humedad relativa y la
protección en corte de luz.
NMX-VCC-
1000-WM La cámara Sereno puede ser
Sereno™ montado en variedad de 1 163
Camera Wall superficies.
Mount
Se apaga automáticamente
después de que se detenga el
Motion sensor 1 34,99
movimiento (ajustable entre 30
segundos y 2 horas)
INSTEON 2672-
222 LED Bulb, Bombilla regulable en red. 1 29,99
8-wat
Tabla # 4 Precios de productos Domobak.
12
Véase los anexos ya que se adjunta el plano en formato A3 para las figuras 3.1 y 3.2.
30
Corrie
Corrie nte
Volta nte Nomin
Nombre Función
je [V] Inicial al con
[A] Carga
[A]
Movimiento de apertura de la puerta del
Servomotor 5 0,13 0,075
hogar
Arduino -
9 0,05 Módulo de control de la tira de LEDS
Pololu
Arduino-
9 0,13 Lector de la tarjeta magnética
NFC
Tira de
5 0,05 0,7 Tira de LEDS para a ambientación
LEDS
7805 12 0,18 Reductor de voltaje para los Arduinos
Arduino
5 0,3 Procesador central
Mega
Placa
5 0,055 Módulo que puede dimerizar 11 LEDS
Dimmer
Placa Módulo de control de apertura de 5
5 0,38
Relay LEDS y el riego
Placa PIC 5 0,003 Módulo de control de persianas
32
ambientación.
demostraciones respectivas.
planos:
escenarios.
pin asignado.
ON, se enviará el valor máximo PWM a la salida del puerto digital que
dimerización y control lumínico, por tal motivo para que los escenarios
50
oscuridad.
voltaje de alimentación.
es mayor a 25.
botonera activa en estado On, funcionará el control todos los dias sin
las 18:00 pm y el apagado esté en las 05:00 am, siendo la hora del
coerse enviará una señal true si la hora del sistema esta dentro del
rango asignado.
anteriormente.
tal razón solo se envía el valor numérico de uno a la salida del pin 23;
dimerización.
aprecia que no se ejerce ningún tipo de control para los push button y
5.1.5 AMBIENTACIÓN
tira.
programado en Labview.
71
activación en Labview.
75
if(PORTA.B3)then
servo3 = 1
else
if(STEPD >= mover3)then
servo3 = 0
end if
end if
'sistema sumador y restador para escribir los movimientos de los motores de paso
if(servo1)then
if (STEPB >= mover1 )then
STEPB = mover1
else
STEPB = STEPB + 1
end if
else
if(STEPB > 0)then
STEPB = STEPB - 1
end if
end if
if(servo2)then
if (STEPC >= mover2 )then
STEPC = mover2
else
STEPC = STEPC + 1
end if
else
if(STEPC > 0)then
STEPC = STEPC - 1
end if
end if
if(servo3)then
if (STEPD >= mover3 )then
STEPD = mover3
78
else
STEPD = STEPD + 1
end if
else
if(STEPD > 0)then
STEPD = STEPD - 1
end if
end if
end if
'Sistema de colocador del puerto B, C y D el control de motor de pasos
'Con su sistema de terminación en los extremos
if(STEPB >= mover1)then
mod1 = 0
PORTB = 0x00
else
if(STEPB <= 0)then
mod1 = 0
PORTB = 0X00
else
mod1 = ( STEPB )mod( pasos )
PORTB = valor[mod1]
end if
end if
if(STEPC >= mover2)then
mod2 = 0
PORTC = 0X00
else
if(STEPC <= 0)then
mod2 = 0
PORTC = 0X00
else
mod2 = ( STEPC )mod( pasos )
PORTC = valor[mod2]
end if
end if
if(STEPD >= mover3)then
mod3 = 0
PORTD = 0X00
else
if(STEPD <= 0)then
mod3 = 0
PORTD = 0X00
else
mod3 = ( STEPD )mod( pasos )
PORTD = valor[mod3]
79
end if
end if
‘Retardo de 1 ms de cada paso
delay_ms(1)
end
end
Los pines digitales del Arduino mega van conectados a los del puerto
Arduino mega.
13
Se usa el stepper motor 28BYJ-48, para comprender mejor el funcionamiento del mismo véase el
datasheet que se ha adjuntado en los anexos.
80
no es activada.
en buen estado.
en el ide de Arduino.
captura de imágenes.
con el bloque sesion in; mientras que con los bloques IMAQdx open
out del imaqdx grab cuyo tipo de dato sera rgb unsigned long de 32
bytes.
siendo el siguiente:
#include "WProgram.h"
#include "NewSoftSerial.h"
NewSoftSerial port(12,13);
#endif
EasyVR easyvr(port);
EasyVRBridge bridge;
uint32_t mask = 0;
int8_t group = 0;
uint8_t train = 0;
char name[32];
// Declaración de pin 8 como salida digital para la integración con el Arduino mega
int led = 8;
void setup()
{
// bridge mode?
if (bridge.check())
{
cli();
bridge.loop(0, 1, 12, 13);
}
// Declaración del tiempo serial de comunicación de 9600 bps
Serial.begin(9600);
port.begin(9600);
88
digitalWrite(led,LOW);
if (!easyvr.detect())
{
Serial.println("EasyVR not detected!");
for (;;);
}
easyvr.setPinOutput(EasyVR::IO1, LOW);
Serial.println("EasyVR detected!");
easyvr.setTimeout(5);
easyvr.setLanguage(EasyVR::SPANISH);
int16_t count = 0;
//Se realiza en enlace de la memoria del EASYVR para grupo de palabras grabadas
con sus respectivas voces para utilizar como la palabra ABRIR y con su clave SOL
Serial.print(" = ");
Serial.print(name);
Serial.print(", Trained ");
Serial.print(train, DEC);
if (!easyvr.isConflict())
Serial.println(" times, OK");
else
{
// Añade en código de 8 bits la palabra obtenida
void loop()
{
// Declaración de las variables principales
int idx_cmd;
int idx_pwd;
if (idx_pwd >= 0)
{
Serial.print("Password: ");
Serial.println();
// Se logra escuchar las 2 palabras y se confirma que son las palabras guardadas en
la memoria del easyVR donde se ejecuta la acción del easyVR en energizar un led
Serial.println("Access granted");
easyvr.playSound(SND_Access_granted , EasyVR::VOL_FULL);
digitalWrite(led,HIGH);
delay(2500); // wait a while
digitalWrite(led,LOW);
}
else // index of username and password differ, access is denied
Serial.println("Access denied");
easyvr.playSound(SND_Access_denied , EasyVR::VOL_FULL);
}
}
}
else
{
if (easyvr.isTimeout())
92
#define MISO 12
programación en la cual los códigos para el void setup y loop serán los
siguientes:
94
void setup()
{
Serial.begin(9600);
nfc.begin();
// Configura la Shield para leer etiquetas RFID:
nfc.SAMConfig();
Serial.println("Placa preparada para leer!");
}
void loop()
{
uint32_t id = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A);
if( id != 0 )
{
Serial.print("ID= "); Serial.println(id);
delay(1000);
}
}
de voz.
95
salida del pin 8, tal pin es leido por la tarjeta Arduino mega en el pin 2
conectado.
que ejecutará la función del switch en la vida real; y cada vez que se
Labview.
STEPB = STEPB - 1
end if
servo1 = 0
else
if(PORTA.B1)then
Puerto de activación del 1 motor de paso llamado servo cuando llegan al máximo se
auto detiene
servo1 = 1
else
if(STEPB >= mover1)then
servo1 = 0
end if
end if
Sistema sumador y restador para escribir los movimientos de los motores de paso
if(servo1)then
if (STEPB >= mover1 )then
STEPB = mover1
else
STEPB = STEPB + 1
end if
else
if(STEPB > 0)then
STEPB = STEPB - 1
end if
end if
Sistema de colocador del puerto B, C y D el control de motor de pasos con su
sistema de terminación en los extremos
if(STEPB >= mover1)then
mod1 = 0
PORTB = 0x00
else
if(STEPB <= 0)then
mod1 = 0
PORTB = 0X00
else
mod1 = ( STEPB )mod( pasos )
PORTB = valor[mod1]
end if
end if
end if
‘Retardo de 1 ms de cada paso
delay_ms(1)
end
end
102
del proyecto.
anteriormente:
104
SECCION I
PROGRAMACIÓN DE ESCENARIOS:
AMBIENTACIÓN:
CAPTURA DE IMÁGENES:
figura presentada.
riego, programandose para que sea por segundos y con la ayuda del
SECCION II
Fig.5.47.
iluminación hace posible que la gestión del confort esté lista para ser
113
programado.
SECCION III
DAQ y el software.
formato A1.
115
Tarjeta de Adquisición de
Arduino Mega 2560
Datos:
Sistema de Iluminación y Placa Electrónica con Relé
Riego: Placa Electrónica de DIMMER
Microcontroladores -
Sistema de Control Persianas y PIC16F887
Garaje: ULN2003APG Drivers
Motor de Paso – 28BYJ-48
Webcam
Arduino UNO
Sistema de Seguridad: EasyVR
PN532 NFC/RFID
Servomotor – HS-311
Sistema de Control Remoto por Módulo para transmisión
Radio Frecuencia Módulo para recepción
Sistema de Ambientación: Tira de LEDS – Pololu
Tabla # 7 Módulos implementados en la maqueta
14
Véase Anexo 6 para características y esquemático del Arduino Mega 2560
120
Serial. [17]
#define FIRMWARE_MAJOR 02
#define FIRMWARE_MINOR 00 // Preparación de los registros del Arduino para
permitir la comunicación serial
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
//Definición del ATmega2560 para el LIFA BASE (Interface de Labview )
#define DEFAULTBAUDRATE 9600 //Velocidad de bits por segundo natural
#else
#define DEFAULTBAUDRATE 115200 // Velocidad de bits por Segundo
#endif
#define MODE_DEFAULT 0
// Modulo Normal de los comandos de Labview si no hay comandos se coloca el
comando nulo
#define COMMANDLENGTH 15 // Paquete de 15 bytes de datos
15
Véase la bibliografía en el apartado [10]
16
Véase la bibliografía en el Anexo 7
123
Puerto de comunicación:
ambas partes.
sistema de riego.
132
Sala 2 Es dimerizable
Comedor 1 Es dimerizable
Estudio 2 ON/OFF
Garaje 1 ON/OFF
Cocina 2 ON/OFF
Riego 1 ON/OFF
2560.
17
Visualícese al Anexo 8 Datasheet 2N2222
134
fuerza.
pasos para realizar el giro adecuado y se debe repetir 512 veces los 8
pasos para dar una vuelta completa. Los motores fueron programados
para que realicen 2 giros cuando las persianas y la puerta del garaje
se estén abriendo.
18
Obsérvese en el Anexo 9 Características del PIC16F887
19
Visualice página 75 Programación en C de los microcontroladores
20
Revise en el Anexo 10 Características del Motor de Paso
136
21
El ULN2003APG es un conductor Darlington que permite la
cuyos colores son azul, rosado, amarillo, naranja y rojo; el cable Rojo
21
Véase en el Anexo 11 Características del ULN2003APG
138
Sistema de Seguridad
página siguiente:
139
22
Observe el Anexo 12 Características del Arduino UNO
140
23
Visualice Anexo 13 DataSheet PN532 NFC/RFID
141
Esclavos.
#include <Arduino.h>
24
Obsérvese la página 92 Programación Completa del Arduino UNO - PN532
144
#include "PN532.h"
byte pn532ack[] = {0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00};
byte pn532response_firmwarevers[] = {0x00, 0xFF, 0x06, 0xFA, 0xD5, 0x03};
#define PN532_PACKBUFFSIZ 64
byte pn532_packetbuffer[PN532_PACKBUFFSIZ];
PN532::PN532(uint8_t clk, uint8_t miso, uint8_t mosi, uint8_t ss) {
_clk = clk;
_miso = miso;
_mosi = mosi;
_ss = ss;
pinMode(_ss, OUTPUT);
pinMode(_clk, OUTPUT);
pinMode(_mosi, OUTPUT);
pinMode(_miso, INPUT);
}
…
uint8_t PN532::spiread(void) {
int8_t i, x;
x = 0;
digitalWrite(_clk, HIGH);
for (i=0; i<8; i++) {
if (digitalRead(_miso)) {
x |= _BV(i);
}
digitalWrite(_clk, LOW);
digitalWrite(_clk, HIGH);
}
return x;
}
párrafos anteriores.
El MISO y MOSI van en una trama de 8 bits, usando el CLK como reloj
palabra.
25
Visualice Anexo 14 Propiedades del EasyVR
147
#if defined(ARDUINO) && ARDUINO >= 100 //Detección de la versión del Arduino
#include "Arduino.h" //Uso de las librerías del Arduino
#include "SoftwareSerial.h" //Uso conexión con pines seriales
SoftwareSerial port(12,13); // Declaración de los pines para la comunicación serial
26
Veáse página 86 Programación Completa del Arduino UNO – EasyVR
149
lógico.
través de pulsadores.
28
Revisar Anexo 16 Módulos de Radio Frecuencia
29
Observe Anexo 17 Datasheet del Integrado HT12E
152
30
Revise Anexo 18 Datasheet del Integrado HT12D
153
Sistema de Ambientación
31
Veáse Anexo 19 Descripción del WS2812B
154
los 3 colores en código RGB teniendo 8 bits de datos por color (Rojo,
Verde y Azul).
Se dice que está en código cero; cuando la tira de LEDS detecta que
la duración del High es de 0.35 µs. y la duración del Low es 0.9 µs,
intensidad del color a mostrar en los LEDS; para ello la trama está
156
dividida en 3 arreglos con 8 bits cada uno, los primeros 8 bits es para
figura 90 y 91), donde destinará los 24 bits para cada LED, es decir si
sobre la tira; tal pin está conectado al DIN del LEDSTRIP (cable
para que cada led presente el color que ha sido programado. Se usa
común (GND).
D2, D3 y D4.
158
dispositivo con pin Dout sin conexión. Se comienza con el primer ciclo,
asignados; sucederá lo mismo hasta que todos los bits hayan sido
repitan la secuencia.
159
realizó en la maqueta:
160
Dimmer
Relay
ANÁLISIS DE RESULTADOS
COSTO
ITEM DESCRIPCION CANTIDAD TOTAL
UNITARIO
1 Relé 5V 20 1 20
2 Transistores 2N3904 10 0,1 1
3 Diodos 1N4148 10 0,05 0,5
4 Borneras 3 0,2 0,6
5 Resistencia 1/4 Watt 40 0,05 2
164
Total $ 652,14
Tabla # 14 Precios de elementos adquiridos.
COSTO COSTO
ITEM DESCRIPCION CANTIDAD
UNITARIO TOTAL
1 Blancola 1 lt 1 2,95 2,95
2 Amoladora 1 70 70
3 Arco sierra 1 5,35 5,35
4 Dcorlac 2 7,78 15,56
Plancha de plywood de 4
1 26,4 26,4
5 mm
Plancha de plywood de 9
1 15,54 15,54
6 mm
7 Lija agua 3 0,54 1,62
8 Lija madera 3 0,36 1,08
Funda de tornillo para
9 2 0,2 0,4
madera
10 Funda de tornillo pequeño 2 0,44 0,88
11 Pistola para silicón 1 1,78 1,78
12 Silicona barras 1 1,78 1,78
13 Brochas 2'' 2 0,49 0,98
14 Brocha prensada 1 1,78 1,78
15 Madera Balsa 3 1 3
16 Plumafon 1 0,7 0,7
17 Cinta aislante 2 6,24 12,48
166
7.2 PRESUPUESTOS
DESCRIPCION PRESUPUESTO
Componentes electrónicos 652,14
Herramientas para carpintería 295,27
Baquelitas 38,03
Inversión por pruebas y fallos 10
Total $ 995,44
Tabla # 16 Inversión total.
167
en la Fig. 7.3.
siguiente:
seguridad.
ninguna acción.
CONCLUSIONES Y RECOMENDACIONES
CONCLUSIONES:
programación.
174
RECOMENDACIONES:
insteon.
maniobrar el control.
tarjeta.
176
BIBLIOGRAFÍA
definicion/
domotica/domotica.shtml
http://www.monografias.com/trabajos15/edific-inteligentes/edific-
inteligentes.shtml
http://www.monografias.com/trabajos35/domotica/domotica.shtml
de-Domotica
receiver_transmitter
plug-and-play-usb-to-uart-brid.html
177
index.mvp/id/214\
spi
DOMÓTICA, http://books.google.com.ec/books?id=eB5Mp-
b0asAC&lpg=PA24&dq=instalacion+alarma&pg=PP1&redir_esc=y#v=onepag
e&q&f=true
http://books.google.com.ec/books?id=8ERFqWcdHAEC&pg=PA51&hl=es&so
urce=gbs_toc_r&cad=3#v=onepage&q&f=false
http://www.mediafire.com/view/lntn44jni0d1juw/DOMOTICA.pdf
178
Graw Hill,
http://www.nfiautomation.org/FREE_Download/Technical%20Documents/Ard
uino/30%20Arduino%20projects%20for%20the%20evil%20genius.pdf
ANEXOS
Corriente
Voltaje Corriente Nominal
Nombre Función
[V] Inicial [A] con Carga
[A]
Servomotor 5 0,13 0,075 Movimiento de apertura de la puerta del hogar
Arduino -Pololu 9 0,05 Módulo de control de la tira de LEDS
Arduino-NFC 9 0,13 Lector de la tarjeta magnética
Tira de LEDS 5 0,05 0,7 Tira de LEDS para a ambientación
7805 12 0,18 Reductor de voltaje para los Arduinos
Arduino Mega 5 0,3 Procesador central
Placa Dimmer 5 0,055 Módulo que puede dimerizar 11 LEDS
Placa Relay 5 0,38 Módulo de control de apertura de 5 LEDS y el riego
Placa PIC 5 0,003 Módulo de control de persianas
Motor de Paso 5 0,16 Motor que permite el movimiento de persiana y garaje
Total 0,18 2,033
Pruebas de Potencia
Potencia
Potencia
Nombre Nominal con Función
Inicial [W]
Carga [W]
Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 54 (of which 14 provide PWM output)
Analog Input Pins 16
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB of which 8 KB used by bootloader
SRAM 8 KB
EEPROM 4 KB
Clock Speed 16 MHz
The Arduino Mega2560 can be powered via the USB connection or with an external power supply. The power source is
selected automatically. External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The
adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery
can be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may
supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat
and damage the board. The recommended range is 7 to 12 volts.
The Mega2560 differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it
features the Atmega8U2 programmed as a USB-to-serial converter.
• VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts
from the USB connection or other regulated power source). You can supply voltage through this pin, or, if
supplying voltage via the power jack, access it through this pin.
• 5V. The regulated power supply used to power the microcontroller and other components on the board. This
can come either from VIN via an on-board regulator, or be supplied by USB or another regulated 5V supply.
• 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
• GND. Ground pins.
The ATmega2560 has 256 KB of flash memory for storing code (of which 8 KB is used for the bootloader), 8 KB of
SRAM and 4 KB of EEPROM (which can be read and written with the EEPROM library).
Each of the 54 digital pins on the Mega can be used as an input or output, using pinMode(), digitalWrite(), and
digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an
internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition, some pins have specialized functions:
• Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and 16 (TX); Serial 3: 15 (RX) and
14 (TX). Used to receive (RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the
corresponding pins of the ATmega8U2 USB-to-TTL Serial chip .
• External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21
(interrupt 2). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a
change in value. See the attachInterrupt() function for details.
• PWM: 0 to 13. Provide 8-bit PWM output with the analogWrite() function.
• SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication, which, although
provided by the underlying hardware, is not currently included in the Arduino language. The SPI pins are also
broken out on the ICSP header, which is physically compatible with the Duemilanove and Diecimila.
• LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when
the pin is LOW, it's off.
• I2C: 20 (SDA) and 21 (SCL). Support I2C (TWI) communication using the Wire library (documentation on the
Wiring website). Note that these pins are not in the same location as the I2C pins on the Duemilanove.
The Mega2560 has 16 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default
they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and
analogReference() function.
• AREF. Reference voltage for the analog inputs. Used with analogReference().
• Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which
block the one on the board.
The Arduino Mega2560 has a number of facilities for communicating with a computer, another Arduino, or
other microcontrollers. The ATmega2560 provides four hardware UARTs for TTL (5V) serial communication.
An ATmega8U2 on the board channels one of these over USB and provides a virtual com port to software on
the computer (Windows machines will need a .inf file, but OSX and Linux machines will recognize the board
as a COM port automatically. The Arduino software includes a serial monitor which allows simple textual
data to be sent to and from the board. The RX and TX LEDs on the board will flash when data is being
transmitted via the ATmega8U2 chip and USB connection to the computer (but not for serial communication
on pins 0 and 1).
A SoftwareSerial library allows for serial communication on any of the Mega's digital pins.
The ATmega2560 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire
library to simplify use of the I2C bus; see the documentation on the Wiring website for details. To use the SPI
communication, please see the ATmega2560 datasheet.
The Arduino Mega2560 can be programmed with the Arduino software (download). For details, see the
reference and tutorials.
The Atmega2560 on the Arduino Mega comes preburned with a bootloader that allows you to upload new
code to it without the use of an external hardware programmer. It communicates using the original STK500
protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit Serial
Programming) header; see these instructions for details.
Rather then requiring a physical press of the reset button before an upload, the Arduino Mega2560 is
designed in a way that allows it to be reset by software running on a connected computer. One of the
hardware flow control lines (DTR) of the ATmega8U2 is connected to the reset line of the ATmega2560 via a
100 nanofarad capacitor. When this line is asserted (taken low), the reset line drops long enough to reset the
chip. The Arduino software uses this capability to allow you to upload code by simply pressing the upload
button in the Arduino environment. This means that the bootloader can have a shorter timeout, as the
lowering of DTR can be well-coordinated with the start of the upload.
This setup has other implications. When the Mega2560 is connected to either a computer running Mac OS X
or Linux, it resets each time a connection is made to it from software (via USB). For the following half-second
or so, the bootloader is running on the Mega2560. While it is programmed to ignore malformed data (i.e.
anything besides an upload of new code), it will intercept the first few bytes of data sent to the board after a
connection is opened. If a sketch running on the board receives one-time configuration or other data when it
first starts, make sure that the software with which it communicates waits a second after opening the
connection and before sending this data.
The Mega contains a trace that can be cut to disable the auto-reset. The pads on either side of the trace can
be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able to disable the auto-reset
by connecting a 110 ohm resistor from 5V to the reset line; see this forum thread for details.
The Arduino Mega has a resettable polyfuse that protects your computer's USB ports from shorts and
overcurrent. Although most computers provide their own internal protection, the fuse provides an extra layer
of protection. If more than 500 mA is applied to the USB port, the fuse will automatically break the connection
until the short or overload is removed.
The maximum length and width of the Mega PCB are 4 and 2.1 inches respectively, with the USB connector
and power jack extending beyond the former dimension. Three screw holes allow the board to be attached to
a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple
of the 100 mil spacing of the other pins.
The Mega is designed to be compatible with most shields designed for the Diecimila or Duemilanove. Digital
pins 0 to 13 (and the adjacent AREF and GND pins), analog inputs 0 to 5, the power header, and ICSP
header are all in equivalent locations. Further the main UART (serial port) is located on the same pins (0 and
1), as are external interrupts 0 and 1 (pins 2 and 3 respectively). SPI is available through the ICSP header on
both the Mega and Duemilanove / Diecimila. Please note that I2C is not located on the same pins on the
Mega (20 and 21) as the Duemilanove / Diecimila (analog inputs 4 and 5).
Arduino can sense the environment by receiving input from a variety of sensors and can affect its
surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is
programmed using the Arduino programming language (based on Wiring) and the Arduino
development environment (based on Processing). Arduino projects can be stand-alone or they can
communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP).
Arduino is a cross-platoform program. You’ll have to follow different instructions for your personal
OS. Check on the Arduino site for the latest instructions. http://arduino.cc/en/Guide/HomePage
Once you have downloaded/unzipped the arduino IDE, you can Plug the Arduino to your PC via USB cable.
File>Sketchbook>
Arduino-0017>Examples>
Digital>Blink
1.1 The producer warrants that its products will conform to the Specifications. This warranty lasts for one (1) years from the date of the sale. The
producer shall not be liable for any defects that are caused by neglect, misuse or mistreatment by the Customer, including improper installation or testing,
or for any products that have been altered or modified in any way by a Customer. Moreover, The producer shall not be liable for any defects that result from
Customer's design, specifications or instructions for such products. Testing and other quality control techniques are used to the extent the producer deems
necessary.
1.2 If any products fail to conform to the warranty set forth above, the producer's sole liability shall be to replace such products. The producer's liability
shall be limited to products that are determined by the producer not to conform to such warranty. If the producer elects to replace such products, the
producer shall have a reasonable time to replacements. Replaced products shall be warranted for a new full warranty period.
1.3 EXCEPT AS SET FORTH ABOVE, PRODUCTS ARE PROVIDED "AS IS" AND "WITH ALL FAULTS." THE PRODUCER DISCLAIMS ALL OTHER
WARRANTIES, EXPRESS OR IMPLIED, REGARDING PRODUCTS, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
1.4 Customer agrees that prior to using any systems that include the producer products, Customer will test such systems and the functionality of the
products as used in such systems. The producer may provide technical, applications or design advice, quality characterization, reliability data or other
services. Customer acknowledges and agrees that providing these services shall not expand or otherwise alter the producer's warranties, as set forth
above, and no additional obligations or liabilities shall arise from the producer providing such services.
1.5 The Arduino products are not authorized for use in safety-critical applications where a failure of the product would reasonably be expected to cause
severe personal injury or death. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the
operation of nuclear facilities and weapons systems. Arduino products are neither designed nor intended for use in military or aerospace applications or
environments and for automotive applications or environment. Customer acknowledges and agrees that any such use of Arduino products which is solely
at the Customer's risk, and that Customer is solely responsible for compliance with all legal and regulatory requirements in connection with such use.
1.6 Customer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its
products and any use of Arduino products in Customer's applications, notwithstanding any applications-related information or support that may be
provided by the producer.
2. Indemnification
The Customer acknowledges and agrees to defend, indemnify and hold harmless the producer from and against any and all third-party losses, damages,
liabilities and expenses it incurs to the extent directly caused by: (i) an actual breach by a Customer of the representation and warranties made under this
terms and conditions or (ii) the gross negligence or willful misconduct by the Customer.
In no event the producer shall be liable to the Customer or any third parties for any special, collateral, indirect, punitive, incidental, consequential or
exemplary damages in connection with or arising out of the products provided hereunder, regardless of whether the producer has been advised of the
possibility of such damages. This section will survive the termination of the warranty period.
4. Changes to specifications
The producer may make changes to specifications and product descriptions at any time, without notice. The Customer must not rely on the absence or
characteristics of any features or instructions marked "reserved" or "undefined." The producer reserves these for future definition and shall have no
responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The product information on the Web Site or Materials is
subject to change without notice. Do not finalize a design with this information.
CD1206-S01575
+5V
RN5A 10K
8
D3
RN1B 10K
RN1C 10K
X1
+5V
1
RESET
6
POWERSUPPLY_DC21MMX
IC1 +5V
3 3 NCP1117ST50T3G C1
VIN GREEN
3
3 4 ON
1
IN OUT
GND
D1 2 1 8 22p +5V
M7 RN3A 1k ICSP SCL
1
GND
100n 2 L13 7 2 RESET 5 6
LMV358IDGKR
GND GND GND 3x2M GND
4
2
2x2M - NM
GND GND IC3
RESET 30 RESET 71 PA7
(AD7)PA7
JP5
3
1
Y1 72 PA6
(AD6)PA6 PA5
XTAL2 33 XTAL2 (AD5)PA5 73
GND
R1 74 PA4
(AD4)PA4 PA3
1M XTAL1 34 75
8PB7
8PB6
8PB5
8PB4
XTAL1 (AD3)PA3 PA2
(AD2)PA2 76
XTAL1 16MHZ
CSTCE16M0V53-R0 AREF 98 AREF 77 PA1 JP6
(AD1)PA1 PA0
100 AVCC (AD0)PA0 78 SCL 1
+5V 99 SDA 2
AGND +5V
AREF (OC0A/OC1C/PCINT7)PB7 26 PB7 pwm AREF 3
C3 (OC1B/PCINT6)PB6 25 PB6 pwm GND 4
C4 C5 10 VCC (OC1A/PCINT5)PB5 24 PB5 pwm 5 13
100n C6 31 23 PB4 pwm 6 12 ICSP1
VCC (OC2A/PCINT4)PB4
100n 100n 61 VCC (MISO/PCINT3)PB3 22 PB3 (MISO) 7 11 MISO2 1 2
100n 80 21 PB2 (MOSI) 8 10 SCK2 3 4 MOSI2
VCC (MOSI/PCINT2)PB2
CD1206-S01575
GND 11 GND (SCK/PCINT1)PB1 20 PB1 (SCK) PH6 pwm 9 9 RESET2 5 6
7 RN5B
32 19 PB0 PH5 pwm 10 1 2
2
GND (SS/PCINT0)PB0 8
GND
D2
62 GND 3x2M
18x2F-H8.5 81 60 PC7 10x1F-H8.5 RESET-EN
GND (A15)PC7 GND IC4
10K
36 35 59 PC6 GND
53 PB0 (SS) (A14)PC6
34 33 (SCK) PB1 52 GND (A13)PC5 58 PC5
(PCINT7/OC0A/OC1C)PB7 21
51 PB2 (MOSI) 32 31 (MISO) PB3 50 57 PC4 20
(A12)PC4 (PCINT6)PB6
22p
49 PL0 30 29 PL1 48 56 PC3 C8 RESET2 24 19 DTR RESET
C15
47 PL2 PL3 46 (A11)PC3 PC2 RESET(PC1/DW) (PCINT5)PB5
28 27 55 USB-B_TH 100n 18
100n
C7
45 PL4 PL5 44 (A10)PC2 PC1 (T1/PCINT4)PB4
26 25 (A9)PC1 54 XT2 (PD0/MISO/PCINT3)PB3 17 MISO2
X2 F1
16MHz
Y2
43 PL6 24 23 PL7 42 PL7 42 53 PC0 XVCC USBVCC 2 16 MOSI2
1
PL7 (A8)PC0 8x1F-H8.5 22R RN2A XTAL2(PC0) (PDI/MOSI/PCINT2)PB2
GND
41 PG0 22 21 PG1 40 PL6 41 PL6 1 MF-MSMF050-2 500mA 8 1 R2 15 SCK2
39 PG2 PD7 38 PL5 (SCLK/PCINT1)PB1
50 PD7 TXD3 8 14
USB
20 19 pwm 40 PL5(OC5C) (T0)PD7 2 D- RD- 1M 1 XTAL1 (SS/PCINT0)PB0 14
37 PC0 PC1 36 PL4 RXD3 7 15
2
18 17 pwm 39 49 3 D+ RD+
P$2
P$1
PL4(OC5B) (T1)PD6 22R
35 PC2 16 15 PC3 34 PL3 pwm 38 48 TXD2 6 16 4 5 RN2D
4 XT1
CG0603MLC-05E
33 PC4 PC5 32 PL2 PL3(OC5A) (XCK1)PD5 RXD2 +5V
14 13 37 47 5 17 2 7 32 22
CG0603MLC-05E
USB boot En
C14
PL2(T5) (ICP1)PD4 AVCC (INT4/ICP1/CLK0)PC7
22p
31 PC6 PC7 30 PL1 TXD1 4 18 COMMUNICATION
UGND
12 11 36 PL1(ICP5) (TXD1/INT3)PD3 46 RN2B 22R (OC1A/PCINT8)PC6 23
USHIELD P$2
P$1
1k RN3D
29 PA7 10 9 PA6 28 PL0 35 45 RXD1 3 19 3 6 25 GND
5
27 PA5 PA4 26 8x1F-H8.5 PL0(ICP4) (RXD1/INT2)PD2 SDA (PCINT9/OC1B)PC5
8 7 (SDA/INT1)PD1 44 2 20 RN2C 22R 4 VCC (PCINT10)PC4 26
Z1
Z2
25 PA3 6 5 PA2 24 8 ADC15 82 PK7(ADC15/PCINT23) 43 SCL 1 21 3 GND 5
23 PA1 PA0 22 ADC14 (SCL/INT0)PD0 8x1F-H8.5 (AIN2/PCINT11)PC2
4
4 3 7 83 PK6(ADC14/PCINT22)
2 1 6 ADC13 84 9 PH4 pwm 8 7 13
+5V ADC12 PK5(ADC13/PCINT21) (CLKO/ICP3/INT7)PE7 PH3 pwm (CTS/HWB/AIN6/TO/INT7)PD7
5 85 PK4(ADC12/PCINT20) (T3/INT6)PE6 8 7 6 VUCAP 27 UCAP (RTS/AIN5/INT6)PD6 12
XIO ADCH 4 ADC11 86 7 PE5 pwm PE3 pwm 6 5 6 3 USBVCC 31 11 TXL 3 6 +5V
ADC10 PK3(ADC11/PCINT19) (OC3C/INT5)PE5 PE4 PG5 pwm BLM21 UVCC (XCK/AIN4/PCINT12)PD5
3 87 PK2(ADC10/PCINT18) (OC3B/INT4)PE4 6 pwm 5 4 RD- 30 D- (INT5/AIN3)PD4 10 RXL RN4C 1k
2 ADC9 88 5 PE3 pwm PE5 pwm 4 3 PWML 1k RN3C RD+ 29 9 M8RXD
ADC8 PK1(ADC9/PCINT17) (OC3A/AIN1)PE3 PE4 pwm L1 1u D+ (TXD1/INT3)PD3
1 89 PK0(ADC8/PCINT16) (XCK0/AIN0)PE2 4 3 2 C10 UGND 28 UGND (RXD1/AIN1/INT2)PD2 8 M8TXD
3 PE1 (TX0) PE1 2 1 7
(TXD0)PE1 PE0 PE0 100n (AIN0/INT1)PD1 TX
79 PJ7 (RXD0/PCIN8)PE0 2 (RX0) 1 0 33 PAD (OC0B/INT0)PD0 6 YELLOW
69 8x1F-H8.5 C9
+5V+3V3 PJ6(PCINT15) ADC7
68 PJ5(PCINT14) (ADC7/TDI)PF7 90 8 1 2 ATMEGA16U2-MU
1 67 91 ADC6 7 GND
PJ4(PCINT13) (ADC6/TDO)PF6 ADC5 GROUND
2 66 PJ3(PCINT12) (ADC5/TMS)PF5 92 6 1 8 4 5
3 65 93 ADC4 5 ADCL RN1A 10K 2 7 RX RN4D 1k
PJ2(XCK3/PCINT11) (ADC4/TCK)PF4 ADC3
4
POWER
TXD3
RXD3
64 PJ1(TXD3/PCINT10) (ADC3)PF3 94
ADC2
4 4 5 GND PE0 RN4B 1k M8RXD YELLOW
5 63 PJ0(RXD3/PCINT9) (ADC2)PF2 95 3 RN1D 10K
6 96 ADC1 2
(ADC1)PF1 ADC0 M8TXD
7 27 PH7(T4) (ADC0)PF0 97 1 PE1
8 pwm PH6 18 1 8
VIN pwm PH5 PH6(OC2B) PG5 pwm
17 PH5(OC4C) (OC0B)PG5 1 RN4A 1k
GND 8x1F-H8.5 pwm PH4 16 29
pwm PH3 PH4(OC4B) (TOSC1)PG4
15 PH3(OC4A) (TOSC2)PG3 28
14 PH2(XCK2) 70 PG2
TXD2 (ALE)PG2 PG1
13 PH1(TXD2) (RD)PG1 52
RXD2 12 PH0(RXD2) 51 PG0
(WR)PG0
ATMEGA2560-16AU
5
Reference Designs ARE PROVIDED "AS IS" AND "WITH ALL FAULTS. Arduino DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR IMPLIED,
GND
RESET 4 2
3 1
REGARDING PRODUCTS, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
TS42031-160R-TR-7260
RESET Arduino may make changes to specifications and product descriptions at any time, without notice. The Customer must not
1 5
+3V3 rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Arduino reserves
+5V IN OUT
+5V 3
these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them.
VIN ON/OFF
C13+3V3
CMP The product information on the Web Site or Materials is subject to change without notice. Do not finalize a design with this information.
RN5D 10K RN5C 10K
5 IC7B 2 4
6
GND NC/FB
7 GATE_CMD
+3V3 6 ARDUINO is a registered trademark.
8
LMV358IDGKR
1u
C11
5
100n C12
100n
4
GND GND
+5V
4
GND GND
USBVCC +5V
T1
FDN340P
ANEXO 7. PROGRAMACIÓN DEL ARDUINO MEGA 2560
LVIFA_BASE
/*********************************************************************************
**
** LVFA_Firmware - Provides Basic Arduino Sketch For Interfacing With LabVIEW.
**
** Written By: Sam Kristoff - National Instruments
** Written On: November 2010
** Last Updated: Dec 2011 - Kevin Fort - National Instruments
**
** This File May Be Modified And Re-Distributed Freely. Original File Content
** Written By Sam Kristoff And Available At www.ni.com/arduino.
**
*********************************************************************************/
/*********************************************************************************
**
** Includes.
**
********************************************************************************/
// Standard includes. These should always be included.
#include <Wire.h>
#include <SPI.h>
#include <Servo.h>
#include "LabVIEWInterface.h"
/*********************************************************************************
** setup()
**
** Initialize the Arduino and setup serial communication.
**
** Input: None
** Output: None
*********************************************************************************/
void setup()
{
// Initialize Serial Port With The Default Baud Rate
syncLV();
/*********************************************************************************
** loop()
**
** The main loop. This loop runs continuously on the Arduino. It
** receives and processes serial commands from LabVIEW.
**
** Input: None
** Output: None
*********************************************************************************/
void loop()
{
// Check for commands from LabVIEW and process them.
checkForCommand();
// Place your custom loop code here (this may slow down communication with LabVIEW)
if(acqMode==1)
{
sampleContinously();
}
}
LabVIEWInterface
/*********************************************************************************
**
** LVIFA_Firmware - Provides Functions For Interfacing With The Arduino Mega 2560
**
** Written By: Sam Kristoff - National Instruments
** Written On: November 2010
** Last Updated: Dec 2011 - Kevin Fort - National Instruments
**
** This File May Be Modified And Re-Distributed Freely. Original File Content
** Written By Sam Kristoff And Available At www.ni.com/arduino.
**
*********************************************************************************/
#include <Wire.h>
#include <SPI.h>
#include <LiquidCrystal.h>
/*********************************************************************************
** Optionally Include And Configure Stepper Support
*********************************************************************************/
#ifdef STEPPER_SUPPORT
// Stepper Modifications
#include "AFMotor.h"
#include "AccelStepper.h"
// Adafruit shield
AF_Stepper motor1(200, 1);
AF_Stepper motor2(200, 2);
Serial.write('0');
break;
case 0x29: // LCD Print Custom Char
lcd.write(command[2]);
Serial.write('0');
break;
/*********************************************************************************
** Continuous Aquisition
*********************************************************************************/
case 0x2A: // Continuous Aquisition Mode On
acqMode=1;
contAcqPin=command[2];
contAcqSpeed=(command[3])+(command[4]<<8);
acquisitionPeriod=1/contAcqSpeed;
iterationsFlt =.08/acquisitionPeriod;
iterations=(int)iterationsFlt;
if(iterations<1)
{
iterations=1;
}
delayTime= acquisitionPeriod;
if(delayTime<0)
{
delayTime=0;
}
break;
case 0x2B: // Continuous Aquisition Mode Off
acqMode=0;
break;
case 0x2C: // Return Firmware Revision
Serial.write(byte(FIRMWARE_MAJOR));
Serial.write(byte(FIRMWARE_MINOR));
break;
case 0x2D: // Perform Finite Aquisition
Serial.write('0');
finiteAcquisition(command[2],(command[3])+(command[4]<<8),command[5]+(command[6]<<8));
break;
/*********************************************************************************
** Stepper
*********************************************************************************/
#ifdef STEPPER_SUPPORT
case 0x30: // Configure Stepper
if (command[2] == 5){ // Support AFMotor Shield
switch (command[3]){
case 0:
steppers[command[3]] = AccelStepper(forwardstep1, backwardstep1);
break;
case 1:
steppers[command[3]] = AccelStepper(forwardstep2, backwardstep2);
break;
default:
break;
}
}
else if(command[2]==6) { // All other stepper configurations
steppers[command[3]] = AccelStepper(1, command[4],command[5],command[6],command[7]);
}
else{
steppers[command[3]] = AccelStepper(command[2],
command[4],command[5],command[6],command[7]);
}
Serial.write('0');
break;
case 0x31: // Stepper Write
AccelStepper_Write(command);
Serial.write('0');
break;
case 0x32: // Stepper Detach
steppers[command[2]].disableOutputs();
Serial.write('0');
break;
case 0x33: // Stepper steps to go
retVal = 0;
for(int i=0; i<8; i++){
retVal += steppers[i].distanceToGo();
}
Serial.write( (retVal & 0xFF) );
Serial.write( (retVal >> 8) );
break;
#endif
/*********************************************************************************
** Unknown Packet
*********************************************************************************/
default: // Default Case
Serial.flush();
break;
}
}
else{
// Checksum Failed, Flush Serial Buffer
Serial.flush();
}
}
/*********************************************************************************
** Functions
*********************************************************************************/
// Writes Values To Digital Port (DIO 0-13). Pins Must Be Configured As Outputs Before Being Written To
void writeDigitalPort(unsigned char command[])
{
digitalWrite(13, (( command[2] >> 5) & 0x01) );
digitalWrite(12, (( command[2] >> 4) & 0x01) );
digitalWrite(11, (( command[2] >> 3) & 0x01) );
digitalWrite(10, (( command[2] >> 2) & 0x01) );
digitalWrite(9, (( command[2] >> 1) & 0x01) );
digitalWrite(8, (command[2] & 0x01) );
digitalWrite(7, (( command[3] >> 7) & 0x01) );
digitalWrite(6, (( command[3] >> 6) & 0x01) );
digitalWrite(5, (( command[3] >> 5) & 0x01) );
digitalWrite(4, (( command[3] >> 4) & 0x01) );
digitalWrite(3, (( command[3] >> 3) & 0x01) );
digitalWrite(2, (( command[3] >> 2) & 0x01) );
digitalWrite(1, (( command[3] >> 1) & 0x01) );
digitalWrite(0, (command[3] & 0x01) );
}
// Reads all 6 analog input ports, builds 8 byte packet, send via RS232.
void analogReadPort()
{
// Read Each Analog Pin
int pin0 = analogRead(0);
int pin1 = analogRead(1);
int pin2 = analogRead(2);
int pin3 = analogRead(3);
int pin4 = analogRead(4);
int pin5 = analogRead(5);
//Build 8-Byte Packet From 60 Bits of Data Read
char output0 = (pin0 & 0xFF);
char output1 = ( ((pin1 << 2) & 0xFC) | ( (pin0 >> 8) & 0x03) );
char output2 = ( ((pin2 << 4) & 0xF0) | ( (pin1 >> 6) & 0x0F) );
char output3 = ( ((pin3 << 6) & 0xC0) | ( (pin2 >> 4) & 0x3F) );
char output4 = ( (pin3 >> 2) & 0xFF);
char output5 = (pin4 & 0xFF);
char output6 = ( ((pin5 << 2) & 0xFC) | ( (pin4 >> 8) & 0x03) );
char output7 = ( (pin5 >> 6) & 0x0F );
// Write Bytes To Serial Port
Serial.print(output0);
Serial.print(output1);
Serial.print(output2);
Serial.print(output3);
Serial.print(output4);
Serial.print(output5);
Serial.print(output6);
Serial.print(output7);
}
// Configure digital I/O pins to use for seven segment display
void sevenSegment_Config(unsigned char command[])
{
// Configure pins as outputs and store in sevenSegmentPins array for use in sevenSegment_Write
for(int i=2; i<10; i++)
{
pinMode(command[i], OUTPUT);
sevenSegmentPins[(i-1)] = command[i];
}
}
// Write values to sevenSegment display. Must first use sevenSegment_Configure
void sevenSegment_Write(unsigned char command[])
{
for(int i=1; i<9; i++)
{
digitalWrite(sevenSegmentPins[(i-1)], command[i]);
}
}
// Set the SPI Clock Divisor
void spi_setClockDivider(unsigned char divider)
{
switch(divider)
{
case 0:
SPI.setClockDivider(SPI_CLOCK_DIV2);
break;
case 1:
SPI.setClockDivider(SPI_CLOCK_DIV4);
break;
case 2:
SPI.setClockDivider(SPI_CLOCK_DIV8);
break;
case 3:
SPI.setClockDivider(SPI_CLOCK_DIV16);
break;
case 4:
SPI.setClockDivider(SPI_CLOCK_DIV32);
break;
case 5:
SPI.setClockDivider(SPI_CLOCK_DIV64);
break;
case 6:
SPI.setClockDivider(SPI_CLOCK_DIV128);
break;
default:
SPI.setClockDivider(SPI_CLOCK_DIV4);
break;
}
}
void spi_sendReceive(unsigned char command[])
{
if(command[2] == 1) //Check to see if this is the first of a series of SPI packets
{
spiBytesSent = 0;
spiCSPin = command[3];
spiWordSize = command[4];
// Send First Packet's 8 Data Bytes
for(int i=0; i<command[5]; i++)
{
// If this is the start of a new word toggle CS LOW
if( (spiBytesSent == 0) || (spiBytesSent % spiWordSize == 0) )
{
digitalWrite(spiCSPin, LOW);
}
// Send SPI Byte
Serial.print(SPI.transfer(command[i+6]));
spiBytesSent++;
// If word is complete set CS High
if(spiBytesSent % spiWordSize == 0)
{
digitalWrite(spiCSPin, HIGH);
}
}
}
else
{
// SPI Data Packet - Send SPI Bytes
for(int i=0; i<command[3]; i++)
{
// If this is the start of a new word toggle CS LOW
if( (spiBytesSent == 0) || (spiBytesSent % spiWordSize == 0) )
{
digitalWrite(spiCSPin, LOW);
}
// Send SPI Byte
Serial.write(SPI.transfer(command[i+4]));
spiBytesSent++;
// If word is complete set CS High
if(spiBytesSent % spiWordSize == 0)
{
digitalWrite(spiCSPin, HIGH);
}
}
}
}
// Synchronizes with LabVIEW and sends info about the board and firmware (Unimplemented)
void syncLV()
{
Serial.begin(DEFAULTBAUDRATE);
i2cReadTimeouts = 0;
spiBytesSent = 0;
spiBytesToSend = 0;
Serial.flush();
}
// Stepper Functions
#ifdef STEPPER_SUPPORT
void AccelStepper_Write(unsigned char command[]){
int steps = 0;
int step_speed = 0;
int acceleration = 0;
//Number of steps & speed are a 16 bit values, split for data transfer. Reassemble 2 bytes to an int 16
steps = (int)(command[5] << 8) + command[6];
step_speed = (int)(command[2] << 8) + command[3];
acceleration = (int)(command[7] << 8) + command[8];
steppers[command[4]].setMaxSpeed(step_speed);
if (acceleration == 0){
//Workaround AccelStepper bug that requires negative speed for negative step direction
if (steps < 0) step_speed = -step_speed;
steppers[command[4]].setSpeed(step_speed);
steppers[command[4]].move(steps);
}
else {
steppers[command[4]].setAcceleration(acceleration);
steppers[command[4]].move(steps);
}
}
#endif
void sampleContinously()
{
for(int i=0; i<iterations; i++)
{
retVal = analogRead(contAcqPin);
if(contAcqSpeed>1000) //delay Microseconds is only accurate for values less that 16383
{
Serial.write( (retVal >> 2));
delayMicroseconds(delayTime*1000000); //Delay for neccesary amount of time to achieve desired
sample rate
}
else
{
Serial.write( (retVal & 0xFF) );
Serial.write( (retVal >> 8));
delay(delayTime*1000);
}
}
}
void finiteAcquisition(int analogPin, float acquisitionSpeed, int numberOfSamples)
{
//want to exit this loop every 8ms
acquisitionPeriod=1/acquisitionSpeed;
PN2222A
NPN General-Purpose Amplifier
Features
• This device is for use as a medium power amplifier and
switch requiring collector currents up to 500mA.
TO-92
EBC
Ordering Information
Part Number Top Mark Package Packing Method
PN2222ABU PN2222A TO-92 3L Bulk
PN2222ATA PN2222A TO-92 3L Ammo
PN2222ATF PN2222A TO-92 3L Tape and Reel
PN2222ATFR PN2222A TO-92 3L Tape and Reel
Note:
1. These rating are based on a maximum junction temperature of 150 °C.
2. These are steady-state limits. Fairchild Semiconductor should be consulted on applications involving pulsed or
low-duty-cycle operation.
Note:
3. PCB size: FR-4, 76 mm x 114 mm x 1.57 mm (3.0 inch x 4.5 inch x 0.062 inch) with minimum land pattern size.
Note:
4. Pulse test: pulse width ≤ 300 μs, duty cycle ≤ 2.0%.
TO-92 (Bulk)
Figure 1. 3-LEAD, TO92, JEDEC TO-92 COMPLIANT STRAIGHT LEAD CONFIGURATION (OLD TO92AM3)
Package drawings are provided as a service to customers considering Fairchild components. Drawings may change in any manner
without notice. Please note the revision and/or date on the drawing and contact a Fairchild Semiconductor representative to verify or
obtain the most recent revision. Package specifications do not expand the terms of Fairchild’s worldwide terms and conditions, specifically the
warranty therein, which covers Fairchild products.
Always visit Fairchild Semiconductor’s online packaging area for the most recent package drawings:
http://www.fairchildsemi.com/dwg/ZA/ZA03D.pdf.
For current tape and reel specifications, visit Fairchild Semiconductor’s online packaging area:
http://www.fairchildsemi.com/packing_dwg/PKG-ZA03D_BK.pdf.
Figure 2. 3-LEAD, TO-92, MOLDED 0.200 IN LINE SPACING LEAD FORM (J61Z OPTION)
Package drawings are provided as a service to customers considering Fairchild components. Drawings may change in any manner
without notice. Please note the revision and/or date on the drawing and contact a Fairchild Semiconductor representative to verify or
obtain the most recent revision. Package specifications do not expand the terms of Fairchild’s worldwide terms and conditions, specifically the
warranty therein, which covers Fairchild products.
Always visit Fairchild Semiconductor’s online packaging area for the most recent package drawings:
http://www.fairchildsemi.com/dwg/ZA/ZA03F.pdf.
For current tape and reel specifications, visit Fairchild Semiconductor’s online packaging area:
http://www.fairchildsemi.com/packing_dwg/PKG-ZA03F_BK.pdf.
The following includes registered and unregistered trademarks and service marks, owned by Fairchild Semiconductor and/or its global subsidiaries, and is not
intended to be an exhaustive list of all such trademarks.
AccuPower¥ F-PFS¥
®*
AX-CAP®* FRFET® ®
SM ®
BitSiC¥ Global Power Resource PowerTrench ®
TinyBoost
Build it Now¥ GreenBridge¥ PowerXS™ TinyBuck®
CorePLUS¥ Green FPS¥ Programmable Active Droop¥ TinyCalc¥
CorePOWER¥ Green FPS¥ e-Series¥ QFET® TinyLogic®
CROSSVOLT¥ Gmax¥ QS¥ TINYOPTO¥
CTL¥ GTO¥ Quiet Series¥ TinyPower¥
Current Transfer Logic¥ IntelliMAX¥ RapidConfigure¥ TinyPWM¥
DEUXPEED® ISOPLANAR¥ ¥ TinyWire¥
Dual Cool™ Making Small Speakers Sound Louder TranSiC¥
EcoSPARK® and Better™ Saving our world, 1mW/W/kW at a time™ TriFault Detect¥
EfficientMax¥ MegaBuck¥ SignalWise¥ TRUECURRENT®*
ESBC¥ MICROCOUPLER¥ SmartMax¥ PSerDes¥
® MicroFET¥ SMART START¥
MicroPak¥ Solutions for Your Success¥
Fairchild® SPM®
MicroPak2¥ UHC®
Fairchild Semiconductor® STEALTH¥
MillerDrive¥ Ultra FRFET¥
FACT Quiet Series¥
MotionMax¥ SuperFET®
FACT® UniFET¥
mWSaver® SuperSOT¥-3
FAST® VCX¥
OptoHiT¥ SuperSOT¥-6
FastvCore¥ VisualMax¥
OPTOLOGIC® SuperSOT¥-8
VoltagePlus¥
FETBench¥ OPTOPLANAR® SupreMOS®
FPS¥ XS™
SyncFET¥
Sync-Lock™ ❺™
* Trademarks of System General Corporation, used under license by Fairchild Semiconductor.
DISCLAIMER
FAIRCHILD SEMICONDUCTOR RESERVES THE RIGHT TO MAKE CHANGES WITHOUT FURTHER NOTICE TO ANY PRODUCTS HEREIN TO IMPROVE
RELIABILITY, FUNCTION, OR DESIGN. FAIRCHILD DOES NOT ASSUME ANY LIABILITY ARISING OUT OF THE APPLICATION OR USE OF ANY PRODUCT
OR CIRCUIT DESCRIBED HEREIN; NEITHER DOES IT CONVEY ANY LICENSE UNDER ITS PATENT RIGHTS, NOR THE RIGHTS OF OTHERS. THESE
SPECIFICATIONS DO NOT EXPAND THE TERMS OF FAIRCHILD’S WORLDWIDE TERMS AND CONDITIONS, SPECIFICALLY THE WARRANTY THEREIN,
WHICH COVERS THESE PRODUCTS.
ANTI-COUNTERFEITING POLICY
Fairchild Semiconductor Corporation's Anti-Counterfeiting Policy. Fairchild's Anti-Counterfeiting Policy is also stated on our external website, www.fairchildsemi.com,
under Sales Support.
Counterfeiting of semiconductor parts is a growing problem in the industry. All manufacturers of semiconductor products are experiencing counterfeiting of their
parts. Customers who inadvertently purchase counterfeit parts experience many problems such as loss of brand reputation, substandard performance, failed
applications, and increased cost of production and manufacturing delays. Fairchild is taking strong measures to protect ourselves and our customers from the
proliferation of counterfeit parts. Fairchild strongly encourages customers to purchase Fairchild parts either directly from Fairchild or from Authorized Fairchild
Distributors who are listed by country on our web page cited above. Products customers buy either from Fairchild directly or from Authorized Fairchild Distributors
are genuine parts, have full traceability, meet Fairchild's quality standards for handling and storage and provide access to Fairchild's full range of up-to-date technical
and product information. Fairchild and our Authorized Distributors will stand behind all warranties and will appropriately address any warranty issues that may arise.
Fairchild will not provide any warranty coverage or other assistance for parts bought from Unauthorized Sources. Fairchild is committed to combat this global
problem and encourage our customers to do their part in stopping this practice by buying direct or from authorized distributors.
Definition of Terms
Datasheet Identification Product Status Definition
Datasheet contains the design specifications for product development. Specifications may change
Advance Information Formative / In Design
in any manner without notice.
Datasheet contains preliminary data; supplementary data will be published at a later date. Fairchild
Preliminary First Production
Semiconductor reserves the right to make changes at any time without notice to improve design.
Datasheet contains final specifications. Fairchild Semiconductor reserves the right to make
No Identification Needed Full Production
changes at any time without notice to improve the design.
Datasheet contains specifications on a product that is discontinued by Fairchild Semiconductor.
Obsolete Not In Production
The datasheet is for reference information only.
Rev. I68
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Program
Data Memory
Memory 10-bit A/D ECCP/ Timers
Device I/O EUSART MSSP Comparators
Flash SRAM EEPROM (ch) CCP 8/16-bit
(words) (bytes) (bytes)
PIC16F882 2048 128 128 28 11 1/1 1 1 2 2/1
PIC16F883 4096 256 256 24 11 1/1 1 1 2 2/1
PIC16F884 4096 256 256 35 14 1/1 1 1 2 2/1
PIC16F886 8192 368 256 24 11 1/1 1 1 2 2/1
PIC16F887 8192 368 256 35 14 1/1 1 1 2 2/1
RE3/MCLR/VPP 1 28 RB7/ICSPDAT
RA0/AN0/ULPWU/C12IN0- 2 27 RB6/ICSPCLK
RA1/AN1/C12IN1- 3 26 RB5/AN13/T1G
RA2/AN2/VREF-/CVREF/C2IN+ 4 25 RB4/AN11/P1D
PIC16F882/883/886
RA3/AN3/VREF+/C1IN+ 5 24 RB3/AN9/PGM/C12IN2-
RA4/T0CKI/C1OUT 6 23 RB2/AN8/P1B
RA5/AN4/SS/C2OUT 7 22 RB1/AN10/P1C/C12IN3-
VSS 8 21 RB0/AN12/INT
RA7/OSC1/CLKIN 9 20 VDD
RA6/OSC2/CLKOUT 10 19 VSS
RC0/T1OSO/T1CKI 11 18 RC7/RX/DT
RC1/T1OSI/CCP2 12 17 RC6/TX/CK
RC2/P1A/CCP1 13 16 RC5/SDO
RC3/SCK/SCL 14 15 RC4/SDI/SDA
28-pin QFN
RA0/AN0/ULPWU/C12IN0-
RA1/AN1/C12IN1-
RE3/MCLR/VPP
RB5/AN13/T1G
RB4/AN11/P1D
RB6/ICSPCLK
RB7/ICSPDAT
28
27
26
25
24
23
22
RA2/AN2/VREF-/CVREF/C2IN+ 1 21 RB3/AN9/PGM/C12IN2-
RA3/AN3/VREF+/C1IN+ 2 20 RB2/AN8/P1B
RA4/T0CKI/C1OUT 3 19 RB1/AN10/P1C/C12IN3-
RA5/AN4/SS/C2OUT 4 PIC16F882/883/886 18 RB0/AN12/INT
VSS 5 17 VDD
RA7/OSC1/CLKIN 6 16 VSS
RA6/OSC2/CLKOUT 7 15 RC7/RX/DT
10
11
12
13
14
8
9
RC4/SDI/SDA
RC0/T1OSO/T1CKI
RC6/TX/CK
RC1/T1OSI/CCP2
RC2/P1A/CCP1
RC3/SCK/SCL
RC5/SDO
RE3/MCLR/VPP 1 40 RB7/ICSPDAT
RA0/AN0/ULPWU/C12IN0- 2 39 RB6/ICSPCLK
RA1/AN1/C12IN1- 3 38 RB5/AN13/T1G
RA2/AN2/VREF-/CVREF/C2IN+ 4 37 RB4/AN11
RA3/AN3/VREF+/C1IN+ 5 36 RB3/AN9/PGM/C12IN2-
RA4/T0CKI/C1OUT 6 35 RB2/AN8
RA5/AN4/SS/C2OUT 7 34 RB1/AN10/C12IN3-
RE0/AN5 8 33 RB0/AN12/INT
PIC16F884/887
RE1/AN6 9 32 VDD
RE2/AN7 10 31 VSS
VDD 11 30 RD7/P1D
VSS 12 29 RD6/P1C
RA7/OSC1/CLKIN 13 28 RD5/P1B
RA6/OSC2/CLKOUT 14 27 RD4
RC0/T1OSO/T1CKI 15 26 RC7/RX/DT
RC1/T1OSI/CCP2 16 25 RC6/TX/CK
RC2/P1A/CCP1 17 24 RC5/SDO
RC3/SCK/SCL 18 23 RC4/SDI/SDA
RD0 19 22 RD3
RD1 20 21 RD2
44-pin QFN
RC1/T1OSCI/CCP2
RC0/T1OSO/T1CKI
RC2/P1A/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC6/TX/CK
RC5/SDO
RD3
RD2
RD1
RD0
44
43
42
41
40
39
37
36
35
34
38
RC7/RX/DT 1 33 RA6/OSC2/CLKOUT
RD4 2 32 RA7/OSC1/CLKIN
RD5/P1B 3 31 VSS
RD6/P1C 4 30 VSS
RD7/P1D 5 29 NC
VSS 6 PIC16F884/887 28 VDD
VDD 7 27 RE2/AN7
VDD 8 26 RE1/AN6
RB0/AN12/INT 9 25 RE0/AN5
RB1/AN10/C12IN3- 10 24 RA5/AN4/SS/C2OUT
RB2/AN8 11 23 RA4/T0CKI/C1OUT
12
13
14
15
16
17
18
19
20
21
22
RB7/ICSPDAT
RB3/AN9/PGM/C12IN2-
RA1/AN1/C12IN1-
RB4/AN11
RA0/AN0/ULPWU/C12IN0-
RA3/AN3//VREF+/C1IN+
RA2/AN2/VREF-/CVREF/C2IN+
RB5/AN13/T1G
NC
RB6/ICSPCLK
RE3/MCLR/VPP
The 28BYJ-48 is a small stepper motor suitable for a large range of applications.
P.O. Box 8231 Cherrywood Tauranga New Zealand Phone: ++64 7 578 7739 Fax: ++64 7 578 7749 E-mail: enquiry@kiatronics.com
Website: www.kiatronics.com Copyright Welten Holdings Ltd - Specifications subject to change without further notice.
ANEXO 11. DATASHEET DEL ULN2003APG
ULN2003,04APG/AFWG
TOSHIBA Bipolar Digital Integrated Circuit Silicon Monolithic
ULN2003APG,ULN2003AFWG
ULN2004APG,ULN2004AFWG
Features ULN2003AFWG
ULN2004AFWG
z Output current (single output): 500 mA max
z High sustaining voltage output: 50 V min
z Output clamp diodes
z Inputs compatible with various types of logic
z Package Type-APG: DIP-16pin
z Package Type-AFWG: SOL-16pin
Weight
Input Base DIP16−P-300-2.54A : 1.11 g (typ.)
Type Designation
Resistor
SOL16−P-150-1.27A: 0.15 g (typ.)
ULN2003APG/AFWG 2.7 kΩ TTL, 5 V CMOS
ULN2004APG/AFWG 10.5 kΩ 6 to 15 V PMOS, CMOS
1 2010-12-03
ULN2003,04APG/AFWG
Schematics (each driver)
ULN2003APG/AFWG ULN2004APG/AFWG
Note: The input and output parasitic diodes cannot be used as clamp diodes.
2 2010-12-03
ULN2003,04APG/AFWG
Recommended Operating Conditions (Ta = −40 to 85°C)
3 2010-12-03
ULN2003,04APG/AFWG
Electrical Characteristics (Ta = 25°C unless otherwise noted)
Test
Characteristic Symbol Circuit Test Condition Min Typ. Max Unit
VCE = 50 V, Ta = 25°C ⎯ ⎯ 50
Output leakage current ICEX 1 μA
VCE = 50 V, Ta = 85°C ⎯ ⎯ 100
IOUT = 350 mA, IIN = 500 μA ⎯ 1.3 1.6
Collector−emitter saturation voltage VCE (sat) 2 IOUT = 200 mA, IIN = 350 μA ⎯ 1.1 1.3 V
4 2010-12-03
ULN2003,04APG/AFWG
Test Circuit
1. ICEX 2. VCE (sat), hFE 3. IIN (ON)
7. VF
5 2010-12-03
ULN2003,04APG/AFWG
8. tON, tOFF
Input Condition
ULN2003A 0 3V
ULN2004A 0 8V
6 2010-12-03
ULN2003,04APG/AFWG
7 2010-12-03
ULN2003,04APG/AFWG
PD – Ta
2.00
(1) Type-APG free air
1.75 (2) Type-AFWG on PCB
(Test Board: JEDEC 2s2p)
(W)
1.50 (1)
Power dissipation PD
(2)
1.25
1.00
0.75
0.50
0.25
0
0 25 50 75 100 125 150
8 2010-12-03
ULN2003,04APG/AFWG
Package Dimensions
9 2010-12-03
ANEXO 12. DATASHEET DEL ARDUINO UNO
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a
USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to
support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC
adapter or battery to get started. The Uno differs from all preceding boards in that it does not use the FTDI
USB-to-serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0. The Uno and version
1.0 will be the reference versions of Arduno, moving forward. The Uno is the latest in a series of USB
Arduino boards, and the reference model for the Arduino platform; for a comparison with previous versions,
see the index of Arduino boards.
EAGLE files: arduino-duemilanove-uno-design.zip Schematic: arduino-uno-schematic.pdf
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
32 KB of which 0.5 KB used by
Flash Memory
bootloader
SRAM 2 KB
EEPROM 1 KB
Clock Speed 16 MHz
The Arduino Uno can be powered via the USB connection or with an external power supply. The power
source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter
can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a
battery can be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V
pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage
regulator may overheat and damage the board. The recommended range is 7 to 12 volts.
• VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to
5 volts from the USB connection or other regulated power source). You can supply voltage through
this pin, or, if supplying voltage via the power jack, access it through this pin.
• 5V. The regulated power supply used to power the microcontroller and other components on the
board. This can come either from VIN via an on-board regulator, or be supplied by USB or another
regulated 5V supply.
• 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
• GND. Ground pins.
The Atmega328 has 32 KB of flash memory for storing code (of which 0,5 KB is used for the bootloader); It
has also 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(), digitalWrite(), and
digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and
has an internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition, some pins have
specialized functions:
• Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. TThese pins are
connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip .
• External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a
rising or falling edge, or a change in value. See the attachInterrupt() function for details.
• PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
• SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication, which,
although provided by the underlying hardware, is not currently included in the Arduino language.
• LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is
on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By
default they measure from ground to 5 volts, though is it possible to change the upper end of their range
using the AREF pin and the analogReference() function. Additionally, some pins have specialized
functionality:
• I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library.
• AREF. Reference voltage for the analog inputs. Used with analogReference().
• Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to
shields which block the one on the board.
See also the mapping between Arduino pins and Atmega328 ports.
The Arduino Uno has a number of facilities for communicating with a computer, another Arduino, or other
microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is available on
digital pins 0 (RX) and 1 (TX). An ATmega8U2 on the board channels this serial communication over USB
and appears as a virtual com port to software on the computer. The '8U2 firmware uses the standard USB
COM drivers, and no external driver is needed. However, on Windows, an *.inf file is required..
The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the
Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-to-
serial chip and USB connection to the computer (but not for serial communication on pins 0 and 1).
A SoftwareSerial library allows for serial communication on any of the Uno's digital pins.
The ATmega328 also support I2C (TWI) and SPI communication. The Arduino software includes a Wire
library to simplify use of the I2C bus; see the documentation for details. To use the SPI communication,
please see the ATmega328 datasheet.
The Arduino Uno can be programmed with the Arduino software (download). Select "Arduino Uno w/
ATmega328" from the Tools > Board menu (according to the microcontroller on your board). For details,
see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you to upload new code
to it without the use of an external hardware programmer. It communicates using the original STK500
protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit Serial
Programming) header; see these instructions for details.
The ATmega8U2 firmware source code is available . The ATmega8U2 is loaded with a DFU bootloader,
which can be activated by connecting the solder jumper on the back of the board (near the map of Italy) and
then resetting the 8U2. You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac
OS X and Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader).
Rather than requiring a physical press of the reset button before an upload, the Arduino Uno is designed in a
way that allows it to be reset by software running on a connected computer. One of the hardware flow control
lines (DTR) of the ATmega8U2 is connected to the reset line of the ATmega328 via a 100 nanofarad
capacitor. When this line is asserted (taken low), the reset line drops long enough to reset the chip. The
Arduino software uses this capability to allow you to upload code by simply pressing the upload button in the
Arduino environment. This means that the bootloader can have a shorter timeout, as the lowering of DTR
can be well-coordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer running Mac OS X or
Linux, it resets each time a connection is made to it from software (via USB). For the following half-second or
so, the bootloader is running on the Uno. While it is programmed to ignore malformed data (i.e. anything
besides an upload of new code), it will intercept the first few bytes of data sent to the board after a
connection is opened. If a sketch running on the board receives one-time configuration or other data when it
first starts, make sure that the software with which it communicates waits a second after opening the
connection and before sending this data.
The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of the trace can
be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able to disable the auto-reset
by connecting a 110 ohm resistor from 5V to the reset line; see this forum thread for details.
The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from shorts and
overcurrent. Although most computers provide their own internal protection, the fuse provides an extra layer
of protection. If more than 500 mA is applied to the USB port, the fuse will automatically break the connection
until the short or overload is removed.
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the USB connector
and power jack extending beyond the former dimension. Three screw holes allow the board to be attached to
a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple
of the 100 mil spacing of the other pins.
Arduino can sense the environment by receiving input from a variety of sensors and can affect its
surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is
programmed using the Arduino programming language (based on Wiring) and the Arduino
development environment (based on Processing). Arduino projects can be stand-alone or they can
communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP).
Arduino is a cross-platoform program. You’ll have to follow different instructions for your personal
OS. Check on the Arduino site for the latest instructions. http://arduino.cc/en/Guide/HomePage
Once you have downloaded/unzipped the arduino IDE, you can Plug the Arduino to your PC via USB cable.
File>Sketchbook>
Arduino-0017>Examples>
Digital>Blink
In Tools>Board select
1.1 The producer warrants that its products will conform to the Specifications. This warranty lasts for one (1) years from the date of the sale. The
producer shall not be liable for any defects that are caused by neglect, misuse or mistreatment by the Customer, including improper installation or testing,
or for any products that have been altered or modified in any way by a Customer. Moreover, The producer shall not be liable for any defects that result from
Customer's design, specifications or instructions for such products. Testing and other quality control techniques are used to the extent the producer deems
necessary.
1.2 If any products fail to conform to the warranty set forth above, the producer's sole liability shall be to replace such products. The producer's liability
shall be limited to products that are determined by the producer not to conform to such warranty. If the producer elects to replace such products, the
producer shall have a reasonable time to replacements. Replaced products shall be warranted for a new full warranty period.
1.3 EXCEPT AS SET FORTH ABOVE, PRODUCTS ARE PROVIDED "AS IS" AND "WITH ALL FAULTS." THE PRODUCER DISCLAIMS ALL OTHER
WARRANTIES, EXPRESS OR IMPLIED, REGARDING PRODUCTS, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
1.4 Customer agrees that prior to using any systems that include the producer products, Customer will test such systems and the functionality of the
products as used in such systems. The producer may provide technical, applications or design advice, quality characterization, reliability data or other
services. Customer acknowledges and agrees that providing these services shall not expand or otherwise alter the producer's warranties, as set forth
above, and no additional obligations or liabilities shall arise from the producer providing such services.
1.5 The Arduino products are not authorized for use in safety-critical applications where a failure of the product would reasonably be expected to cause
severe personal injury or death. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the
operation of nuclear facilities and weapons systems. Arduino products are neither designed nor intended for use in military or aerospace applications or
environments and for automotive applications or environment. Customer acknowledges and agrees that any such use of Arduino products which is solely
at the Customer's risk, and that Customer is solely responsible for compliance with all legal and regulatory requirements in connection with such use.
1.6 Customer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its
products and any use of Arduino products in Customer's applications, notwithstanding any applications-related information or support that may be
provided by the producer.
2. Indemnification
The Customer acknowledges and agrees to defend, indemnify and hold harmless the producer from and against any and all third-party losses, damages,
liabilities and expenses it incurs to the extent directly caused by: (i) an actual breach by a Customer of the representation and warranties made under this
terms and conditions or (ii) the gross negligence or willful misconduct by the Customer.
In no event the producer shall be liable to the Customer or any third parties for any special, collateral, indirect, punitive, incidental, consequential or
exemplary damages in connection with or arising out of the products provided hereunder, regardless of whether the producer has been advised of the
possibility of such damages. This section will survive the termination of the warranty period.
4. Changes to specifications
The producer may make changes to specifications and product descriptions at any time, without notice. The Customer must not rely on the absence or
characteristics of any features or instructions marked "reserved" or "undefined." The producer reserves these for future definition and shall have no
responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The product information on the Web Site or Materials is
subject to change without notice. Do not finalize a design with this information.
2
3 IN OUT
2 2
2
5
7
7
2
1
1
6
1 IN OUT 5
3 ON/OFF
1 4 5
2 GND NC/FB 4 2
3 3 6
4
5
6
7
8
4
2
3
1
1 2
5
2
1
3 4
5 6 1 2
4
3
3 4
3
5 6 10
1 2 9
6
8
21 7
5
(PCINT7/OC0A/OC1C)PB7
(PCINT6)PB6 20 6
24 RESET(PC1/DW) (PCINT5)PB5 19 5
4
(T1/PCINT4)PB4 18 4
(PD0/MISO/PCINT3)PB3 17 1 RESET (SCK)PB5 19 3
2 16 18 2
1
3 15
P$2
P$1
(OC1)PB1
4 5 4 9 XTAL1 (ICP)PB0 14
32 AVCC (INT4/ICP1/CLK0)PC7 22 6
23 21 28 5 2 7
4
(OC1A/PCINT8)PC6 AREF (ADC5)PC5
P$2
P$1
5
3 GND (AIN2/PCINT11)PC2 5 (ADC2)PC2 25 2 3 6
7 VCC (ADC1)PC1 24 1
(CTS/HWB/AIN6/TO/INT7)PD7 13 8 GND (ADC0)PC0) 23
27 UCAP (RTS/AIN5/INT6)PD6 12
31 UVCC (XCK/AIN4/PCINT12)PD5 11 (AIN1)PD7 13
30 D- (INT5/AIN3)PD4 10 (AIN0)PD6 12 8
29 D+ (TXD1/INT3)PD3 9 (T1)PD5 11 7
28 UGND (RXD1/AIN1/INT2)PD2 8 6 3 (T0)PD4 6 6
(AIN0/INT1)PD1 7 (INT1)PD3 5 5
2 1 33 PAD (OC0B/INT0)PD0 6 (INT0)PD2 4 4
(TXD)PD1 3 3
(RXD)PD0 2 2
7 2 1
7 2
8 1
ANEXO 13. DATASHEET DEL PN532 NFC/RFID
PN532/C1
NFC controller
Rev. 1.2 — 31 March 2011 Short form data sheet
1. Introduction
This document describes the NFC controller PN532. This document is a short form
version; for full specification refer to the product data sheet.
2. General description
The PN532 is a highly integrated transmission module for contactless communication at
13.56 MHZ including micro-controller functionality based on an 80C51 core. The
transmission module utilises an outstanding modulation and demodulation concept
completely integrated for different kinds of passive contactless communication methods
and protocols at 13.56 MHZ.
Enabled in reader/ writer mode for ISO reader 14443A / MIFARE® and reader/writer mode
for ISO 14443B, the PN532’s internal transmitter part is able to drive a reader/writer
antenna designed to communicate with ISO14443A /MIFARE® and ISO14443B cards and
transponders without additional active circuitry.
The receiver part provides a robust and efficient implementation of a demodulation and
decoding circuitry for signals from ISO 14443A / MIFARE® and ISO 14443B compatible
cards and transponders. The digital part handles the complete ISO14443A framing and
error detection (Parity & CRC).
The PN532 supports MIFARE“ Classic (e.g. MIFARE® Standard) products. The PN532
supports contactless communication using MIFARE® Higher Baudrates up to 424kBaud in
both directions.
Enabled in the reader/ writer mode for FeliCa™, the PN532 transmission module supports
the FeliCa™ communication scheme. The receiver part provides a robust and efficient
implementation of the demodulation and decoding circuitry for FeliCa™ coded signals.
The digital part handles the FeliCa™ framing and error detection like CRC. The PN532
supports contactless communication using FeliCa™ Higher Baudrates up to 424 kbaud in
both directions.
Philips Semiconductors PN532/C1
NFC controller
Enabled in card mode the PN532 transmission module is able to answer to a reader/writer
command either acoording to FeliCa™ or ISO14443 A / MIFARE® card interface mode.
The PN532 generates the digital load-modulated signals and in addition with an external
circuit the answers can be send back to the reader/writer. A complete card functionality is
only possible in combination with a secure memory IC.
Additionally, the PN532 transmission module offers the possibility to communicate directly
to a second NFCIP-1 device in the NFCIP-1 mode. The NFCIP-1 mode offers different
communication transfer speeds up to 424 kbit/s according to the ECMA 340 NFCIP-1
Standard. The digital part handles the complete NFCIP-1 framing and error detection.
Transfer speeds on the RF interface above 424 kbit/s are supported by the digital part of
the PN532 module. The modulation to transmit and the demodulation to receive data at
transfer speeds has than to be done by an external circuit.
To make information exchange to the host systems several interfaces are implemented:
• SPI interface
• I2C interface
• Serial UART (similar to RS232 with 0 and PVDD voltage levels)
The PN532 embeds a low dropout voltage regulator allowing the device to be connected
directly to a battery as well as a medium power switch to supply and control the power of
the companion secure chip.
3. Features
80C51 micro controller core with 40 kbyte ROM and 1 kbyte RAM
Highly integrated analog circuitry to demodulate and decode responses
Buffered output drivers to connect an antenna with minimum number of external
components
Integrated RF Level detector
Integrated data mode detector
Supports ISO 14443A / MIFARE®
Supports ISO 14443B in reader/writer mode only
Typical operating distance in reader/writer mode for communication to a
ISO14443A/MIFARE®, ISO14443B or FeliCa™ card up to 50 mm depending on the
antenna size and tuning
Typical operating distance in NFCIP-1 mode up to 50 mm depending on the antenna
size and tuning and power supply
Typical operating distance in ISO14443A / MIFARE® card or FeliCa™ card interface
mode of about 100 mm depending on the antenna size and tuning and the external
field strength
Supports MIFARE® Classic encryption in reader/writer mode and MIFARE® higher
transfer speed communication at 212 kbit/s and 424 kbit/s
Supports contactless communication according to the FeliCa™ scheme at 212 kbaud
and 424 kbaud
Integrated RF interface for NFCIP-1 up to 424 kBaud
Possibility to communicate on the RF interface above 424 kbaud using external
analog circuitry
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
4. Applications
Mobile and portable devices
PC world
Consumer application
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
6. Ordering information
Table 2: Ordering information
Type number Package
Name Description Version
PN5320A3HN/C101 [1] HVQFN40 plastic, heatsink very thin quad flat package; no leads; 40terminals; SOT618-1
body 6x 6x 0.85mm
PN5321A3HN/C101 [2] HVQFN40 plastic, heatsink very thin quad flat package; no leads; 40terminals; SOT618-1
body 6x 6x 0.85mm. Type B SW is enable.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
7. Block diagram
DVDD
RSTPDN
PN532
SVDD
VBAT
REGULATOR SVDDswitch
POR
Ports
SIGOUT SIGIN
sam_switch_en
I2C wake-up sam_switch_overload
monitoring
UART
Xramif RAM
HSU
ROMif ROM
P34
80C51
SPI
Timer0/1
MINT
Timer2
FIFO TCB
Manager
Intc CL UART
RAM
TIMER
PVDD
Signal Processing
PCR
Osc27
Generator
TVDD
Recovery
RF Antenna
Demod
Clock
Clock
Detector Driver
AVDD
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
8. Pinning information
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
9. Functional description
• reader / writer mode supporting ISO 14443A / MIFARE® and FeliCa™ scheme
• reader / writer mode supporting ISO 14443B
• card operation mode supporting ISO 14443A / MIFARE® and FeliCa™ scheme
• NFCIP-1 mode
Enabled in reader / writer mode for ISO 14443A / MIFARE®, the CL module transmitter
part is able to drive a reader / writer antenna designed to communicate with ISO 14443A /
MIFARE® cards and transponders without additional active circuitry. The CL module
receiver part provides a robust and efficient implementation of a demodulation and
decoding circuitry for signals from ISO 14443A / MIFARE® compatible cards and
transponders. The CL module handles the complete ISO 14443A framing and error
detection (Parity & CRC).The CL module supports MIFARE® Classic (e.g. MIFARE®
Standard) products. The CL module supports contactless communication using MIFARE®
Higher transfer speeds up to 424 kbit/s in both directions.
Enabled in reader / writer mode for FeliCa™, the CL module supports the FeliCa™
communication scheme. The CL module receiver part provides a robust and efficient
implementation of the demodulation and decoding circuitry for FeliCa™ coded signals.
The CL module digital part handles the FeliCa™ framing and error detection like CRC.
The CL module supports contactless communication using FeliCa™ Higher transfer
speeds up to 424 kbit/s in both directions.
The CL module supports all layers of the ISO/IEC 14443 B reader / writer communication
scheme, given correct implementation of additional components, like oscillator, power
supply, coil etc. and provided that standardised protocols, e.g. like ISO/IEC 14443-4
and/or ISO/IEC 14443 B anticollision are correctly implemented. The use of this Philips IC
according to ISO/IEC 14443 B might infringe third party patent rights. A purchaser of this
Philips IC has to take care for appropriate third party patent licenses.
In card operation mode, the CL module is able to answer to a reader / writer command
either according to the FeliCa™ or ISO 14443A / MIFARE® card interface scheme. The
CL module generates the digital load modulated signals and in addition with an external
circuit the answer can be sent back to the reader / writer. A complete card functionality is
only possible in combination with a secure core IC using the S2C interface.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
The Analog interface handles the modulation and demodulation of the analog signals
according to the card receiving mode, reader / writer mode and NFCIP-1 mode
communication scheme.
The RF level detector detects the presence of an external RF-field delivered by the
antenna to the RX pin.
The data mode detector detects a MIFARE®, FeliCa™ or NFCIP-1 mode in order to
prepare the internal receiver to demodulate signals, which are sent to the PN512.
The communication (S2C) interface provides digital signals to support communication for
transfer speeds above 424 kbit/s and digital signals to communicate to a secure core IC.
The contactless UART handles the protocol requirements for the communication schemes
in co-operation with the host. The comfortable FIFO buffer allows a fast and convenient
data transfer from the host to the contactless UART and vice versa.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
Note: All indicated modulation indexes and modes in this chapter are system parameters.
This means that beside the IC settings a suitable antenna tuning is required to achieve the
optimal performance.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
Battery
ISO 14443A/B or
PN532
Felica Card
HOST
Contactless Card
Reader/Writer
ISO14443A
Reader (PCD) 1. PCD to PICC 100 % ASK,
Miller Coded,
Transfer speed 106 to 424 kbit/s ISO 14443A
Card (PICC)
PN532
2. PICC to PCD, Subcarrier Load modulation,
Manchester Coded or BPSK,
Transfer speed 106 to 424 kbit/s
The contactless UART, in cooperation with the internal micro-controller of PN532 and the
external host handle the complete MIFARE® / ISO14443 A protocol.
The internal CRC coprocessor calculates the CRC value according to the definitions given
in the ISO 14443A part 3.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
FELICA
Reader (PCD) 1. PCD to PICC 8 - 14% ASK,
Manchester Coded, FELICA
Baudrate 212 to 424 Kbaud Card (PICC)
PN532
2. PICC to PCD, >12% ASK loadmodulation,
Manchester Coded,
Baudrate 212 to 424 Kbaud
The internal contactless UART, the internal µC of PN532 and the external host handle the
FeliCa™ protocol.
The Framing and coding of the FeliCa™ should be according the following table:
To enable the FeliCa™ communication a 6 bytes long preamble and 2 bytes Sync bytes
are sent in order to synchronise the internal receiver. The Len byte is an indicator for the
length of the sent data bytes plus the n-data bytes. The CRC calculation is done according
to the FeliCa™ definitions with the MSB first.
To transmit data on the RF interface, the host has to send the Preamble-, Syn-, Len- and
data- bytes to the PN532. Only the internal CRC calculation is made and added internally
of the PN532
The starting value for the CRC Polynomial is 2 null bytes: (0x00), (0x00)
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
• Active Communication Mode means both the initiator and the target are using their
own RF field to transmit data
• Passive Communication Mode means that the target answers to an initiator command
in a load modulation scheme. The initiator is active in terms of generating the RF field.
• Initiator: generates RF field @ 13.56 MHz and starts the NFCIP
• Target: responds to initiator command either in a load modulation scheme for passive
communication mode or using a self generated and self modulated RF field for active
communication mode.
In order to fully support the NFCIP-1 standard the PN532 supports the active and passive
communication mode at the transfer speeds 106 kbit/s, 212 kbit/s and 424 kbit/s as
defined in the NFCIP-1 standard
Battery Battery
PN532 PN532
HOST HOST
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
Note: Transfer speed above 424 kbit/s are not defined in the NFCIP-1. The PN532
supports these transfer speeds only with dedicated external circuitry.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
Note: Transfer speed above 424 kbit/s are not defined in the NFCIP-1. The PN532
supports these transfer speeds only with dedicated external circuitry.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
In order not to disturb current infrastructure based on 13.56 MHZ general rules to start
NFC communication are defined in the following way.
• Per default NFCIP-1 device is in target mode, meaning its RF field is switched off.
• The RF level detector is active
• Only if application requires the NFC device shall switch to initiator mode
• Initiator shall only switch on RF if no external RF field is detected by RF Level detector
during a time of TIDT.
• The initiator performs initialisation according to the selected mode.
Remark: The PN532 does not support a complete card protocol. This has to be handled
by a dedicated card SAM or a micro-controller. The SAM is optional.
Battery
Reader/Writer for
Felica or MIFARE PN532
HOST
and SAM
Generate RF field
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
13. Characteristics
Table 17: Current Consumption
Symbol Parameter Conditions Min Typ Max Unit
Ihpd Hard Power Down Current PVDD=3V, RF level [5] 10 mA
detector off
ISPD Soft Power down Current PVDD=3V, [5] 35 mA
RF level detector on
IAVDD Analog Supply Current VBAT = 5V tbd 6 mA
PVDD=3V, RF level
detector on
IAVDDrcvo Analog Supply Current VBAT = 5V 3 5 mA
ff PVDD=3V, RF level
detector off
IPVDD Pad Supply Current [2] tbd mA
ISVDD Output Supply Current for sam_switch_en [3] 30 mA
SAM set to 1
ITVDD1,4 Transmitter Supply Current Continuous Wave, VBAT [1] [4] 602 100 mA
= 5V
IVBAT Total Supply Current Continuous Wave, VBAT [1] [4] 76,5 tbd mA
= 5V
[1] ITVDD depends on TVDD and the external circuitry connected to Tx1 and Tx2.
[2] IPVDD depends on the overall load at the digital pins.
[3] ISVDD depends on the overall load on SVDD pad.
[4] During operation with a typical circuitry the overall current is below 100 mA.
[5] ISPD and IHPD are the total currents over all supplies.
[6] Typical value using a complementary driver configuration and an antenna matched to 40 Ohm between TX1 and TX2 at 13.56 MHZ.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
Battery
SVDD
PMU Secure
SIGOUT
VBAT
Core
SIGIN
DVDD
P34
4.7uF
Cvmid
100nF C1 and C2 are matching cap (10 to 300pF)
TVDD
4.7uF 100nF Rq are the damping resistor, few ohms
560nH
L0 C1 RQ
TX1
220pF
100nF
PVDD C0 C2
TVSS1 Antenna
TVSS2
RTSPDN C0 C2
220pF
Host - Processor
DVSS AVSS
OSCIN OSCOUT
HVQFN40: plastic thermal enhanced very thin quad flat package; no leads;
40 terminals; body 6 x 6 x 0.85 mm SOT618-1
D B A
terminal 1
index area
A
E A1
c
detail X
e1 C
e 1/2 e b v M C A B y1 C y
11 20 w M C
L
21
10
Eh e2
1/2 e
1
30
terminal 1
index area 40 31
Dh X
0 2.5 5 mm
scale
DIMENSIONS (mm are the original dimensions)
A(1)
UNIT
max.
A1 b c D(1) Dh E(1) Eh e e1 e2 L v w y y1
01-08-08
SOT618-1 --- MO-220 ---
02-10-22
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
16. Abbreviations
Table 18: Abbreviations
Acronym Description
ASK Amplitude Shift keying
PCD Proximity Coupling Device. Definition for a Card Reader/ Writer according to the
ISO 14443 Specification
PICC Proximity Cards. Definition for a contactless Smart Card according to the
ISO14443 specification
PCD -> PICC Communication flow between a PCD and a PICC according to the ISO14443A/
MIFARE®
PICC -> PCD Communication flow between a PICC and a PCD according to the ISO14443A/
MIFARE®
Initiator Generates RF field @ 13.56 MHZ and starts the NFCIP-1 communication.
Modulation Index The modulation index is defined as the voltage ratio (Vmax - Vmin) / (Vmax +
Vmin).
Loadmodulation The load modulation index is defined as the card’s voltage ratio (Vmax - Vmin) /
Index (Vmax + Vmin) measured at the card’s coil.
Target Responds to initiator command either using load modulation scheme (RF field
generated by Initiator) or using modulation of self generated RF field (no RF
field generated by initiator).
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
Level Data sheet status [1] Product status [2] [3] Definition
I Objective data Development This data sheet contains data from the objective specification for product development. Philips
Semiconductors reserves the right to change the specification in any manner without notice.
II Preliminary data Qualification This data sheet contains data from the preliminary specification. Supplementary data will be published
at a later date. Philips Semiconductors reserves the right to change the specification without notice, in
order to improve the design and supply the best possible product.
III Product data Production This data sheet contains data from the product specification. Philips Semiconductors reserves the
right to make changes at any time in order to improve the design, manufacturing and supply. Relevant
changes will be communicated via a Customer Product/Process Change Notification (CPCN).
[1] Please consult the most recently issued data sheet before initiating or completing a design.
[2] The product status of the device(s) described in this data sheet may have changed since this data sheet was published. The latest information is available on the Internet at
URL http://www.semiconductors.philips.com.
[3] For data sheets describing multiple type numbers, the highest-level product status determines the data sheet status.
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
23. Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 General description . . . . . . . . . . . . . . . . . . . . . . 1
3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
5 Quick reference data . . . . . . . . . . . . . . . . . . . . . 3
6 Ordering information . . . . . . . . . . . . . . . . . . . . . 4
7 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 5
8 Pinning information . . . . . . . . . . . . . . . . . . . . . . 6
8.1 Pin description . . . . . . . . . . . . . . . . . . . . . . . . . 6
9 Functional description . . . . . . . . . . . . . . . . . . . 8
9.1 CONTACT LESS MODULE . . . . . . . . . . . . . . . 8
9.1.1 Simplify block diagram . . . . . . . . . . . . . . . . . . . 9
9.1.2 Feature list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
9.1.3 Operating Modes . . . . . . . . . . . . . . . . . . . . . . 10
9.1.4 NFCIP-1 MODE . . . . . . . . . . . . . . . . . . . . . . . 13
9.1.5 Card operation mode . . . . . . . . . . . . . . . . . . . 16
10 Limiting values. . . . . . . . . . . . . . . . . . . . . . . . . 18
11 Recommended operating conditions. . . . . . . 18
12 Thermal characteristics. . . . . . . . . . . . . . . . . . 18
13 Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 19
14 Application information. . . . . . . . . . . . . . . . . . 20
15 Package outline . . . . . . . . . . . . . . . . . . . . . . . . 21
16 Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . 22
17 Revision history . . . . . . . . . . . . . . . . . . . . . . . . 23
18 Data sheet status . . . . . . . . . . . . . . . . . . . . . . . 24
19 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
20 Disclaimers. . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
21 Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
22 Contact information . . . . . . . . . . . . . . . . . . . . 24
9397 750 XXXXX © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
www.veear.eu
www.veear.eu
Product Description
EasyVR is the second generation version of the successful VRbot Module. It is a multi-purpose speech
recognition module designed to easily add versatile, robust and cost effective speech recognition capabilities
to virtually any application.
The EasyVR module can be used with any host with an UART interface powered at 3.3V – 5V, such as PIC
and Arduino boards. Some application examples include home automation, such as voice controlled light
switches, locks or beds, or adding “hearing” to robots such as ROBONOVA-I and POP Bot.
EasyVR features
A host of built-in speaker independent (SI) commands for ready to run basic controls
Supports up to 32 user-defined Speaker Dependent (SD) triggers or commands as well as Voice
Passwords. SD custom commands can be spoken in ANY language.
Easy-to-use and simple Graphical User Interface to program Voice Commands
Languages currently supported for SI commands: English U.S., Italian, Japanese, German, Spanish
and French. More languages could be available in future.
Module can be used with any host with an UART interface (powered at 3.3V - 5V)
Simple and robust documented serial protocol to access and program through the host board
Technical specifications
1 GND - Ground
1 /RST I Reset
Note: the GPIO (J4.3/4/5) are at nominal 3.0VDC level. Do not connect 5VDC to these pins!
Communications
The 433MHz RF link kit is consisted of transmitter and receiver, popularly used for remote control.
Features
• Frequency: 433Mhz
• Modulation: ASK
• Receiver Data Output: High - 1/2 Vcc, Low - 0.7v
• Transmitor Input Voltage: 3-12V (high voltage = more transmitting power)
Usage
The popular link is like this: MCU -> Encoder -> Transmitter ------ Receiver -> Decoder -> MCU
Applications
· Burglar alarm system · Car alarm system
· Smoke and fire alarm system · Security system
· Garage door controllers · Cordless telephones
· Car door controllers · Other remote control systems
General Description
12
The 2 encoders are a series of CMOS LSIs for remote bits via an RF or an infrared transmission medium upon
control system applications. They are capable of encod- receipt of a trigger signal. The capability to select a TE
ing information which consists of N address bits and trigger on the HT12E or a DATA trigger on the HT12A
12-N data bits. Each address/data input can be set to further enhances the application flexibility of the 212 se-
one of the two logic states. The programmed ad- ries of encoders. The HT12A additionally provides a
dresses/data are transmitted together with the header 38kHz carrier for infrared systems.
Selection Table
Function Address Address/ Carrier Negative
Data No. Oscillator Trigger Package
Part No. No. Data No. Output Polarity
455kHz
HT12A 8 0 4 D8~D11 38kHz No 18DIP, 20SOP
resonator
RC
HT12E 8 4 0 TE No No 18DIP, 20SOP
oscillator
Note: Address/Data represents pins that can be either address or data according to the application requirement.
Block Diagram
TE Trigger
HT12E
O S C 2 O S C 1
O s c illa to r ¸ 3 D iv id e r D a ta S e le c t D O U T
T E
& B u ffe r
¸ 1 2 C o u n te r & S y n c .
A 0
1 o f 1 2 D e c o d e r C ir c u it
1 2 T r a n s m is s io n
G a te C ir c u it
A 7 B in a r y D e te c to r
A D 8 A D 1 1 V D D V S S
DATA Trigger
HT12A
X 2 X 1
O s c illa to r ¸ 5 7 6 D iv id e r D a ta S e le c t D O U T
& B u ffe r
L /M B
¸ 1 2 C o u n te r & S y n c .
A 0
1 o f 1 2 D e c o d e r C ir c u it
1 2 T r a n s m is s io n
G a te C ir c u it
A 7
B in a r y D e te c to r
D 8 D 1 1 V D D V S S
Note: The address data pins are available in various combinations (refer to the address/data table).
Pin Assignment
8 -A d d re s s 8 -A d d re s s 8 -A d d re s s 8 -A d d re s s
4 -D a ta 4 -D a ta 4 -A d d r e s s /D a ta 4 -A d d r e s s /D a ta
N C 1 2 0 N C N C 1 2 0 N C
A 0 1 1 8 V D D A 0 2 1 9 V D D A 0 1 1 8 V D D A 0 2 1 9 V D D
A 1 2 1 7 D O U T A 1 3 1 8 D O U T A 1 2 1 7 D O U T A 1 3 1 8 D O U T
A 2 3 1 6 X 1 A 2 4 1 7 X 1 A 2 3 1 6 O S C 1 A 2 4 1 7 O S C 1
A 3 4 1 5 X 2 A 3 5 1 6 X 2 A 3 4 1 5 O S C 2 A 3 5 1 6 O S C 2
A 4 5 1 4 L /M A 4 6 1 5 L /M A 4 5 1 4 T E A 4 6 1 5 T E
A 5 6 1 3 D 1 1 A 5 7 1 4 D 1 1 A 5 6 1 3 A D 1 1 A 5 7 1 4 A D 1 1
A 6 7 1 2 D 1 0 A 6 8 1 3 D 1 0 A 6 7 1 2 A D 1 0 A 6 8 1 3 A D 1 0
A 7 8 1 1 D 9 A 7 9 1 2 D 9 A 7 8 1 1 A D 9 A 7 9 1 2 A D 9
V S S 9 1 0 D 8 V S S 1 0 1 1 D 8 V S S 9 1 0 A D 8 V S S 1 0 1 1 A D 8
H T 1 2 A H T 1 2 A H T 1 2 E H T 1 2 E
1 8 D IP -A 2 0 S O P -A 1 8 D IP -A 2 0 S O P -A
Pin Description
Internal
Pin Name I/O Description
Connection
CMOS IN Pull-high Input pins for address A0~A7 setting
A0~A7 I
(HT12A) These pins can be externally set to VSS or left open
NMOS TRANSMISSION
GATE PROTECTION
DIODE (HT12E)
NMOS TRANSMISSION
Input pins for address/data AD8~AD11 setting
AD8~AD11 I GATE PROTECTION
These pins can be externally set to VSS or left open
DIODE (HT12E)
Input pins for data D8~D11 setting and transmission enable, active
D8~D11 I CMOS IN Pull-high low
These pins should be externally set to VSS or left open (see Note)
DOUT O CMOS OUT Encoder data serial transmission output
Latch/Momentary transmission format selection pin:
L/M I CMOS IN Pull-high Latch: Floating or VDD
Momentary: VSS
TE I CMOS IN Pull-high Transmission enable, active low (see Note)
OSC1 I OSCILLATOR 1 Oscillator input pin
OSC2 O OSCILLATOR 1 Oscillator output pin
X1 I OSCILLATOR 2 455kHz resonator oscillator input
X2 O OSCILLATOR 2 455kHz resonator oscillator output
VSS I ¾ Negative power supply, ground
Note: D8~D11 are all data input and transmission enable pins of the HT12A.
TE is a transmission enable pin of the HT12E.
N M O S C M O S IN
T R A N S M IS S IO N C M O S O U T O S C IL L A T O R 1
P u ll- h ig h
G A T E
E N O S C 2
O S C 1
O S C IL L A T O R 2 N M O S T R A N S M IS S IO N G A T E
P R O T E C T IO N D IO D E
X 1 X 2
V D D
Note: These are stress ratings only. Stresses exceeding the range specified under ²Absolute Maximum Ratings² may
cause substantial damage to the device. Functional operation of this device at other conditions beyond those
listed in the specification is not implied and prolonged exposure to extreme conditions may affect device reliabil-
ity.
Electrical Characteristics
HT12A Ta=25°C
Test Conditions
Symbol Parameter Min. Typ. Max. Unit
VDD Conditions
VDD Operating Voltage ¾ ¾ 2.4 3 5 V
3V ¾ 0.1 1 mA
ISTB Standby Current Oscillator stops
5V ¾ 0.1 1 mA
3V No load ¾ 200 400 mA
IDD Operating Current
fOSC=455kHz
5V ¾ 400 800 mA
VOH=0.9VDD (Source) -1 -1.6 ¾ mA
IDOUT Output Drive Current 5V
VOL=0.1VDD (Sink) 2 3.2 ¾ mA
VIH ²H² Input Voltage ¾ ¾ 0.8VDD ¾ VDD V
VIL ²L² Input Voltage ¾ ¾ 0 ¾ 0.2VDD V
D8~D11 Pull-high
RDATA 5V VDATA=0V ¾ 150 300 kW
Resistance
HT12E Ta=25°C
Test Conditions
Symbol Parameter Min. Typ. Max. Unit
VDD Conditions
VDD Operating Voltage ¾ ¾ 2.4 5 12 V
3V ¾ 0.1 1 mA
ISTB Standby Current Oscillator stops
12V ¾ 2 4 mA
3V ¾ 40 80 mA
IDD Operating Current No load, fOSC=3kHz
12V ¾ 150 300 mA
VOH=0.9VDD (Source) -1 -1.6 ¾ mA
IDOUT Output Drive Current 5V
VOL=0.1VDD (Sink) 1 1.6 ¾ mA
VIH ²H² Input Voltage ¾ ¾ 0.8VDD ¾ VDD V
VIL ²L² Input Voltage ¾ ¾ 0 ¾ 0.2VDD V
fOSC Oscillator Frequency 5V ROSC=1.1MW ¾ 3 ¾ kHz
RTE TE Pull-high Resistance 5V VTE=0V ¾ 1.5 3 MW
Functional Description
Operation
The 212 series of encoders begin a 4-word transmission cycle upon receipt of a transmission enable (TE for the HT12E
or D8~D11 for the HT12A, active low). This cycle will repeat itself as long as the transmission enable (TE or D8~D11) is
held low. Once the transmission enable returns high the encoder output completes its final cycle and then stops as
shown below.
T E
< 1 w o rd
E n c o d e r
D O U T
4 w o rd s T r a n s m itte d 4 w o rd s
C o n tin u o u s ly
D 8 ~ D 1 1
K e y - in
< 1 w o rd
E n c o d e r
D O U T w ith 3 8 k H z c a r r ie r
1 w o rd T r a n s m itte d 1 w o rd
C o n tin u o u s ly
D 8 ~ D 1 1
K e y - in ( a ll d a ta = 1 )
< 1 w o rd 7 w o rd s
E n c o d e r
D O U T
7 w o rd s T r a n s m itte d 1 w o rd
C o n tin u o u s ly
1 w o rd ( a ll d a ta = 1 )
Information Word
If L/M=1 the device is in the latch mode (for use with the latch type of data decoders). When the transmission enable is re-
moved during a transmission, the DOUT pin outputs a complete word and then stops. On the other hand, if L/M=0 the de-
vice is in the momentary mode (for use with the momentary type of data decoders). When the transmission enable is
removed during a transmission, the DOUT outputs a complete word and then adds 7 words all with the ²1² data code.
An information word consists of 4 periods as illustrated below.
1 /3 b it s y n c . p e r io d
p ilo t p e r io d ( 1 2 b its ) a d d r e s s c o d e p e r io d d a ta c o d e
p e r io d
Composition of information
Address/Data Waveform
Each programmable address/data pin can be externally set to one of the following two logic states as shown below.
fO S C
"O n e "
"Z e ro "
A d d re s s /
D a ta B it
fO S C
3 8 k H z
"O n e " c a r r ie r
D a ta B it
"Z e ro "
D a ta B it
"O n e "
A d d r e s s B it
"Z e ro "
A d d r e s s B it
The address/data bits of the HT12A are transmitted with a 38kHz carrier for infrared remote controller flexibility.
O S C 1 O S C 2
T r a n s m is s io n
D O U T m e d iu m
V D D A 0 A 1 A 2 A 3 A 4 A 5 A 6 A 7 V S S T E A D 8 A D 9 A D 1 0 A D 1 1
V D D
V S S
Address/Data Sequence
The following provides the address/data sequence table for various models of the 212 series of encoders.
Address/Data Bits
Part No.
0 1 2 3 4 5 6 7 8 9 10 11
HT12A A0 A1 A2 A3 A4 A5 A6 A7 D8 D9 D10 D11
HT12E A0 A1 A2 A3 A4 A5 A6 A7 AD8 AD9 AD10 AD11
Transmission Enable
For the HT12E encoders, transmission is enabled by applying a low signal to the TE pin. For the HT12A encoders,
transmission is enabled by applying a low signal to one of the data pins D8~D11.
O S C 2 V D D
O S C 1 A D 1 1
T E A D 1 0
A D 9
V S S
A D 8
1 2 V
H T 1 2 E
1 2 V
O S C 2 V D D
O S C 1 A D 1 1
T E A D 1 0
A D 9
V S S
A D 8
H T 1 2 E
Flowchart
· HT12A · HT12E
P o w e r o n P o w e r o n
S ta n d b y m o d e S ta n d b y m o d e
N o D a ta e n a b le ? N o T r a n s m is s io n
e n a b le d ?
Y e s Y e s
D a ta w ith c a r r ie r 4 d a ta w o rd s
s e r ia l o u tp u t tr a n s m itte d
Y e s N o T r a n s m is s io n
D a ta s till e n a b le d ?
s till e n a b le d
N o Y e s
Y e s 4 d a ta w o rd s
L /M B = G N D ? tr a n s m itte d
c o n tin u o u s ly
N o
S e n d th e S e n d ² 1 ² 7 tim e s fo r
la s t c o d e a ll o f th e d a ta c o d e s
fO S C
(S c a le )
R O S C (W )
7 .0 0
4 7 0 k
5 1 0 k
6 .0 0
5 6 0 k
6 2 0 k
5 .0 0
6 8 0 k
7 5 0 k
4 .0 0 8 2 0 k
9 1 0 k
1 .0 M
(3 k H z )3 .0 0
1 .2 M
1 .5 M
2 .0 0
2 .0 M
1 .0 0
2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 V D D (V D C )
Application Circuits
V D D 1 0 0 W
T r a n s m itte r C ir c u it
V D D
1 A 0 V D D 1 8
8 0 5 0 1 A 0 V D D 1 8
2 1 7 1 0 k W
A 1 D O U T 2 1 7
A 1 D O U T
3 1 6 4 5 5 K
A 2 X 1 1 0 0 p F 3 1 6
A 2 O S C 1
1 0 M W R O S C
4 1 5 4 A 3 O S C 2 1 5
A 3 X 2 1 0 0 p F
5 1 4 5 A 4 T E 1 4
A 4 L /M B
6 1 3 6 A 5 A D 1 1 1 3
A 5 D 1 1
7 1 2 7 A 6 A D 1 0 1 2
A 6 D 1 0
8 1 1 8 A 7 A D 9 1 1
A 7 D 9
9 1 0 9 1 0
V S S D 8 V S S A D 8
H T 1 2 A H T 1 2 E
Applications
· Burglar alarm system · Car alarm system
· Smoke and fire alarm system · Security system
· Garage door controllers · Cordless telephones
· Car door controllers · Other remote control systems
General Description
The 212 decoders are a series of CMOS LSIs for remote ously with their local addresses. If no error or un-
control system applications. They are paired with matched codes are found, the input data codes are
Holtek¢s 212 series of encoders (refer to the encoder/de- decoded and then transferred to the output pins. The VT
coder cross reference table). For proper operation, a pin also goes high to indicate a valid transmission.
pair of encoder/decoder with the same number of ad- The 212 series of decoders are capable of decoding
dresses and data format should be chosen. informations that consist of N bits of address and 12-N
The decoders receive serial addresses and data from a bits of data. Of this series, the HT12D is arranged to pro-
programmed 212 series of encoders that are transmitted vide 8 address bits and 4 data bits, and HT12F is used to
by a carrier using an RF or an IR transmission medium. decode 12 bits of address information.
They compare the serial input data three times continu-
Selection Table
Function Address Data
VT Oscillator Trigger Package
Part No. No. No. Type
HT12D 8 4 L Ö RC oscillator DIN active ²Hi² 18DIP, 20SOP
HT12F 12 0 ¾ Ö RC oscillator DIN active ²Hi² 18DIP, 20SOP
Block Diagram
O S C 2 O S C 1
O s c illa to r D iv id e r
D a ta S h ift D a ta
L a tc h C ir c u it
R e g is te r
D IN B u ffe r D a ta D e te c to r
S y n c . D e te c to r C o m p a ra to r C o m p a ra to r C o n tr o l L o g ic
T r a n s m is s io n G a te C ir c u it B u ffe r V T
A d d re s s V D D V S S
Note: The address/data pins are available in various combinations (see the address/data table).
Pin Assignment
8 -A d d re s s 8 -A d d re s s 1 2 -A d d re s s 1 2 -A d d re s s
4 -D a ta 4 -D a ta 0 -D a ta 0 -D a ta
N C 1 2 0 N C N C 1 2 0 N C
A 0 1 1 8 V D D A 0 2 1 9 V D D A 0 1 1 8 V D D A 0 2 1 9 V D D
A 1 2 1 7 V T A 1 3 1 8 V T A 1 2 1 7 V T A 1 3 1 8 V T
A 2 3 1 6 O S C 1 A 2 4 1 7 O S C 1 A 2 3 1 6 O S C 1 A 2 4 1 7 O S C 1
A 3 4 1 5 O S C 2 A 3 5 1 6 O S C 2 A 3 4 1 5 O S C 2 A 3 5 1 6 O S C 2
A 4 5 1 4 D IN A 4 6 1 5 D IN A 4 5 1 4 D IN A 4 6 1 5 D IN
A 5 6 1 3 D 1 1 A 5 7 1 4 D 1 1 A 5 6 1 3 A 1 1 A 5 7 1 4 A 1 1
A 6 7 1 2 D 1 0 A 6 8 1 3 D 1 0 A 6 7 1 2 A 1 0 A 6 8 1 3 A 1 0
A 7 8 1 1 D 9 A 7 9 1 2 D 9 A 7 8 1 1 A 9 A 7 9 1 2 A 9
V S S 9 1 0 D 8 V S S 1 0 1 1 D 8 V S S 9 1 0 A 8 V S S 1 0 1 1 A 8
H T 1 2 D H T 1 2 D H T 1 2 F H T 1 2 F
1 8 D IP -A 2 0 S O P -A 1 8 D IP -A 2 0 S O P -A
Pin Description
Internal
Pin Name I/O Description
Connection
Input pins for address A0~A11 setting
A0~A11 (HT12F)
NMOS These pins can be externally set to VSS or left open.
I
Transmission Gate Input pins for address A0~A7 setting
A0~A7 (HT12D)
These pins can be externally set to VSS or left open.
D8~D11 (HT12D) O CMOS OUT Output data pins, power-on state is low.
DIN I CMOS IN Serial data input pin
VT O CMOS OUT Valid transmission, active high
OSC1 I Oscillator Oscillator input pin
OSC2 O Oscillator Oscillator output pin
VSS ¾ ¾ Negative power supply, ground
N M O S
T r a n s m is s io n G a te C M O S O U T C M O S IN O s c illa to r
E N
O S C 2
O S C 1
Note: These are stress ratings only. Stresses exceeding the range specified under ²Absolute Maximum Ratings² may
cause substantial damage to the device. Functional operation of this device at other conditions beyond those
listed in the specification is not implied and prolonged exposure to extreme conditions may affect device reliabil-
ity.
Test Conditions
Symbol Parameter Min. Typ. Max. Unit
VDD Conditions
VDD Operating Voltage ¾ ¾ 2.4 5 12 V
5V ¾ 0.1 1 mA
ISTB Standby Current Oscillator stops
12V ¾ 2 4 mA
IDD Operating Current 5V No load, fOSC=150kHz ¾ 200 400 mA
Data Output Source Current (D8~D11) 5V VOH=4.5V -1 -1.6 ¾ mA
IO
Data Output Sink Current (D8~D11) 5V VOL=0.5V 1 1.6 ¾ mA
Functional Description
Operation Flowchart
The 212 series of decoders provides various combina- The oscillator is disabled in the standby state and acti-
tions of addresses and data pins in different packages vated when a logic ²high² signal applies to the DIN pin.
so as to pair with the 212 series of encoders. That is to say, the DIN should be kept low if there is no
The decoders receive data that are transmitted by an signal input.
encoder and interpret the first N bits of code period as
P o w e r o n
addresses and the last 12-N bits as data, where N is the
address code number. A signal on the DIN pin activates
the oscillator which in turn decodes the incoming ad- S ta n d b y m o d e
dress and data. The decoders will then check the re-
ceived address three times continuously. If the received
N o D is a b le V T &
address codes all match the contents of the decoder¢s C o d e in ? ig n o r e th e r e s t o f
th is w o r d
local address, the 12-N bits of data are decoded to acti-
vate the output pins and the VT pin is set high to indicate Y e s
a valid transmission. This will last unless the address
code is incorrect or no signal is received. A d d r e s s b its N o
m a tc h e d ?
The output of the VT pin is high only when the transmis-
sion is valid. Otherwise it is always low. Y e s
Output Type S to re d a ta
12
Of the 2 series of decoders, the HT12F has no data
output pin but its VT pin can be used as a momentary M a tc h N o
p r e v io u s s to r e d
data output. The HT12D, on the other hand, provides 4 d a ta ?
latch type data pins whose data remain unchanged until
Y e s
new data are received.
HT12F 0 12 ¾ 2.4V~12V L a tc h d a ta
to o u tp u t &
a c tiv a te V T
N o A d d re s s o r
d a ta e rro r ?
Y e s
Decoder Timing
E n c o d e r
T r a n s m is s io n
E n a b le
< 1 w o rd
E n c o d e r
D O U T
4 w o rd s T r a n s m itte d 4 w o rd s
1 4
C o n tin u o u s ly 1 4
2 c lo c k s 2 c lo c k s
D e c o d e r V T
c h e c k c h e c k
L a tc h e d
D a ta O u t
Address/Data Sequence
The following table provides address/data sequence for various models of the 212 series of decoders.
Address/Data Bits
Part No.
0 1 2 3 4 5 6 7 8 9 10 11
HT12D A0 A1 A2 A3 A4 A5 A6 A7 D8 D9 D10 D11
HT12F A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11
fo s c
(S c a le )
R o s c (9 )
4 .0 0
2 7 k 9
3 .5 0
3 0 k 9
3 3 k 9
3 .0 0
3 6 k 9
3 9 k 9
4 3 k 9
2 .5 0
4 7 k 9
5 1 k 9
2 .0 0 5 6 k 9
6 2 k 9
6 8 k 9
7 5 k 9
1 .5 0 8 2 k 9
1 0 0 k 9
1 2 0 k 9
(1 0 0 k H z )1 .0 0
1 5 0 k 9
1 8 0 k 9
2 2 0 k 9
0 .5 0
0 .2 5
2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 V D D (V D C )
Note: The recommended oscillator frequency is fOSCD (decoder) @ 50 fOSCE (HT12E encoder)
1
@ fOSCE (HT12A encoder).
3
Application Circuits
R e c e iv e r C ir c u it R e c e iv e r C ir c u it
V D D
1 1 8 V D D 1 1 8
A 0 V D D A 0 V D D
2 1 7 2 1 7
A 1 V T A 1 V T
3 1 6 3 1 6
A 2 O S C 1 A 2 O S C 1
4 1 5 R O S C 4 1 5 R O S C
A 3 O S C 2 A 3 O S C 2
5 1 4 5 1 4
A 4 D IN A 4 D IN
6 1 3 6 1 3
A 5 D 1 1 A 5 A 1 1
7 1 2 7 1 2
A 6 D 1 0 A 6 A 1 0
8 1 1 8 1 1
A 7 D 9 A 7 A 9
9 1 0 9 1 0
V S S D 8 V S S A 8
H T 1 2 D H T 1 2 F
http://www.world-semi.com
WS2812
Intelligent control LED
integrated light source
Mechanical Dimensions
PIN configuration
PIN function
NO. Symbol Function description
1 DOUT Control data signal output
2 DIN Control data signal input
3 VCC Power supply control circuit
4 NC
5 VDD Power supply LED
6 VSS Ground
http://www.world-semi.com
WS2812
Intelligent control LED
integrated light source
CL=300pF,OUTR/OU
Fall time tTHZ —— —— 120 µs
TG/OUTB
Data transmission
FMAX Duty ratio50% 400 —— —— Kbps
rate
Input capcity CI —— —— —— 15 pF
http://www.world-semi.com
WS2812
Intelligent control LED
integrated light source
Sequence chart:
T0L
0 code
T0 H
T1L
1 co de
T1H
Treset
RET co de
Cascade method:
D1 D2 D3 D4
DIN DO DIN DO DIN DO
http://www.world-semi.com
WS2812
Intelligent control LED
integrated light source
reset code
>=50us reset
code
seco n d seco n d
th ird 2 4 b it th ird 2 4 b it
D2 2 4 b it 2 4 b it
th ird 2 4 b it th ird 2 4 b it
D3
D4
Note: The data of D1 is send by MCU,and D2, D3, D4 through pixel internal reshaping amplification to
transmit.
Composition of 24bit data:
G7 G6 G5 G4 G3 G2 G1 G0 R7 R6 R5 R4 R3 R2 R1 R0 B7 B6 B5 B4 B3 B2 B1 B0
Note: Follow the order of GRB to sent data and the high bit sent at first.
Typical application circuit:
http://www.world-semi.com