Sie sind auf Seite 1von 127

Diseo e implementacin de modelo a escala de una SmartHome con una red local

domstica (HAN) para monitorear tres variables ambientales y transmitir las


mediciones a un usuario remoto empleando protocolo IP

Diego Carlos Andrs Mndez Ducn


Cdigo 20031005074

Director:
PH.D, MSC. Roberto Ferro Escobar

UNIVERSIDAD DISTRITAL FRANCISCO JOS DE CALDAS

FACULTAD INGENIERA

PROYECTO CURRICULAR INGENIERA ELECTRNICA

BOGOT, D.C., 2016

1
TABLA DE CONTENIDO

1. INTRODUCCIN ................................................................................................. 1
2. ANTECEDENTES ................................................................................................ 3
3. JUSTIFICACIN .................................................................................................. 4
3.1. Justificacin tcnica ............................................................................................. 4
3.2. Justificacin acadmica ....................................................................................... 4
3.3. Justificacin social ............................................................................................... 5
4. OBJETIVO GENERAL ......................................................................................... 6
4.1. Objetivos especficos ........................................................................................... 6
5. PLANTEAMIENTO DEL PROBLEMA .................................................................. 7
6. ALCANCE ............................................................................................................ 8
7. LIMITACIONES ................................................................................................... 9
8. MARCO TERICO CONCEPTUAL ................................................................... 10
8.1. Seleccin de los Sensores ................................................................................. 10
8.1.1. Termmetro digital ............................................................................................. 10
8.1.1.1. Secuencia de transmisin .................................................................................. 13
8.1.2. Sensor de luz ..................................................................................................... 14
8.1.2.1. Principios de operacin del sensor de luz .......................................................... 17
8.1.3. Sensor magntico reed witch ............................................................................. 17
8.1.4. Comunicacin local de los sensores .................................................................. 18
8.2. Mdulo de comunicacin inalmbrica entre sensores ........................................ 21
8.2.1. Mdulo inalmbrico WIFI232 ............................................................................. 22
8.2.1.1. Modo de trabajo ................................................................................................. 25
8.2.1.2. Red inalmbrica ................................................................................................. 25
8.2.1.3. Encriptacin de la informacin inalmbrica ........................................................ 26
8.2.1.4. Configuracin del mdulo inalmbrico ............................................................... 27
8.2.1.5. Acceso a la interfaz web del punto de acceso.................................................... 27
8.2.1.6. Descripcin general del mdulo inalmbrico ...................................................... 28
8.3. HEC (Home Energy Controller) .......................................................................... 28
8.3.1. Conexin a la red del HEC ................................................................................. 29
8.3.2. Configuracin del HEC como Punto de Acceso y Estacin ................................ 31
8.3.3. Antena de mdulo inalmbrico ........................................................................... 33
9. DISEO DEL PROTOTIPO ............................................................................... 34
9.1. Diseo del Termmetro digital ........................................................................... 35
9.2. Sensor de luz digital........................................................................................... 36
9.3. Diseo del sensor magntico ............................................................................. 36
9.4. Diseo del HEC (Home Energy Controller) ........................................................ 38
9.5. Red de sensores ................................................................................................ 40
9.6. Interfaz hombre mquina ................................................................................... 40
10. IMPLEMENTACIN DEL DISEO .................................................................... 42
10.1. Diseo y construccin del HEC .......................................................................... 44
11. INTERFAZ HOMBRE MQUINA (IHM) ............................................................. 47
12. ANLISIS DE RESULTADOS ............................................................................ 48
13. COSTOS DEL PROYECTO ............................................................................... 49
13.1. Recursos humanos ............................................................................................ 49
13.2. Costos fijos ........................................................................................................ 49

2
14. CRONOGRAMA DE EJECUCIN DE LOS TRABAJOS.................................... 53
14.1. Tiempo de ejecucin del proyecto ...................................................................... 53
14.2. Estrategia de trabajo .......................................................................................... 53
14.3. Cronograma ....................................................................................................... 54
15. RECOMENDACIONES ...................................................................................... 55
16. COMENTARIOS ................................................................................................ 55
17. CONCLUSIONES .............................................................................................. 55
18. BIBLIOGRAFA .................................................................................................. 56

3
TABLA DE GRFICAS

Grfica 8.1.1-1. Configuracin de pines para el sensor de temperatura DS18B20 ................. 11


Grfica 8.1.1-2 a) Formato de registro de temperatura en el sensor de temperatura
DS18B20. b) Codificacin temperatura y Salida digital ................................................................ 12
Grfica 8.1.1-3 Diagrama de bloques del sensor de temperatura DS18B20. ........................... 13
Grfica 8.1.2-1 Curva tipo de iluminacin natural y artificial en una habitacin. ...................... 14
Grfica 8.1.2-2 Configuracin de pines para el sensor de temperatura TSL 2561. ................. 16
Grfica 8.1.2-3 Diagrama de bloques del sensor de luz TSL 2561. ........................................... 17
Grfica 8.2.1-1 a) Vista del mdulo USR-WIFI232T. b) Mapa de pines del mdulo ................ 22
Grfica 8.2.1-2 Mdulo USR WIFI232T dimensiones fsicas....................................................... 24
Grfica 8.2.1-3 Conector I-PEX para antena del mdulo USR WIFI232T. ................................ 24
Grfica 8.2.1-4 Fotografa de la antena para cada una de las tarjetas de sensores. .............. 25
Grfica 8.2.1.2-1 Diagrama de conexin inalmbrica del mdulo USR-WIFI232T. ................. 26
Grfica 8.2.1.6-1 Mdulo inalmbrico USR WIFI232T utilizado en la tarjeta electrnica. ....... 28
Grfica 8.3.1-1 Configuracin de pines para el mdulo inalmbrico del HEC. ........................ 30
Grfica 8.3.2-1 Configuracin del mdulo como punto de acceso y estacin. ......................... 32
Grfica 8.3.2-2 Configuracin del mdulo HEC como punto de acceso y estacin. ................ 32
Grfica 8.3.2-3 Dimensiones del mdulo inalmbrico del HEC................................................... 33
Grfica 9.1-1a) Esquemtico de simulacin del sensor de temperatura DS18B20 donde R12
es de 4,7k. b) Polarizacin del sensor con fuente externa. ...................................................... 35
Grfica 9.2-1 a) Esquemtico de simulacin del sensor de luz TSL2560. b) Aplicacin del
circuito recomendada por el fabricante. .......................................................................................... 36
Grfica 9.3-1 a) Esquemtico de simulacin del sensor de temperatura DS18B20 donde R12
es de 4,7k. b) Polarizacin del sensor con fuente externa. ...................................................... 37
Grfica 9.4-1 a) Diseo del mdulo WIFI USR WIFI2323B para el HEC. b) Fuente de
alimentacin para el HEC. c) Configuracin del microcontrolador ATMega328. d) Interface
Serial para configuracin y pruebas................................................................................................. 39
Grfica 9.6-1 Arquitectura del sistema de monitoreo (Lpez Antn & Gala Trallero, 2012). .. 41
Grfica 9.6-2Diseo del PCB para la tarjeta electrnica. a) c) Serigrafa o silkscreen de la
capa superior del PCB. d) Pistas o caminos de cobre en la capa superior del PCB. c)
Serigrafa o silkscreen de la capa inferior del PCB. d) Print circuit Board completo. e)
Fotografa del PCB. ............................................................................................................................ 43
Grfica 10.1-1 Diseo del PCB para el HEC con el mdulo WIFI. a) Serigrafa o silkscreen
de la capa superior del PCB. b) Pistas o caminos de cobre en la capa superior del PCB. c)
Pistas o caminos de cobre en la capa inferior del PCB d) Serigrafa o silkscreen de la capa
inferior del PCB. e) Print circuit Board completa. ........................................................................... 45
Grfica 10.1-2 a) Tarjeta del sensor magntico. b) Tarjeta del sensor de temperatura. c)
Tarjeta del sensor de iluminacin. d) Tarjeta del HEC .................................................................. 46

1
ANEXOS

ANEXO 1 Hoja de datos sensor de temperatura ........................................................................... 57


ANEXO 2 Hoja de datos sensor de luz ........................................................................................... 58
ANEXO 3 Hoja de datos modulo WIFI USR-WIFI232T ................................................................ 59
ANEXO 4 Hoja de datos modulo WIFI USR-WIFI232B ................................................................ 60

2
1. INTRODUCCIN

En la actualidad existe una revolucionaria forma de interaccin entre los individuos y su


entorno fsico, es posible monitorear dispositivos por operadores desde una estacin
remota. Esta interaccin entre individuos y dispositivos electrnicos aplicada al hogar se
conoce como domtica, cuyo principal propsito es gestionar recursos e informacin por
medio de un sistema de comunicaciones y dispositivos electrnicos con el propsito de
mejorar el bienestar de quienes los usan.

El trmino domtica es un concepto reciente, que se est utilizando en polticas de


desarrollo tecnolgico ya que los aportes realizados desde el punto de vista de sensores y
monitoreo pueden ser implementados en SmartCities, por medio de la coexistencia de
mltiples procesos ntimamente relacionados. Este tipo de desarrollo urbano, basado en la
sostenibilidad, es capaz de brindar bienestar a los individuos y en aspectos econmicos
como el consumo ms eficiente de energa elctrica, y operativos como una mejor y ms
rpida utilizacin de electrodomsticos.

El trmino de SmartHome se aplica a los modernos ambientes de vivienda acompaados de


procesos automticos, flexibilidad y comodidad. De acuerdo con (Nagli & Souvent, 2013)
un SmartHome est representada por la automatizacin en los siguiente sistemas:
Iluminacin
Temperatura y control de ventilacin
Automatizacin de aplicaciones para el hogar
Computadores y cargas electrnicas
Administracin de energa en el hogar
Microgeneracin de energa
Seguridad
Operacin de ventanas y puertas
Administracin y visualizacin

La Universidad Distrital es encuentra ahora interesada en incluir dentro de sus grupos de


investigacin un rea relacionada con el desarrollo de la tecnologa perteneciente al hogar y
que sus esfuerzos se vean materializados en forma de trabajos de grado. La propuesta
incluye la puesta a prueba de un saln piloto en la facultad de ingeniera en el cual la
interaccin del profesor con el aula se realice de forma completamente automtica, es decir,
el control de iluminacin, el control de las persianas, la forma de utilizar tanto televisor como
proyector, esta prueba piloto se realiza en busca de presentar la ruta a seguir para la
creacin de un campus inteligente acorde a las necesidades de una facultad de ingeniera
que busca ser punto de desarrollo y muestra del futuro de la sociedad bogotana en aras del
desarrollo tecnolgico.

El valor agregado de este proyecto para la Universidad Distrital, consiste en ejecutar dos
objetivos especficos de este macro proyecto del grupo de investigacin. El primero consiste
en crear un modelo a escala de una casa en la cual este automatizado el sistema de
iluminacin y ventilacin, adems que sea verificado de forma remota el comportamiento de
los electrodomsticos presentes en ella.

1
El segundo es el desarrollo de tesis de grado las cuales estn dentro del proyecto Ciudades
Inteligentes que abarquen el tpico desarrollado en la propuesta del grupo de investigacin.

Teniendo en cuenta lo anterior, se realiza este prototipo de vivienda inteligente


(SmartHome), donde se implementa una infraestructura dotada de soluciones tecnolgicas a
pequea escala. Este modelo de vivienda facilita la interaccin de los individuos con
elementos tecnolgicos de medicin de variables ambientales.

En general, la arquitectura del sistema est compuesta por una estacin de monitoreo y
coordinacin (HEC), tres estaciones locales de sensores inalmbricos y una estacin
remota. Los sensores se localizan en algn lugar dentro del prototipo formando la topologa
de red en estrella. Cada uno de estos sensores tendr la capacidad de medir una variable
ambiental en tiempo real, direccionarla hasta la estacin base por medio de la red HAN y
transmitirla a una estacin remota por el protocolo TCP/IP.

Este prototipo de SmartHome conecta, sincroniza y monitorea los sistemas de iluminacin,


temperatura y ventilacin con una red local inalmbrica domestica WHAN (por sus siglas en
ingles Wireless Home Area Network) a travs de un Controlador de Energa Domstico
(HEC por las siglas en ingles de Home Energy Controller) el cual es capaz de transmitir los
valores medidos a travs de protocolo TCP/IP a la interfaz de usuario remoto.

A travs del HEC el usuario final puede visualizar en tiempo real:


Estado individual de los dispositivos conectados.
Monitorear las variables ambientales de luz, temperatura y ventilacin.
Transmitir los valores medidos para ser visualizados en la IHM.

Los dispositivos estarn conectados a la red WHAN como se indica en la Grfica 8.3.2-1.

En el captulo 8 se justifica la seleccin de las variables ambientales a medir y se describe el


funcionamiento de los sensores escogidos para el desarrollo de la tarjeta.

En el captulo 9 se presenta el diseo del prototipo, la simulacin de los circuitos


electrnicos para la polarizacin y configuracin de cada sensor, el desarrollo del PCB para
la tarjeta electrnica.

En el captulo 10 se muestra la ejecucin del diseo plasmado en tres tarjetas electrnicas


se sensores y una tarjeta para el HEC con su antena y sistema de suministro de energa.

En el captulo 11 se muestra la interfaz web seleccionada para la visualizacin de las


mediciones a travs del protocolo TCP/IP.

2
2. ANTECEDENTES

El antecedente ms importante y punto de partida para la formulacin de este proyecto fue


una propuesta presentada por el investigador de la Universidad Distrital Ricardo Alirio
Gonzlez a la convocatoria 09-2014 de Colciencias relacionado con SmartCities y domtica.
Este proyecto busca la apropiacin de los temas correspondientes a la domtica realizado
en ciudades inteligentes, del cual la domtica es la integracin de cierto tipo de tecnologas
inalmbricas al hogar, con el fin de automatizar el entorno en el cual se ubica la gente en
una ciudad. Este proyecto busca crear un prototipo funcional de un SmartHome, la
automatizacin de un saln de clases de la facultad de ingeniera de la Universidad Distrital
y la realizacin de un software en la plataforma Android, el cual logre comunicarse con el
hogar inteligente. En esta propuesta se plantea la elaboracin de un prototipo funcional de
vivienda en la cual se apliquen los aspectos bsicos de casa inteligente en iluminacin y
temperatura, como punto de partida para la puesta a prueba del saln piloto en la facultad
de ingeniera.

El montaje del saln piloto permitir emplear la domtica desarrolla y probada en el prototipo
a escala de SmartHome un saln de clase de la facultad de ingeniera.

Otros trabajos consultados en la base de datos de la universidad distrital son:


Aplicacin de redes inalmbricas de WIFI en Sistema de Adquisicin y Monitoreo remoto de
variables ambientales y parmetros de operacin de sistemas fotovoltaicos usando
instrumentacin virtual(Nelson L Forero & Gerardo Gordillo, n.d.) Realizado por el
licenciado de Fsica de la Universidad Distrital Francisco Jos de Caldas y del departamento
de Fsica de Universidad Nacional respectivamente, proponen en una estacin de monitoreo
de variables ambientales proponen un sistema de dispositivos electrnicos Field Point de la
National Instruments que cumplen las funciones a travs de programas denominados
Instrumentos virtuales. Su propuesta obtiene un dato cada segundo para cada una de las
variables a medir. Los datos son transmitidos inalmbricamente a un PC a travs de Punto
de Acceso y dispositivos WI-FI. Esta topologa utiliza la arquitectura Cliente/Servidor.

Otro documento es (Castillo Cristiano & Montoya Crdenas, 2014)en el cual desarrollan un
dispositivo que permite iluminar una casa por medio de un sistema electrnico de bajo costo,
de este prototipo mide una variable la cual es monitorea de forma local. Un proyecto similar
desarrollaron (Cubillos Cabera & Molina Bernal, 2014) y (Trivio Paredes & Algarn
Jimnez, 2014) los cuales implementan sistema de iluminacin. Otro trabajos como
(Fonseca Rodrguez, 2007) y (Vargas Vargas, 2013) hacen la implementacin en sistemas
domticos comerciales como HRK Domotic y EMC Systems.

3
3. JUSTIFICACIN
3.1. Justificacin tcnica

Este proyecto permite implementar el concepto de SmartHome a pequea escala por medio
de un prototipo con una red de tres sensores comunicados de forma local a travs de la
estacin de monitoreo y remota con una IHM.

En el prototipo se describe la aplicacin en una SmartHome de dispositivos inteligentes


(sensores) y la conectividad e interoperabilidad juntos. Los sensores forman una red como
se describe en el numeral 9.5 Red de sensores en topologa estrella formada por los
mdulos inalmbricos que transmiten los valores ambientales de forma digital.

Se ejecuta el diseo electrnico del prototipo con los conocimientos adquiridos en la


universidad, la simulacin de los circuitos electrnicos para cada sensor y el desarrollo del
PCB para la tarjeta electrnica.

3.2. Justificacin acadmica

Como parte de la propuesta presentada por el investigador de la Universidad Distrital


Ricardo Gonzlez relacionado con SmartCities y domtica, se plantea la elaboracin de un
prototipo funcional de vivienda en la cual se apliquen los aspectos bsicos de
automatizacin, iluminacin y temperatura ambiente. Por medio del principio de
escalabilidad establecer este trabajo como punto de partida para la puesta a prueba de un
saln piloto en la facultad de ingeniera que permita la interaccin del docente con el recinto
de clase de forma inteligente con el propsito de mejorar el ambiente de trabajo donde el
estudiante pueda prestar mayor inters al docente y evitar distracciones.

Integrar el conocimiento adquirido por el estudiante en los cursos de: circuitos digitales,
comunicaciones digitales, electrnica III y comunicaciones digitales, en el desarrollo de un
prototipo de implementacin en domtica a pequea escala.

Para la Universidad Distrital se ejecutan dos objetivos especficos del macro proyecto
Ciudades Inteligentes. El primer objetivo consiste en crear un modelo a escala de una casa
en la cual este automatizado el sistema de iluminacin y ventilacin, adems que sea
verificado de forma remota el comportamiento de los electrodomsticos presentes en ella.
El segundo objetivo es el desarrollo de tesis de grado las cuales estn dentro del proyecto
Ciudades Inteligentes que abarquen el tpico desarrollado en la propuesta del grupo de
investigacin.

4
3.3. Justificacin social

El principal beneficio para la sociedad est reflejado en la disminucin de energa elctrica,


aumento de confort en sus hogares, mejora en la seguridad gracias al monitoreo en tiempo
real de cualquier variable que se quiera medir. Desde el punto de vista ms global, el aporte
estara en una menor carga en las redes elctricas de distribucin local as como en la
reduccin en el cobro de energa consumida por el usuario.

Adems se pretende realizar un aporte desde el desarrollo de tecnologas aplicadas a


viviendas y a las personas que habitan en ella, al tema de ciudades inteligentes y domtica.

Finalmente, plantea la integracin de estas tecnologas inalmbricas a la vivienda para


monitoreo de variables ambientales, con el fin de crear un ambiente inteligente para las
personas.

5
4. OBJETIVO GENERAL
Disear e implementar un modelo domtico a escala de una SmartHome, el cual permite
monitorear las variables ambientales de iluminacin, temperatura y ventilacin por medio de
sensores, estas seales son digitalizadas y llevadas a una red inalmbrica local domstica
(WHAN) hasta el controlador de energa (HEC) empleando el protocolo IEEE 802,11 y
finalmente toda la informacin recibida es concatenada y transmitida por protocolo CTP/IP
para visualizar las mediciones en una estacin remota.

4.1. Objetivos especficos


Disear e implementar un prototipo de vivienda la cual cuenta con tres sistemas bsicos
de medicin de iluminacin, temperatura y ventilacin, que son digitalizados para
transmitir.
Disear un sistema de interconexin inalmbrico empleando protocolo IEEE 802,11
entre la estacin de monitoreo y las estaciones remotas de monitoreo de iluminacin,
temperatura y ventilacin en el prototipo.
Implementar en un modelo a escala, el protocolo CTP/IP para transmitir las variables
medidas a una estacin de monitoreo remota.
Probar el sistema de digitalizacin de las seales medidas y la comunicacin de la red
local entre los tres sensores y la estacin de monitoreo.
Probar el sistema de comunicaciones entre la estacin base y un usuario remoto a
travs de protocolo TCP/IP.
Disear e implementar una interfaz hombre mquina (HMI) para visualizar en tiempo
real de las variables medidas.

6
5. PLANTEAMIENTO DEL PROBLEMA

Teniendo en cuanta los objetivos se plantea la siguiente pregunta de investigacin enfocada


hacia el rea de la domtica: Se puede disear e implementar un SmartHome a pequea
escala a partir de una red local domstica inalmbrica para el monitoreo de temperatura, luz
y ventilacin?

Este proyecto se plantea desde la modalidad de trabajo de grado como monografa, donde
el conocimiento adquirido en los cursos de circuitos digitales, comunicaciones digitales,
electrnica III e instrumentacin industrial, permitirn realizar un prototipo de implementacin
domtica.

La implementacin para dar respuesta a la pregunta de investigacin, consiste de un


prototipo para monitorear la iluminacin, temperatura y la ventilacin en un hogar inteligente.

El proyecto se desarrolla en la Universidad Distrital y consiste en ejecutar los trabajos


propuestos en macro proyecto del grupo de investigacin Ciudades Inteligentes. Se
pretende crear un modelo a escala de una casa en la cual este automatizado el sistema de
iluminacin y ventilacin, adems que sea verificado de forma remota el comportamiento de
los electrodomsticos presentes en ella, debido a que hace parte de los temas relacionados
con domtica.

El tema de trabajo de grado est relacionado con una aplicacin en domtica y fue apoyado
por el CIDC de la universidad Distrital y el grupo LIDER1, el cual apoy el proceso desde su
grupo de semilleros de investigacin para llevar a buen trmino el trabajo y generar un valor
agregado a los estudiantes y a la universidad. Este trabajo realiza un aporte a la lnea de
investigacin domtica dentro de la facultad de ingeniera.

1Laboratorio de investigacin y desarrollo en electrnica y redes. Universidad Distrital Francisco Jos


de Caldas http://comunidad.udistrital.edu.co/grupolider/investigacion/areas-de-
investigacion/aplicacion-en-domotica-inmotica-y-telemedicina/

7
6. ALCANCE

Disear la arquitectura para un sistema de monitoreo en red NMS (por sus siglas en ingls
Networked Monitoring System) como se muestra en la Grfica 8.3.2-1.
Implementar y probar los sensores del numeral 8.1 en el entorno del prototipo. Emplear los
sensores de luz y temperatura para recolectar la informacin en tiempo real del ambiente y
digitalizarla.
Implementar y probar una red local tipo WLAN entre los sensores y el HEC empleando el
protocolo IEEE 802,11.
Visualizar de forma remota la informacin recibida por los sensores de manera que se
permita la interaccin del usuario con el sistema de comunicacin local en la SmartHome.

8
7. LIMITACIONES

En el proyecto se monitorea nicamente las variables ambientales de luz y temperatura a


travs de transductores, los cuales hacen la conversin anlogo digital de la seal para
que pueda ser transmitida al HEC. El sistema de ventilacin monitorea nicamente su
estado de encendido o apagado.

Los valores medidos no son almacenados de forma permanente y no se realiza ningn


tipo de anlisis estadstico.

No se considera la interaccin con otros dispositivos que pueda tener una SmartHome.

Es posible conectar otras estaciones que sean compatibles con el protocolo IEEE 802.11
comunicaciones para transmisin de la informacin a la estacin remota es el TCP/IP.

9
8. MARCO TERICO CONCEPTUAL

Este prototipo son los ojos y odos cando no se est en casa, o puede ayudar a hacer ms
confortable la permanencia en ella. Con sensores se medirn las variables ambientales y a
travs del protocolo TCP/IP se realiza la conexin a Internet manteniendo informado en todo
momento los eventos que tengan lugar en la SmartHome.
Informar si el sistema de ventilacin quedo encendido, la puerta est abierta, el nivel de
iluminacin en una zona especfica de la casa o conocer el momento en que la lavadora ha
terminado su ciclo de lavado. Es por esta razn que en esta seccin se justifica la seleccin
de las variables ambientales de cada uno de los sensores que fueron implementados en el
prototipo.

8.1. Seleccin de los Sensores

Las cargas elctricas ms grandes de una casa o de un edificio y a las cuales por lo general
de asigna un nico circuito elctrico son:

Circuito de distribucin destinado a alimentar iluminacin.


Circuito de distribucin destinado a alimentar horno elctrico, lavadora y secadora.

De esta forma se puede con solo apretar un botn, iluminar una habitacin, refrigerar la casa
en verano y calentar en invierno y poder encender la lavadora o la secadora. Para poder
ahorrar el consumo de energa en un hogar, la tendencia consiste en usar:

Lmparas de bajo consumo que proporcionan el mismo nivel de iluminacin.


Encender las luces solamente cuando sea necesario.
Aprovechar al mximo la luz natural. Apagar las luces de una habitacin al salir.
Utilizar el aire acondicionado solo cuando sea necesario.
Si se utiliza calefaccin que requiera energa elctrica, es importante graduar el
termostato a un temperatura baja.

Las principales cargas elctricas que se pueden manipular para reducir el consumo de
energa son:

Iluminacin
Temperatura
Encender y o pagar equipos de alta potencia

Para poder implementar un proceso de ahorro de energa es necesario medir y despus


ejecutar procesos de ahorro. Por esta razn para el diseo de prototipo de SmartHome se
consideraron medir estas tres variables. A continuacin se explica la medicin de cada una.

8.1.1. Termmetro digital

Cada habitacin de una casa tiene un propsito diferente y ubicacin especfica de modo
que la temperatura de confort en cada una de ellas no ser la misma. En el caso de lugares

10
en la casa con diferente ocupacin de personas, o en el caso de viviendas ubicadas en
ambientes con estaciones, se pueden implemente sistemas inteligentes de control de
temperatura.

Durante los meses de verano, se puede medir la temperatura para configurar el sistema de
aire acondicionado o apagar la calefaccin cuando no sea necesario. En invierno, midiendo
la temperatura se puede activar el sistema de calefaccin para aumentar la temperatura.

Cuando los valores de temperatura medidos estn por encima de la temperatura ambiente, y
no est nadie en casa para confirmar el valor medido, podra deberse a un incendio, y con
este sistema generar una seal de alarma.

Para el diseo del prototipo se utiliz un sensor de temperatura DS18B20 fabricado por
Dallas Semiconductor. Este es un sensor digital, ya que entrega la medicin de temperatura
codificada en dos bytes, donde los dos primero bits son utilizados para el signo, y los otros
dos restantes son potencias de 2.

Las caractersticas principales de este sensor son las siguientes:

Es un termmetro digital de alta precisin, entre 9 y 12 bits de temperatura en grados


Celsius (el usuario puede escoger la precisin deseada).
Su temperatura operativa se encuentra entre -50 y 125 grados Celsius. La precisin,
en el rango comprendido entre -10 y 85 grados es de 0.5 grados.
Su precio es econmico (ver costos fijos), e interfaz de funcionamiento es sencilla y
su uso es muy provechoso para proyectos que requieran mediciones precisas y
confiables.
La corriente de activacin del sensor de temperatura es de 1 mA @ 5 V.

Cuenta con tres terminales, dos de alimentacin y el pin de datos.

Grfica 8.1.1-1. Configuracin de pines para el sensor de temperatura DS18B20

El sensor DS18B20 utiliza para transmitir la informacin una comunicacin OneWire, la cual
consiste en un protocolo que permite enviar y recibir datos utilizando una sola va (un solo
cable), a diferencia de la mayora de los protocolos que requieren dos.

11
OneWire est basado en un bus, un microcontrolador y el sensor digital de temperatura,
emplea una sola lnea de datos que puede ser tambin con la que se alimenta
elctricamente.
Para enviar un bit a 1 el microcontrolador lleva a 0 volts la lnea de dato durante 1-15
microsegundos.
Para enviar un bit a 0 el microcontrolador lleva a 0 volts la lnea de dato durante 60
microsegundos.

En la siguiente imagen se puede apreciar la digitalizacin de la seal anloga de


temperatura del sensor y algunos ejemplos a diferentes temperaturas y como se encuentra
el valor de cada byte.

a)

b)

Grfica 8.1.1-2 a) Formato de registro de temperatura en el sensor de temperatura DS18B20. b)


Codificacin temperatura y Salida digital

Este sensor tiene la posibilidad de configurar la resolucin, posee cuatro resoluciones las
cuales seran de 9 bits, 10 bits, 11 bits y 12 bits. Para su configuracin, existe un registro
dentro de la memoria llamada registro de configuracin. Dentro de ste, existe dos bits, los
cuales, colocando diferentes combinaciones de 0 y 1 se configura la resolucin.

El sensor opcin de alimentacin elctrica de dos formas diferentes:

La primera llamada modo parasito, y consiste en colocar una resistencia de pull up


de 4,7k sobre la terminal de comunicacin, y el pin de Vdd y GND a tierra.

12
La segunda forma se obtiene alimentando de manera normal al sensor, esto quiere
decir, colocando Vdd a 3,3 volts y GND a tierra, y utilizar DQ solamente para
comunicacin.

Grfica 8.1.1-3 Diagrama de bloques del sensor de temperatura DS18B20.

Integrado dentro del encapsulado se encuentra el circuito de alimentacin del modo parasito
basado en un condensador que se carga cuando hay seal a nivel alto y un sistema de
deteccin de alimentacin (Power Supply Sense). Est compuesto por una memoria ROM
de 64 bits que almacena el nmero de serie del dispositivo, un puerto OneWire, una
pequea memoria en la que se almacena la configuracin (Memory control logic) y la
temperatura una vez convertida en forma digital, un generador donde se verifica la
redundancia cclica de CRC (CRC generator) para comprobar la coherencia del valor digital
de la temperatura y el sensor de temperatura, la memoria Scratchpad y dos alarmas de nivel
que no son habilitadas para esta aplicacin.

La resolucin por defecto y la que se emple es de 12 bits. En el arranque, el registro de


configuracin contiene el valor correspondiente a esta resolucin no es necesario realizar
ninguna operacin para configurarlo en este modo.
El byte menos significativo de los dos que se utilizan para codificar el valor de la temperatura
siempre almacena informacin y el ms significativo almacena ms o menos informacin
dependiendo de la resolucin.
Una vez la temperatura se ha convertido y el sensor enva el valor lgico de uno, se
considera que el tiempo de conversin ya ha pasado, y se enva la orden de lectura de datos
que sirve para que el dispositivo transmita el contenido de la memoria.

8.1.1.1. Secuencia de transmisin


La secuencia de transmisin para configuracin del sensor DS18B20 es el siguiente:

Paso 1. Inicializacin: Todas las transmisiones en el bus OneWire comienzan con una
secuencia de inicializacin. La secuencia de inicializacin consiste en un impulso de
reposicin transmitida por el maestro, seguido de pulso presencia transmitido por el esclavo.
El pulso de presencia permite al maestro saber que los dispositivos esclavos (como el
DS18B20) y estn listos para funcionar.

Paso 2. Comando ROM. Despus que el maestro ha detectado un pulso de presencia,


puede emitir un comando ROM. Estos comandos operan en los nicos cdigos de 64 bits

13
ROM de cada dispositivo esclavo. Estos comandos tambin permiten al maestro determinar
cuntos y qu tipos de dispositivos estn presentes o si algn dispositivo ha experimentado
una condicin de alarma. Hay cinco comandos ROM, y cada comando es de 8 bits de
longitud. El dispositivo maestro debe emitir una orden apropiada ROM antes de emitir un
comando de la funcin DS18B20.

Paso 3. Comando de funcin. Despus que el maestro ha utilizado un comando ROM con el
que desea comunicarse con el DS18B20, el maestro puede emitir uno de los comandos de
funcin DS18B20. Estos comandos permiten al maestro escribir y leer desde la memoria del
DS18B20, iniciar conversiones de temperatura y determinar el modo de alimentacin.

Esta secuencia se debe seguir cada vez que se accede al sensor. Despus de emitir
cualquiera de estos comandos ROM, el dispositivo que funcione como maestro debe volver
al paso 1 en la secuencia.

8.1.2. Sensor de luz

La iluminacin de una casa o en un edificio es la carga elctrica instaladas ms grande, y es


por tanto, de los primeros elementos a optimizar a la hora de ahorra energa.

En este caso en particular se espera medir el nivel de iluminacin natural existente y


posteriormente compensarla con la dimerizacin de la iluminacin artificial. Con el sensor de
iluminacin se puede medir la cantidad de luz natural presente en algn recinto y con otro
dispositivo se podra emiten una seal para controlar la iluminacin.

Este tipo de sensor se ubica en el interior del lugar dentro de la casa que se quiere
monitorear, midiendo constantemente la luminosidad que entra por la misma en cada
momento.

Grfica 8.1.2-1 Curva tipo de iluminacin natural y artificial en una habitacin.

14
nicamente se debe ubicar el sensor a la distancia correcta de la ventana, para que pueda
medir correctamente la cantidad de luz natural y obtener el nivel de iluminacin adicional
que debe ser suministrado.

Para el diseo del segundo sensor en el prototipo se utiliz un sensor de luz TSL 2561
fabricado por Dallas Semiconductor. Es un sensor digital de luz que puede ser configurado
para detectar rangos de luz de 0,1- 40000 lux.

El sensor tiene una interfaz digital (I2C). La corriente que consume es extremadamente baja,
alrededor de 0,6 mA cuando se encuentra censando, y menos de 15 uA @ 5 V cuando est
en modo de bajo consumo.

El sensor tiene dos diodos, uno para espectro infrarrojo y otro para espectro completo. Eso
significa que se puede medir por separado infrarrojo, espectro completo o luz visible por el
ser humano. Ambos sensores estn integrados en un circuito integrado CMOS capaz de
proporcionar respuesta sobre de 20 bits (resolucin de 16 bits). Para este caso particular el
sensor infrarrojo no es utilizado.

Tiene dos Conversores anlogo - digital integrados que convierten las corrientes de los
fotodiodos en una salida digital que representa el nivel de iluminacin medido. Esta salida
digital es la entrada al microprocesador.

15
Grfica 8.1.2-2 Configuracin de pines para el sensor de temperatura TSL 2561.

La descripcin de los pines del sensor son los siguientes:

Nombre Tipo Descripcin


ADDR SEL I Seleccin en el dispositivo MSbus
GND Referencia a tierra
INT O Nivel
SCL I Terminal de entrada serial de reloj SMBus Seal de reloj para
dato serial MSBus
SDA I/O Datos serial de I/O para MSBus
Vdd Suplencia de tensin
Tabla 1. Descripcin de los pines del mdulo USR-WIFI232T.

16
El sensor de luz TSL 2561 contiene dos sensores, a cada est asociado un conversor
anlogo-digital (ADC) que integra las corrientes de los dos fotodiodos.
La integracin de ambos canales ocurre simultneamente. Al finalizar el ciclo de conversin,
el resultado es transferido a los registros de canal 0 y el canal 1 de los datos,
respectivamente. Despus de la transferencia, el dispositivo comienza automticamente el
siguiente ciclo de integracin.

La comunicacin con el dispositivo se lleva a cabo a travs de un estndar Two Wire SMBus
o I2C bus serial, esto quiere decir que se puede comunicar directamente con el
microcontrolador, no se requiere ningn circuito externo para acondicionamiento de la seal
ahorrando espacio en el PCB. Puesto que la salida del TSL2561 es digital, la salida es
inmune al ruido cuando se compara con una seal analgica.

Grfica 8.1.2-3 Diagrama de bloques del sensor de luz TSL 2561.

8.1.2.1. Principios de operacin del sensor de luz

La interface y el control de sensor se realizan a travs del estndar TwoWire, con un


conjunto de registros que proporciona acceso a las funciones de control dispositivo y a los
datos de salida. La interface serial es compatible con System Management Bus (SMBus) y
I2C modo rpido.

Despus de aplicar la respectiva tensin de polarizacin en Vdd, el dispositivo ser iniciado


para estar en el estado de bajo consumo. Para operar el sensor, se emite el comando de
acceso al registro de control seguido por valor para encender el sensor. En este punto
ambos ADC comienzan la conversin en el valor predeterminado de tiempo de 400 ms, el
resultado de la conversin es enviado a los registros correspondientes.

8.1.3. Sensor magntico reed witch

Un reed switch o interruptor de lengeta es un interruptor elctrico activado por un campo


magntico. Es utilizado como parte de circuitos elctricos o alarmas domiciliarias. En este
ltimo, se pueden encontrar estos sensores en las puertas y ventanas de las alarmas
antirrobo, estando el imn unido a la puerta u otros sectores donde se desplace una de sus
partes. Tiene tamao rectangular, de tamao pequeo, para instalacin exterior con rango
de medicin de 15 mm cuya seal de salida es analgica.

17
Las dimensiones de este sensor son: Largo 34 mm, ancho 13,50 mm y alto 8,00 mm. Tiene
una apertura de trabajo de 20 a 25 mm.

Su principio de comunicacin es simple, y detectan los objetos magnticos (imanes


permanentes) que se utilizan para accionar el proceso de la conmutacin.

El circuito sensor reconoce entonces un cambio especfico de amplitud y genera una seal
que conmuta la salida de estado slido o la posicin "ON" y "OFF".

Parmetro Valor
Distancia de deteccin (Espacio) 15 a 25 mm
Carcasa Plstico ABS blanco
Instalacin Exterior
Dimensiones 34 mm, 13,50 mm, 8,00 mm
Tabla 2. Caractersticas fsicas del reed switch.

Caractersticas:
Juego de sensor magntico (1 Reed Switch + 1 imn + tornillos de fijacin).
Estado del Reed Switch: Normalmente Abierto (NO). Se cierra al estar cerca de un
campo magntico (imn)
Distancia de operacin: 15 25 mm
Caractersticas del cable: 24 AWG, 350mm de largo
Color carcasa: Blanco
Material carcasa: ABS

Consta de dos partes una va cableada al microcontrolador y la otra es libre. Si ambas se


cierran el dispositivo detecta la presencia de campo magntico.

8.1.4. Comunicacin local de los sensores

Los protocolos de comunicaciones y conectividad ms usados en una SmartHome se


presentan en el artculo A proxy-based solution for interoperability of SmartHome protocols
de (Albuquerque & De Aquino Junior, 2014) y se presentan la siguiente tabla. Los protocolos
con mayor aceptacin para comunicaciones locales en SmartHome y el nmero de
implementaciones encontradas por los autores:

PROTOCOLO NMERO DE REFERENCIAS


UPnP 13
DLNA 6
ZigBee 5
DPWS 2
JINI 1
Bluetooth SDP 1
Tabla 3. Protocolos ms utilizados en SmartHome, tomado de (Albuquerque & De Aquino Junior, 2014).

A continuacin se describen cada uno de estos protocolos.

18
Universal Plug and Play (UPnP): Es un conjunto de protocolos de comunicacin que
permite a perifricos en red, como ordenadores personales, impresoras, pasarelas de
Internet, puntos de acceso Wi-Fi y dispositivos mviles, descubrir de manera transparente la
presencia de otros dispositivos en la red y establecer servicios de red de comunicacin,
comparticin de datos y entretenimiento. UPnP est diseado principalmente para redes de
hogar.

Digital Living Network Alliance (DLNA): Su objetivo es definir directrices de


interoperabilidad que permitan compartir medios digitales entre dispositivos de consumo
como ordenadores, impresoras, cmaras, telfonos mviles y otros dispositivos multimedia.
DLNA especifica la forma de utilizar estos estndares con el fin de que los distintos
dispositivos que pueda haber dentro de una misma red se interconecten entre ellos para
compartir sus contenidos.

Las directrices DLNA suponen una capa de restricciones acerca de los tipos de formatos de
fichero multimedia, codificaciones y resoluciones que los dispositivos deben soportar. La
ventaja que ofrece es una fcil configuracin y gran versatilidad. Este sistema puede
funcionar tanto en redes Wi-Fi como Ethernet.

ZigBee: Es el nombre de la especificacin de un conjunto de protocolos de alto nivel de


comunicacin inalmbrica para su utilizacin con radiodifusin digital de bajo consumo,
basada en el estndar IEEE 802.15.4 de redes inalmbricas de rea personal (wireless
personal rea network, WPAN). Su objetivo son las aplicaciones que requieren
comunicaciones seguras con baja tasa de envo de datos y maximizacin de la vida til de
sus bateras.

En principio, el mbito donde se prev que esta tecnologa cobre ms fuerza es en


domtica. La razn de ello son diversas caractersticas que lo diferencian de otras
tecnologas:

Su bajo consumo.
Su topologa de red en malla.
Su fcil integracin (se pueden fabricar nodos con muy poca electrnica).

Devices Profile for Web Services (DPWS): Define un conjunto de restricciones para
permitir la mensajera de servicios Web. Su caracterstica principal es notificar eventos,
intercambio de mensajes y descripcin de servicios. Sus objetivos son similares a los de
Universal Plug and Play (UPnP), pero adems, DPWS est totalmente alineado con la
tecnologa de servicios web, e incluye numerosos puntos de extensin para integracin.

JINI: Su principal objetivo es convertir la red en un sistema flexible y fcil de administrar en


el cual se puedan encontrar rpidamente los recursos disponibles tanto por clientes
humanos como computacionales. Un sistema JINI consiste en un sistema distribuido basado
en la idea de grupos federativo de usuarios y de recursos requeridos por otros usuarios. Los
recursos pueden ser implementados tanto por dispositivos hardware y software.

19
Bluetooth Servicie Discovery Protocol (SDP): Es cualquier dispositivo Bluetooth que
ofrece un servicio o servicios a otros dispositivos Bluetooth. Cada servidor SDP tiene su
propia base de datos; no hay una base de datos central.

En el protocolo SDP los clientes pueden utilizan los servicios proporcionados por los
servidores. Para que hagan esto, servidores y clientes intercambiar informacin sobre los
servicios.

La base de datos SDP es simplemente un conjunto de registros que describen todos los
servicios. El dispositivo Bluetooth proporciona los medios para que otro dispositivo pueda
mirar a estos registros.

Elementos de datos: Los atributos tienen valores, y esos valores pueden tener varios tipos y
tamaos. De modo que un dispositivo que recibe un atributo sabe qu tipo y tamao que
est recibiendo, atributos se envan en elementos de datos.

WIFI (IEEE 802,11): Los protocolos IEEE 802,x definen la tecnologa de redes de rea local
(LAN). En este protocolo est compuesto por:

Estaciones: Computadoras o dispositivos de interfaz de red.


Medio: Se puede definir dos, la radiofrecuencia y los infrarrojos.
Punto de acceso (AP): tiene las funciones de un puente (conecta dos redes con niveles
de enlaces parecidos o distintos), y realiza por tanto las conversiones de trama
pertinente.

Es un protocolo con amplio mercado comercial y compatibilidad con otros dispositivos. Este
sistema proporciona una conexin entre dispositivos electrnicos de forma inalmbrica. Las
redes wifi poseen una serie de ventajas, entre las cuales podemos destacar:

El sistema wifi asegura la compatibilidad absoluta entre dispositivos, con lo que podra
utilizar la tecnologa wifi.
Las WIFI mezclan la comodidad de uso de las conexiones inalmbricas (como
Bluetooth), con un mayor alcance y fcil acceso WIFI en una SmartHome.

Pero como red inalmbrica, la tecnologa wifi presenta los problemas intrnsecos de
cualquier tecnologa inalmbrica. Algunos de ellos son:

Una de las desventajas que tiene el sistema wifi es una menor velocidad en
comparacin a una conexin cableada, debido a las interferencias y prdidas de seal
que el ambiente puede acarrear.
La desventaja fundamental de estas redes reside en el campo de la seguridad. Este
problema se agrava si consideramos que no se puede controlar el rea de cobertura de
una conexin, de manera que un receptor se puede conectar desde fuera de la zona de
recepcin prevista (por ejemplo: desde una vivienda vecina).
La potencia de la conexin del wifi se ver afectada por los agentes fsicos que se
encuentran a nuestro alrededor, tales como paredes. Dichos factores afectan la
potencia de compartimiento de la conexin wifi con otros dispositivos.

20
8.2. Mdulo de comunicacin inalmbrica entre sensores

Despus de estudiar los tipos de comunicacin propuestos en la Tabla 3, se decidi adoptar


el protocolo WIFI por las siguientes razones:

Implementacin rpida y de bajo costo


Capacidad de sincronizacin automtica entre dispositivos cuando stos se encuentran
en su radio de accin comn.
Cobertura: Entre 10 m y 100 m segn potencia.
Velocidad: 11Mbps (802.11b). Con 802.11g hasta 54 Mbps

Para la seleccin del mdulo de comunicacin a usar en el prototipo, se consideraron las


dos opciones comerciales ms conocidas. Los mdulos consultados, incluyen toda la
electrnica necesaria para la comunicacin por radio frecuencia en la banda WFI, as como
TCP/IPy que se programan travs de un puerto serial. A continuacin una tabla comparativa
entre las familias de mdulos:

Nombre Precio Funcin STA/AP Tamao


WIFI ESP8266 $ 14 000 STA/AP 11,5 mm x 11,5 mm
WIFIESP 8266 EPS $ 57 000 STA/AP 18 mm x 20 mm
12e
WIFI USR-WIFI232T $ 20 000 STA/AP 22 mm x 13 mm
WIFI USR-WIFI232B $ 50 000 STA/AP 25 mm x 40 mm
Tabla 4. Tabla comparativa de mdulos WIFI compatibles con los sensores.

Estas dos familias de mdulos incluyen todo lo necesario para conectarse a un punto de
acceso WIFI mediante programacin de puerto serial o interfaz web, que puede ser
configurada a diferentes velocidades. Disponen tambin, de puertos GPIO (General Purpose
Input Output) para su uso como activador, el cual podra ser configurado para futuras
aplicaciones.

Se escogieron los mdulos WIFI232 de la marca USR para la implementacin de prototipo


ya que no se encontr una diferencia sustancia entre ambas familias. Este mdulo utiliza
comunicacin serial de entrada y es capaz de enviar datos en protocolo TCP-IP de salida,
de manera que se lo puede utilizar para convertir la comunicacin serial del microcontrolador
en una interfaz inalmbrica manejada con IP y que usa el protocolo TCP para enviar los
datos sobre estndar IEEE 802.11 b/g/n el cual se usa para la red WLAN.

Este mdulo tiene la capacidad de convertir tramas de datos recibidas a travs de su puerto
serie en tramas TCP, adems de contar con posibilidad de trabajar como un simple
componente con direccin IP o tambin funcionar como enrutador o como un punto de
acceso, trabaja con protocolo IEEE 802.11 b/g/n a una velocidad mxima de 110MBps.

Una vez se conectar el mdulo WIFI con el microcontador, el dispositivo tomalos datos
digitalizados de temperatura, luz o ON-OFF, y preparar el paquete de datos el cual se enva
por lo menos 100 veces por segundo desde cada tarjeta de sensores hasta el HEC, el cual
se encargar de procesar el paquete de datos y transmitirlos.

21
Para que sea inalmbrico, cada uno de los mdulos adems de poder transferir datos
usando una red LAN, tiene su propia fuente de alimentacin. Los mdulos consumen
alrededor de 350 mA, esto quiere decir que se necesita bateras de potencia baja.

8.2.1. Mdulo inalmbrico WIFI232

El mdulo escogido para la implementacin es totalmente auto contenido, de formato muy


pequeo (el tamao de este mdulo es de 22 mm x 13 mm). Utiliza el protocolo IEEE 802,11
b/g/n, el cual provee una interfaz inalmbrica con cualquier dispositivo con transferencia de
datos de interface serial.

En la tarjeta electrnica se implementar el mdulo WIFI232 el cual Integra todas las


funcionalidades del protocolo WIFI en un bajo perfil, que es fcilmente instalado en un
circuito PCB con aplicaciones especficas. El mdulo proporciona su propia antena.

Caractersticas del dispositivo a implementar son:


Soporta estndar inalmbrico IEEE 802,11b/g/n
Soporta protocolo de red TCP/IP/UDP
Soporta interfaz de comunicaciones de datos UART (Universal Asncrono Recepcin y
Transmisin) /GPIO / Ethernet
Modo de trabajo STA/AP/AP+STA
Puede adaptarse antena interna y externa
Soporta WIFI a 2,4 GHz, con modo de seguridad WEP, WPA/WPA2
Consumo de potencia muy bajo para aplicaciones con batera con tensin de
alimentacin TTL (3,3 volts).
Parametrizacin en interfaz web, Android, IOS APP, Smart link APP.
Protocolo de red IPv4, TCP/UDP/HTTP
Vida til 12 meses
Velocidad de transmisin de seales por segundo: 600, 1200, 1800, 2400, 4800, 9600,
19200, 38400, 57600, 115200, 230400, 380400, 460800.
La longitud de datos de recepcin cubre 0-1000 bytes.

Grfica 8.2.1-1 a) Vista del mdulo USR-WIFI232T. b) Mapa de pines del mdulo

PIN Descripcin Nombre Tipo de seal Comentario


1 Tierra GND Potencia
2 +3,3 Volts DVDD Potencia 3,3 Volts a 250 mA
3 Mdulo de nReload I Entrada de reset
recuperacin Puede ser usada para
Pin de Smart Link
4 Mdulo de nReset I Entrada de reset

22
reset
5 UART UART_RX I No conectar si no se usa
6 UART UART_TX O No conectar si no se usa
7 Interruptor de PWR_SW I, PU 0 Alimentacin apagada
potencia 1 Modo normal
8 PWM/WPS PWM_3 I/O Funcin por defecto WPS
Puede usarse con PWM/GPIO18
9 PWM/nReady PWM_2 I/O Funcin por defecto nReady
Puede usarse con PWM/GPIO12
10 PWM/nLink PWM_1 I/O Funcin por defecto nLink
Puede usarse con PWM/GPIO11
Convenciones de la tabla:
I: Entrada
O: Salida
PU: Pull-up
I/O: Entrada/salida
Tabla 5. Descripcin de los pines del mdulo inalmbrico USR-WIFI232T

La descripcin funcional de los pines principales que se configuraron en el mdulo son:

nReset: Es el pin para reset del mdulo; nReset necesita una resistencia de pull-up
cuando se quiere habilitar para operacin. Si el mdulo MCU necesita hacer un reset,
se enva pulllow al menos por 10 ms.
nReload: Es el pin para configuracin del mdulo; despus de encender el mdulo, este
pin se puede dejar en cero por un tiempo menor a 3 segundos para la configuracin
Smart link, se debe esperar a la aplicacin para introducir la; Despus que el mdulo es
enciendo, este pin se puede dejar en cero por un tiempo mayor a 3 segundo para
recuperar la configuracin de fbrica.
Para estos dos pines se usan resistencias de pull up entre 5 k y 10 k.
NLink: Este pin indica el estado del mdulo; Para la configuracin Smart Link, este pin
indica que se han terminado los ajustes. Para operacin normal, este pin indica el
estado.
NReady: Es el pin indicador para xito de inicio.
WPS: Wi-Fi protect setup, sirve para conectar el mdulo al punto de acceso.
UART: Recepcin y transmisin;
GPIO_n: entrada/salida de propsito general; es un pin cuyo propsito se puede
controlar (programar) por el usuario en tiempo de ejecucin.
PWM_N: En el pin de salida PWM del mdulo. Puede configurarse tambin como el pin
GPIO.

La potencia de transmisin de mdulo depende el protocolo que se est utilizando as:

Protocolo Potencia Sensibilidad


Potencia (dBm) Sensibilidad (dBm)
IEEE (mW) (uW)
+ 16 dBm (@ -93 dBm (@
802.11 b 39,81 0,0000005
11Mbps) 11Mbps)
+14 dBm (@ 54 -85dBm (@ 54
802.11g 25,12 0,0000031
Mbps) Mbps)

23
+13 dBm (300
802.11n 19,95 -82dBm (300 Mbps) 0,0000063
Mbps)
Tabla 6. Parmetros el potencia y sensibilidad del mdulo USR-WIFI232T

Las dimensiones del mdulo son:

Grfica 8.2.1-2 Mdulo USR WIFI232T dimensiones fsicas.

Este mdulo cuenta con una conexin para antena externa tipo I-PEX, el mdulo debe
conectarse a una antena de 2,4G de acuerdo con el estndar IEEE.

Grfica 8.2.1-3 Conector I-PEX para antena del mdulo USR WIFI232T.

La antena tiene un rango de frecuencia de operacin ente 2,4~2,5 GHz, impedancia de


50 Ohm, con conector tipo I-PEX y VSWR (Voltage Standing Wave Ratio).

24
Grfica 8.2.1-4 Fotografa de la antena para cada una de las tarjetas de sensores.

8.2.1.1. Modo de trabajo

En mdulo USR-WIFI232-T tiene tres modos de trabajo: modo rendimiento, modo de


comando y modo PWM/GPIO.

Modo rendimiento: En este modo, el mdulo puede transmitir datos entre el dispositivo
serial y la red.

Modo de comando: En este modo, el usuario puede consultar y establecer el puerto serial y
los parmetros de red en el mdulo a travs del comando AT.

Modo PWM/GPIO: En este modo, el usuario puede realizar el control de PWM/GPIO a


travs de comandos de red.

El modo seleccionado para este mdulo es el modo comando. En este modo el mdulo
requiere el puerto serial para recibir el comando AT. El usuario puede enviar comandos AT
al mdulo a travs de puerto serial, para consultar y establecer los parmetros de
configuracin y la red.

8.2.1.2. Red inalmbrica

Este mdulo puede ser configurado como STA (Estacin) y AP (Punto de Acceso) con base
en el tipo de red. A continuacin se realiza la descripcin de cada configuracin.

AP (Punto de Acceso): Este es el punto de acceso a la red inalmbrica, con la cual se


transmitirn los valores medido al usuario remoto. Es la base de la red inalmbrica y el
centro de los nodos de la red de sensores creada para la SmartHome. El router WIFI que se
usa en casa puede ser usado como AP.

25
STA: En la configuracin como estacin empleada para los sensores, cada terminal
conectado a la red inalmbrica (En este caso son cada uno de los dispositivos medidores de
variables ambientales, pero pueden ser tambin computadores porttiles, impresoras,
celulares y otros dispositivos).

Grfica 8.2.1.2-1 Diagrama de conexin inalmbrica del mdulo USR-WIFI232T.

El modo STA es el mtodo de red empelado por los sensores, como se muestra en la
Grfica de arriba, la red consiste en un router como Punto de Acceso y los dems
dispositivos como STA, en esta red el Punto de Acceso est en el centro, la comunicacin
entre los nodos STA es reenviada por el AP al usuario remoto.

En el modo AP, la tarjeta electrnica de cada sensor puede conectarse rpidamente con un
dispositivo serial para transferir datos o configuracin. Tambin, se pueden agregar mdulos
y parametrizarlos desde el entorno web. En USR-WIFI232T en configuracin AP, solo puede
conectar mximo dos dispositivos en modo STA.

8.2.1.3. Encriptacin de la informacin inalmbrica

Aunque en la implementacin del prototipo no se considera necesario utilizar ningn tipo de


encriptacin, los mdulos de comunicacin inalmbricos cuentan con los mtodos
convencionales de encriptacin los cuales se describen a continuacin:

WEP: Wired Equivalent Privacy o "Privacidad Equivalente a Cableado", es el sistema de


cifrado incluido en el estndar IEEE 802.11 como protocolo para redes Wireless que permite
cifrar la informacin que se transmite.

WPA: Wi-Fi Protected Access oAccesoWi-Fi protegido es un sistema para proteger las
redes inalmbricas (Wi-Fi). WPA implementa la mayora del estndar IEEE 802.11.

WPA2: Wi-Fi Protected Access 2 o Acceso Protegido Wi-Fi 2, es un sistema para proteger
las redes inalmbricas (Wi-Fi); creado para corregir las vulnerabilidades detectadas en WPA.
WPA2 est basada en el nuevo estndar 802.11i. WPA, por ser una versin previa, que se
podra considerar de "migracin", no incluye todas las caractersticas del IEEE 802.11i,
mientras que WPA2 se puede inferir que es la versin certificada del estndar 802.11i.

En caso de una aplicacin en una SmartHome o en la implementacin que se quiere realizar


en un aula de clase de la Universidad, es posible configurar la red con alguna de los

26
sistemas de encriptacin, este proceso se realiza igual que con un Router WIFI, ya que los
parmetros de configuracin se pueden realizar desde entorno web.

8.2.1.4. Configuracin del mdulo inalmbrico

El mdulo de comunicaciones USR-WIFI232 de la tarjeta electrnica, tiene los siguientes


parmetros de fbrica, y se puede conectar a un PC para realizar su respectiva
configuracin por medio de una aplicacin web:

Parmetros Valores por defecto


SSID (Service Set Identifier) USR-WIFI232
IP Address 10.10.100.254
Subnetmarsk 255.255.255.0
UserName admin
Password admin
Tabla 7. Valores por defecto para la aplicacin web del mdulo inalmbrico USR-WIFI232

8.2.1.5. Acceso a la interfaz web del punto de acceso

Es posible acceder a la interfaz de configuracin del mdulo de comunicaciones del HEC a


travs de un navegador web, por esta razn, es posible realizar desde cualquier dispositivo
conectado en la red local LAN, y realizar cualquier ajuste en la configuracin.

Para configurar el dispositivo de comunicacin inalmbrica del HEC, se realiza en mismo


procedimiento como se configurara un Router WIFI:

1. Conectar al PC el mdulo USR-WIFI232 a travs de la red LAN.


2. Despus de establecer la conexin ejecutar la aplicacin web (Internet Explorer,
Chrome, mozilla firefox) se ingresa la IP http://10.10.100.254 en la barra de direccin del
navegador.
3. Ahora que se ha accedido con xito va web al panel de configuracin, se muestra una
pantalla de inicio de sesin con el nombre de usuario y contrasea dados en la Tabla
7antes de realizar cualquier cambio en la configuracin.

Una vez dentro de la interfaz, se puede ir por cada men lateral para cambiar la
configuracin del mdulo inalmbrico. El men posee las siguientes opciones de
configuracin:

System: En esta opcin se puede verificar la informacin importante del dispositivo y su


estado, tales como ID del dispositivo, versin del software, modo de trabajo del dispositivo.

STA Setting: Con esta opcin si el dispositivo est configurado en modo estacin, se puede
pulsar la opcin Scan para qu busque automticamente el AP cercano, se debe tener en
cuenta si la red tiene algn tipo de encriptacin. Cada uno de los mdulos medidores de las
variables ambientales estar configurado como estacin.

AP Setting: El HEC estar configurado en el modo de Punto de Acceso. Posee las


siguientes opciones de configuracin

27
Enable / Disable: Activa o desactiva las funciones de punto de acceso inalmbrico del
dispositivo.

SSID: Se utiliza para identificar la red. La mayora de los puntos de acceso tienen
valores predeterminados conocidos. Esta opcin permitir la difusin de SSID para
asociarse. Normalmente, el punto de acceso emite su SSID para que los dispositivos
inalmbricos dentro de su alcance se puedan conectar a la red. Para una red ms
segura, puede desactivar esta funcin.

8.2.1.6. Descripcin general del mdulo inalmbrico

El modulo de la tarjeta electrnica del HEC es el WIFI232, este es un modulo que conecta
cualquier microcontrolador a la red WIFI. Se utiliz el mdulo serial UART WIFI con
protocolo IEEE 802.11 debido a su reducido tamao, proporciona una interfaz inalmbrica
con cualquier dispositivo con puerto serial. En la siguiente fotografa se muestra el mdulo.

Grfica 8.2.1.6-1 Mdulo inalmbrico USR WIFI232T utilizado en la tarjeta electrnica.

ste mdulo permite comunicar el sensor a la red inalmbrica. Este modulo permite la
configuracin con cualquier dispositivo con puerto serial de forma inalmbrica con la red
LAN, en este caso con la red de la SmartHome.

8.3. HEC (Home Energy Controller)

La estacin base HEC es la encargada de transmitir a una interfaz retoma la informacin


recolectada por los sensores, para que los usuarios observen el sistema de monitoreo
ubicado en el entorno domstico. El usuario podra conocer el estado de las variables
medidas en tiempo real a travs de esta interfaz.

El usuario tiene acceso a la aplicacin solamente con una conexin a Internet, siempre y
cuando tenga un navegador web. La interfaz grfica de usuario (HIM) de la aplicacin
permite al usuario remoto llevar a cabo el monitoreo de los sensores, y la visualizacin de

28
los resultados en tiempo real. El usuario remoto puede seleccionar y verificar la medicin de
los sensores de monitorio.

En el HEC se ejecuta una aplicacin para iniciar el proceso de monitoreo, con el propsito
que el usuario remoto tenga acceso.

El sistema de comunicaciones emplear el HEC para transmitir los datos adquiridos, a


travs de sistema inalmbrico. La tecnologa que se emplea en el sistema de
comunicaciones ser WAP (Wireless Aplication Protocol) o protocolo de aplicaciones
inalmbricas para comunicacin de datos adquiridos por los sensores. Se emplea el
estndar IEEE 802.11 (Wireless LAN).

Estndar IEEE 802.11b: Esta funciona en la banda de frecuencia de 2,4 GHz y permite la
transmisin de datos con velocidades de 5 hasta 11 Mbps, con este estndar se puede crear
una red de trabajo inalmbrico (WLAN).

Estndar 802.11g: Sistema compatible con el estndar b. Se emplea en la mayora de


redes inalmbricas. Utiliza banda de 2,4 GHz pero opera a una velocidad de 54 Mbits/s.

Estndar 802.11n: Es una propuesta de modificacin al estndar IEEE 802.11para mejorar


significativamente el rendimiento de la red ms all de los estndares anteriores, tales como
802.11b y 802.11g, con un incremento significativo en la velocidad mxima de transmisin
mayor de 54 Mbps.

El punto de acceso establece comunicacin a travs de la interface Ethernet y el protocolo


TCP/IP con el HEC, configurando una red privada con estos dispositivos.Dentro de la LAN
inalmbricas el protocolo ms usado (por tanto el ms comercial) es el IEEE 802,11 /b/g/n
mejor conocido como WI-FI.

8.3.1. Conexin a la red del HEC

Para conectar y configurar el mdulo inalmbrico de HEC fue necesario implementar en la


tarjeta un puerto serial RS232.

El mdulo de conexin WIFI del HEC es el USR WIFI232B el cual funciona con protocolo
IEEE 802,11 que puede conectarse a cualquier equipo con interface inalmbrica y puerto
serial para transferencia de datos.

Este mdulo WIFI USR WIFI232B se diferencia del USR WIFI232T en primer lugar porque
no es un adaptador WIFI para Arduino, sino un micro PC que incorpora un mdulo WIFI, es
decir no es un simple mdulo que necesita ser manejados como esclavos de un
microcontrolador externo, sino que en su interior alberga un microprocesador interno y una
memoria.

Aparte de los pines TX, RX, VCC y GND, dichos mdulos poseen pines GPIO para
conectarles otros dispositivos como pantallas o sensores mediante las interfaces UART, I2C,
SPI.

29
El mdulo de conexin inalmbrica es utilizado en aplicaciones de domtica y dispositivos
inteligentes. El mdulo WIFI tiene capacidad para conectar hasta 32 estaciones
simultneamente.

Caractersticas del dispositivo de comunicaciones:

Soporta estndar inalmbrico IEEE 802,11b/g/n


Soporta protocolo de red TCP/IP/UDP
Soporta WIFI a 2,4 GHz, con modo de seguridad WEP, WPA/WPA2
Consumo de potencia muy bajo para aplicaciones con batera con tensin de
alimentacin TTL (3,3 volts).
Soporta interfaz de comunicaciones de datos UART (Universal Asncrono Recepcin y
Transmisin) /PWM/GPIO
Parametrizacin en interfaz web, Android, IOS APP, Smart link APP.
Protocolo de red IPv4, TCP/UDP/HTTP
Vida til 12 meses
Velocidad de transmisin de seales por segundo: 600, 1200, 1800, 2400, 4800, 9600,
19200, 38400, 57600, 115200, 230400, 380400, 460800.
La longitud de datos de recepcin cubre 0-1000 bytes.

Clasificacin Item Parmetros


Parmetros inalmbricos Estndar inalmbrico 802,11 b/g/n
Rango de frecuencia 2,42GHz 2,484 GHz
Parmetros del hardware Voltaje de operacin 3,3 V
Corriente de operacin 170 mA 300 mA
Dimensiones 25 x 40 x 8 mm
Parmetros del software Tipo de red Estacin / AP modo / STA+AP
Seguridad WEP/WAP/WAP2
Tabla 8. Especificaciones tcnicas del mdulo inalmbrico para el HEC.

Grfica 8.3.1-1 Configuracin de pines para el mdulo inalmbrico del HEC.

PIN Descripcin Nombre Direccin Nota


1 Tierra GND Potencia Tierra
2 Vcc 3,3 Volts 3,3 V Potencia 3,3 V

30
3 UART dato de transmisin UART_TXD O Si no usa la funcin
GPIO GPIO4 I/O UART, estos pines
4 UART dato recibido UART_RXD I pueden ser configurados
GPIO GPIO4 I/O como pines GPIO
5 UART enviar requisitos de UART_RTS O
datos de transmisin
GPIO GPIO5 I/O
6 UART recibir dato de UART_CTS I
permiso de transmisin
GPIO GPIO6 I/O
7 Seal de reset RESET I 0 entrada de reset
La duracin de la seal
debe durar ms de 300
ms
8 Indicador de estado WIFI nLink O 0 Conexin WIFI
disponible
9 Indicacin de estado del nReady O 0 final del proceso
mdulo 1 Arranque del mdulo
GPIO GPIO9 I/O sin finalizar
10 Restaurar configuracin nReload I El mdulo ser
GPIO GPIO10 I/O restaurado a su
configuracin de fbrica
este pin en 0 por 1 seg
11 Ethernet input + PHY_RX + I + 1,8 V interface de
12 Ethernet input - PHY_RX - I datos Ethernet
13 Ethernet Output PHY_Tx O Modo de conexin
14 Ethernet Output PHY_Tx O directa
Tabla 9. Descripcin de los pines del mdulo inalmbrico del HEC.

La potencia de transmisin de mdulo depende el protocolo que se est utilizando as:

Protocolo Potencia Sensibilidad


Potencia (dBm) Sensibilidad (dBm)
IEEE (mW) (uW)
+ 20 dBm (@ -89 dBm (@
802.11 b 100 0,0000012
11Mbps) 11Mbps)
+18 dBm (@ 54 -81 dBm (@ 54
802.11g 63 0.0000079
Mbps) Mbps)
+15 dBm (300
802.11n 31,6 -71 dBm (300 Mbps) 0.000079
Mbps)
Tabla 10. Parmetros el potencia y sensibilidad del mdulo USR-WIFI232B

8.3.2. Configuracin del HEC como Punto de Acceso y Estacin

El HEC tiene la configuracin para funcionar como punto de acceso y estacin (AP+STA),
esta configuracin se puede realizar desde el puerto serial del mdulo de comunicaciones, y
opera como se muestra en la siguiente figura:

31
Grfica 8.3.2-1 Configuracin del mdulo como punto de acceso y estacin.

Cuando es habilitado con la configuracin AP+STA, la interface STA puede conectarse con
un Router y con un servidor TCP. Al mismo tiempo, la interface AP esta tambin activada y
permite a otros dispositivos conectarse con un servidor TCP.

Las ventajas de esta configuracin es que el usuario puede establecer conexin fcilmente y
realizar un seguimiento del dispositivo sin tener que cambiar la configuracin original de la
red. Tambin se permite establecer parmetros a travs de la red WIFI cuando el mdulo
trabaja como estacin.

Esta funcin se puede configurar en este dispositivo gracias a posee dos socket.

Grfica 8.3.2-2 Configuracin del mdulo HEC como punto de acceso y estacin.

32
8.3.3. Antena de mdulo inalmbrico

Al mdulo inalmbrico debe instalarse de una antena externa. La antena est diseada para
operar de acuerdo con el estndar IEEE 802,11 b/g/n. El rango de frecuencia de operacin
estar entre 2,4 GHz y 2,5 GHz. Cuenta con una impedancia de 50 Ohm y tiene un conector
tipo I-PEX.

Grfica 8.3.2-3 Dimensiones del mdulo inalmbrico del HEC.

33
9. DISEO DEL PROTOTIPO

Cada tarjeta de sensores fue disea para tener las tres opciones de sensores incluidas, es
decir en todas las tarjetas de sensores se puede conectar el sensor de temperatura, el
magntico, o de luz (no de manera simultnea), aunque el cdigo del microcontrolador solo
implementa un sensor usado en cada tarjeta. Se hizo de esta forma para no tener que hacer
una tarjeta diferente para cada sensor y ahorra costos en la implementacin en la impresin
de cada PCB. La conversin anloga digital de las variables medidas se realiza
directamente en cada sensor.

Se uso el microcontrolador de ATMEL ATMEGA328, para procesar la informacin recibida


de cada sensor y enviarla al mdulo inalmbrico USR WIFI232. Este microcontrolador se
polariza a 3.3V (en la hoja de datos del mdulo WIFI especfica que debe ser alimentado a
3,3 Voltios y no recomienda conectarle 5V directamente) y tiene un cristal de 8 MHz para
que pueda trabajar bien a 3.3 V. La programacin se realiz en arduino, inicialmente se
cargar el microcontrolador con el boot loader del arduino mini pro para 3.3 V - 8 MHz, con el
programador ATMEL ICE, y finalmente se puede programar por el puerto serial con un
conversor de USB-UART desde el IDE de arduino.

El puerto serial se configura a una velocidad de comunicacin de 9.600 baudios para poder
programar el microcontrolador.Se emplea para misma fuente de 3.3V de la tarjeta para
alimentar el mdulo inalmbrico.

Como el modulo es bsicamente un nodo WIFI conectado a un interface serie, podramos en


principio conectar los pines RX y Tx a los equivalentes de Arduino en los pines 0 y 1
digitales, sin ms que cruzarlos (Tx a Arduino Rx y Rx a Aduano Tx), con este esquema se
comunica con el mdulo WIFI mediante las familiares instrucciones de Serial.print ().

Sin embargo, no es aconsejable hacerlo as, porque los pines 0 y 1 se utilizan en la


comunicacin serie de Arduino con el PC a travs del puerto USB y por tanto, si se usan
para comunicar con el modulo WIFI, se pierde la conexin con el PC.

Por esta razn, se destinan otro par de pines cualesquiera a la transmisin, aunque para ello
tenemos que importar una librera que habilite la comunicacin serie con otros pines como
es la librera Software Serial.
Para ello se importa la librera que viene de serie en el IDE y se crea un nuevo objeto serie
llamado BT1 conectado a los pines 4 y 2:

#include <SoftwareSerial.h>
SoftwareSerialBT1(4,2); // RX, TX

Y despus, usar BT1 exactamente igual a como se una Serial.

El programa realiza la comunicacin del microcontrolador con el modulo WIFI, el cual lee lo
que se escribe en la puerta BT1 y lo transmite a la consola serial.

34
A su vez si hay algo en la consola, lee una lnea con GetLine() y finaliza con intro antes de
enviar la lnea completa al BT1

#include <SoftwareSerial.h>
SoftwareSerialBT1(3, 2); // RX | TX

void setup()
{ Serial.begin(115200);
BT1.begin(115200);
}

void loop()
{ String B= "." ;
if (BT1.available())
{ char c = BT1.read() ;
Serial.print(c);
}
if (Serial.available())
{ char c = Serial.read();
BT1.print(c);
}
}

9.1. Diseo del Termmetro digital

Para la implementacin se decidi polarizar el sensor DS18B20 de manera convencional,


colocando Vdd a 3,3 volts y GND a tierra, y utilizar DQ solamente para comunicacin, tal y
como se muestra en la Grfica 9.1-1.

a) b)

Grfica 9.1-1a) Esquemtico de simulacin del sensor de temperatura DS18B20 donde R12 es de 4,7k.
b) Polarizacin del sensor con fuente externa.

El circuito integrado DS18B20 se polariza con 3,3 volts entre los pines 1 (GND) y 3 (VDC). El
pin numero 2 (DQ) es usado para realizar la transmisin de la informacin conectando una
resistencia de pull up de 4,7 kOhm entre VDC y DQ. Este pin es conectado al
microcontrolador para realizar la transmisin de informacin por medio de una comunicacin
tipo OneWire.

35
9.2. Sensor de luz digital

Para el sensor de luz, la polarizacin se realiza como lo recomienda el fabricante. Para este
caso el sensor ya incorpora estos componentes en la tarjeta del sensor, por esta razn solo
se habilitan 5 pines para polarizacin y comunicacin del sensor con el microcontrolador.

a) b)

Grfica 9.2-1 a) Esquemtico de simulacin del sensor de luz TSL2560. b) Aplicacin del circuito
recomendada por el fabricante.

Entre los terminales de la fuente de alimentacin se desacopla con un condensador de 0,1uf


del tipo cermico. Las resistencias Rp de pull-up mantienen las seales SDAH y SCLH en
un nivel de tensin alto cuando el bus est libre y asegura que las seales estn en un valor
alto en el tiempo de subida requerido.

Una resistencia Rpi tambin se incluye en la seal INT, que funciona para una conexin
(seal).

9.3. Diseo del sensor magntico

Como se mencion en el marco terico conceptual, la implementacin del sensor magntico


es muy sencilla y funciona como un interruptor ON-OFF con una resistencia de pullup.
a)

36
Grfica 9.3-1 a) Esquemtico de simulacin del sensor de temperatura DS18B20 donde R12 es de 4,7k.
b) Polarizacin del sensor con fuente externa.

Su principio de operacin detecta los objetos magnticos que se utilizan para accionar el
proceso de conmutacin.
La seal siempre se mantiene en 0 Volts, hasta cuando el imn cierra el circuito y en la
resistencia R11 hasta 3,3 volts que es un 1 lgico para el microcontrolador.

37
9.4. Diseo del HEC (Home Energy Controller)

En el siguiente esquemtico se muestra la configuracin del microcontrolador que se utiliza


como cerebro del HEC.

Para conectar y configurar el mdulo inalmbrico de HEC fue necesario implementar en la


tarjeta un puerto serial RS232.

El mdulo de conexin WIFI del HEC es el USR WIFI232B el cual funciona con protocolo
IEEE 802,11 que puede conectarse a cualquier equipo con interface inalmbrica y puerto
serial para transferencia de datos.

Este mdulo WIFI USR WIFI232B se diferencia del USR WIFI232T en primer lugar porque
no es un adaptador WIFI para Arduino, sino un micro PC que incorpora un mdulo WIFI, es
decir no es un simple mdulo que necesita ser manejados como esclavos de un
microcontrolador externo, sino que en su interior alberga un microprocesador interno y una
memoria.

Aparte de los pines TX, RX, VCC y GND, dichos mdulos poseen pines GPIO para
conectarles otros dispositivos como pantallas o sensores mediante las interfaces UART, I2C,
SPI.

El mdulo WIFI se polariza a 3,3 volts y se conectan los pines Rx y Tx con su


correspondientes pines del microcontrolador.

Adicionalmente se conectaron leds en el puerto de link y Rdx para comprobar visualmente el


estado del mdulo.

a) b)

c)

38
d)

Grfica 9.4-1 a) Diseo del mdulo WIFI USR WIFI2323B para el HEC. b) Fuente de alimentacin para el
HEC. c) Configuracin del microcontrolador ATMega328. d) Interface Serial para configuracin y pruebas

Se uso el microcontrolador de ATMEL ATMEGA328, para procesar la informacin recibida


de cada sensor y enviarla al mdulo inalmbrico USR WIFI232. Este microcontrolador se
polariza a 3.3V (en la hoja de datos del mdulo WIFI especfica que debe ser alimentado a
3,3 Voltios y no recomienda conectarle 5V directamente) y tiene un cristal de 8 MHz para
que pueda trabajar bien a 3.3 V. La programacin se realiz en arduino, inicialmente se
cargar el microcontrolador con el boot loader del arduino mini pro para 3.3 V - 8 MHz, con el

39
programador ATMEL ICE, y finalmente se puede programar por el puerto serial con un
conversor de USB-UART desde el IDE de arduino.

El HEC es el mdulo que ms energa requiere para su operacin, como se observa en la


Tabla 10 y debido a que ser un dispositivo esttico es la SmartHome, este se conecta a
travs de un regulador a la red elctrica (No usa bateria) directamente por recomendacin
del fabricante se emplea un regulador de tensin de 3,3 volts como se observa en la imagen
anterior.

9.5. Red de sensores

La arquitectura de red que se implement con la red de sensores inalmbricos, fue tipo
estrella. Una topologa en estrella es un sistema single-hop en el que todos los nodos de
sensores inalmbricos se comunican directamente con el HEC.}

La ventaja de esta topologa de red es el bajo consumo de energa ya que la red se


considera que debe estar en funcionamiento de manera continua.

Los nodos de sensores en la topologa en estrella no se comunican entre ellos, y el alcance


de la red de sensores est limitado por la distancia de transmisin de cada mdulo.

Si la nica va de comunicacin entre un sensor y una estacin base es interferida u


obstruida, no hay rutas de comunicacin alternativos y el enlace inalmbrico con el sensor
se pierde.

9.6. Interfaz hombre mquina

Se dise una interface de usuario que se pueda manejar fcilmente. La estacin HEC es
utilizada como intermediario entre la red de sensores e Internet. Proporciona una conexin
inalmbrica para la transferencia de datos. La estacin base (HEC) funciona como estacin
para un Router con conexin a internet y como Punto de Acceso para cada una de las
tarjetas de sensores. El servidor principal se conecta a Internet para permitir a los usuarios
remotos acceder al sistema de monitoreo.

De acuerdo con (Zualkernan, Al-Ali, Jabbar, Zabalawi, & Wasfy, 2009) la arquitectura del
hardware para una red est compuesta por:

Estacin terminal: Este es una estacin equipada con la capacidad de memoria suficiente.
Este dispositivo es utilizado el servidor hardware donde se instalar el software provisto de
conexin a internet.

Estacin de coordinacin y monitoreo: Esta estacin cumple la funcin de la


comunicacin local. Adicionalmente, cuenta con una pantalla para permitir a un usuario para
ver los datos.

La arquitectura propuesta de monitoreo se muestra en la Grfica 9.6-1

40
Grfica 9.6-1 Arquitectura del sistema de monitoreo (Lpez Antn & Gala Trallero, 2012).

En cuanto al software, existen prototipos propuesto e implementados por diversos mtodos.


A continuacin de describen algunos encontrados en la literatura tcnica. Durante la
ejecucin del proyecto se tomar la decisin de tomar alguno de estos:

En (Java-Based Home Automation System, 2004) propone un modelo basado en


Java para la automatizacin de una vivienda, este puede monitorear y controlar los
sensores a travs de internet.

En (Su, Lee, & Wu, 2006) se presenta un mdulo programable con protocolo TCP/IP
donde se introduce el control de temperatura de agua a distancia.

Estos dos sistemas podran proporcionar buenas soluciones monitoreo remoto de los
sensores en el SmartHome, pero no mencionan como es la interactuar con la red de
sensores.

En (Ziya, Member, & Buhur, 2005) se presenta una solucin inalmbrica para
conectar los sensores con la SmartHome en un servidor central. Se presenta cada
sensor como un nodo que tiene comunicacin directa de forma individual. En esta
comunicacin se emplea comunicacin punto a punto.

41
10. IMPLEMENTACIN DEL DISEO

Para la implementacin del prototipo se utiliz el software Design Spark PCB 7.2, la cual es
una herramienta gratuita de diseo PCB fcil de utilizar. Design Spark PCB posee un
entorno grfico fcil de utilizar, no tiene restriccin en cuanto al tamao de la placa, nmero
de pines o capaz.2.

Este software genera el archivo de extensin DXF e IDF para la implementacin. Con este
programa fue posible realizar la agrupacin de componentes del circuito. Todos los
componentes utilizados para la creacin de PCB fueron extrados de las libreras del
programa.

El diseo del PCB para cada mdulo de luz, temperatura y sensor magntico fue realizado
tal cual se muestra en el circuito de la siguiente figura, es decir la tarjeta de sensores fue
diseara para conectar el sensor de temperatura, magntico, o de luz. Cada mdulo sensor
es totalmente inalmbrico e independiente uno de otro.

El orden de las capas que se relacionan a continuacin es:


Serigrafa superior
Capa de soldado superior
Capa de soldado inferior
Serigrafa inferior

a) b)

c) d)

2
La pgina de descarga gratuita del software Design Spark PCB es https://www.rs-
online.com/designspark/pcb-software

42
e)

Grfica 9.6-2Diseo del PCB para la tarjeta electrnica. a) c) Serigrafa o silkscreen de la capa superior
del PCB. d) Pistas o caminos de cobre en la capa superior del PCB. c) Serigrafa o silkscreen de la capa
inferior del PCB. d) Print circuit Board completo. e) Fotografa del PCB.

43
10.1. Diseo y construccin del HEC

a) b)

c) d)

44
e)

Grfica 10.1-1 Diseo del PCB para el HEC con el mdulo WIFI. a) Serigrafa o silkscreen de la capa
superior del PCB. b) Pistas o caminos de cobre en la capa superior del PCB. c) Pistas o caminos de cobre
en la capa inferior del PCB d) Serigrafa o silkscreen de la capa inferior del PCB. e) Print circuit Board
completa.

La PCB para cada mdulo sensor fue construida segn el diseo, el PCB tiene una
dimensin de 4.7 x 6.5 cm, un tamao lo suficientemente pequeo para que sea fcil de
localizar dentro del hogar.

Adems la tarjeta cuenta con una terminal de carga de batera que permite cargar todos los
mdulos sin tener que extraer la batera. Tambin se cuenta con un switch de encendido /
apagado.
Se puede observar que la tarjeta incluida la batera de alimentacin tiene un tamao muy
manejable a la hora de ubicarlo en algn lugar estratgico dentro de una casa.

45
a) b)

c)

d)

Grfica 10.1-2 a) Tarjeta del sensor magntico. b) Tarjeta del sensor de temperatura. c) Tarjeta del sensor
de iluminacin. d) Tarjeta del HEC

46
11. INTERFAZ HOMBRE MQUINA (IHM)
Para la implementacin de interfaz hombre mquina se emplea una pgina en la cual se
portals.exite.com la cual cuenta con la plataforma de Murano que incluye la conectividad y
gestin de dispositivos.

Permite representar los dispositivos conectados, proporciona herramientas e interfaces para


gestionar los dispositivos, permitiendo desplegar diferentes ventanas para verificar el
comportamiento del dispositivo mediante cuadros

47
12. ANLISIS DE RESULTADOS
La potencia consumida por cada tarjeta depende del tipo de sensor que se est utilizando y
el protocolo de transmisin empleado en cada sensor. La potencia total estimada de
operacin de cada dispositivo del prototipo se muestra en la siguiente tabla:

Potencia Potencia Potencia


Dispositivo mW mW mW
802.11n 802.11g 802.11b
Sensor de luz 1,98 1,98 1,98
Sensor de temperatura 4,95 4,95 4,95
Sensor magntico - - -
Mdulo de
comunicaciones tarjeta 19,95 25,12 39,81
electrnica
Mdulo de
31,6 63 100
comunicaciones HEC*
* Empleando protocolo IEEE 802.11 incluida la potencia de transmisin de la antena.

El HEC se encuentra activado consume: 31,6 mW

La tarjeta del sensor de temperatura cuando se encuentra activado consume: 24,9 mW para
un protocolo de comunicacin 802.11n. 30,07 mW para un protocolo de comunicacin
802.11g y 44.76 mW un protocolo de comunicacin 802.11b.

La tarjeta del sensor de luz cuando se encuentra activado consume: 21,93 mW para un
protocolo de comunicacin 802.11n. 27,1 mW para un protocolo de comunicacin 802.11g y
41,79 mW un protocolo de comunicacin 802.11b.

La tarjeta del sensor magntico cuando se encuentra activado consume: 19,95 mW para un
protocolo de comunicacin 802.11n. 25,12 mW para un protocolo de comunicacin 802.11g
y 39,81 mW un protocolo de comunicacin 802.11b.

Para una batera de 1300 mA-h es espera que la duracin de cada mdulo en operacin
antes de recargar la batera sea de:

41,79
= = 13,56
3,3

1300
= = 95,5
13,56

Por tanto el tiempo de duracin de una batera es de aproximadamente 4 das de operacin


contnua.

48
13. COSTOS DEL PROYECTO
13.1. Recursos humanos

Para la realizacin de este prototipo de SmartHome, se necesito del estudiante Diego Carlos
A. Mndez, quin se encarg de implementar los diseos de las tarjetas para los sistemas
de medicin de iluminacin, temperatura, on-off y comunicaciones.

Los recursos incluye el trabajo del estudiante de ingeniera, el tiempo dedicado por el
profesor director y el ingeniero asesor del grupo de investigacin.

TIPO DE FUNCION DENTRO SEMANAS DE HORAS POR


NOMBRE RECURSOS/HORA TOTAL
VINCULACIN DEL PROYECTO VINCULACIN SEMANA

ESTUDIANTE/
Diego Carlos
INGENIERA PONENTE 22 9 $ 15 000 $ 2 970 000
A. Mndez
ELECTRNICA
ING. MSC
Roberto DOCENTE DE
DIRECTOR 22 0,05 $ 200 000 $ 220 000
Ferro PLANTA
Escobar

Ing. Asesor INGENIERO DEL


Andres GRUPO DE ASESOR 22 0,5 $ 20 000 $ 220 000
Valencia INVESTIGACIN

TOTAL $ 3 410 000


Tabla 11 Recursos humanos empleados para el diseo del prototipo.

13.2. Costos fijos

Este proyecto est enfocado a realizar un prototipo acadmico, cuyo nico fin es la
implementacin a escala de una red de tres sensores para una SmartHome, es necesario
tener en cuenta el costo de los dispositivos electrnicos que se utilizaron.

Dispositivos utilizados en la elaboracin del Costo


Unit Costo total
proyecto (Costos directos) unitario
Mdulo WIFI
Estos mdulos permiten comunicar cualquier dispositivo de forma inalmbrica con una red
HAN o con un servidor remoto. Soporta el estndar IEEE802.11.Soporta los protocolos de
red TCP/IP/UDP. Mdulo de muy bajo consumo, ideal para aplicaciones con bateras.
Mdulo WIFI USR WIFI232T

3 $ 20 000 $60 000

Mdulo WIFI USR WIFI232B 1 $ 50 000 $ 50 000

49
Sensor de temperatura
DS18B20

1 1 USD $ 3 000

Sensor de luz

1 $ 20 000 $ 20 000

Micro controlador Mega328

4 $ 8000 $ 32 000

Sensor magntico

50
1 $ 3 000 $ 3 000

CPB tarjeta de cada sensor

3 $ 20 000 $ 60 000

CPB Tarjeta HEC

1 $ 22 000 $ 22 000

Otros componentes menores (Resistencias condensadores)

Global $ 50 000 $ 50 000

Bateras

51
3 $ 5 000 $ 15 000

Conversor Serial

1 $ 10 000 $ 10 000

Interfaz hombre mquina

1 $0 $0

Total $ 315 000


Tabla 12 Costos directos para implementacin del prototipo

Para una descripcin ms detallada de los recursos financieros, estos se muestran en la


Tabla 12 Costos directos para implementacin del prototipo: Los costos directos son los
asociados a la elaboracin fsica del prototipo.

52
14. CRONOGRAMA DE EJECUCIN DE LOS TRABAJOS
14.1. Tiempo de ejecucin del proyecto

La fecha de inicio para la ejecucin de las actividades es el mes mayo de 2016, fecha en la
que se termin de realizar el anteproyecto, y se firm la carta de aceptacin por parte del
director del proyecto, sin embargo, el anteproyecto fue radicado hasta el junio de 2016
debido anormalidad acadmica y se incluy en el acta 13 celebrada el 22 de junio de 2016
del consejo de carrera del proyecto curricular de ingeniera electrnica.

De acuerdo con el cronograma de ejecucin de trabajos, se observa que el tiempo requerido


para el diseo e implementacin de este proyecto fue aproximadamente de 5,5 meses.

14.2. Estrategia de trabajo

El desarrollo del proyecto se realiz en etapas secuenciales, en el cronograma se compara


la duracin estimada en el anteproyecto y la ejecutada.

Estudio de las plataformas de comunicaciones en domtica


Seleccin de la arquitectura para un sistema de monitoreo en red NMS
Montaje desde cada sensor y verificacin de la informacin con la red local
Montaje de dispositivo de prueba para comunicaciones por red remota
montaje prototipo vivienda con comunicacin elegida
Realizar interface web remota de comunicacin
Realizar la prueba de funcionamiento del sistema integrado
Pruebas finales

53
14.3. Cronograma

54
15. RECOMENDACIONES
El prototipo se implement exitosamente en una vivienda con una estacin de
monitoreo y 3 estaciones (una por cada sensor). Sin embargo, debido a que
el mdulo conexin inalmbrica soporta hasta 32 estaciones, en una
implementacin mayor se debera tener en cuenta la limitacin de dispositivos
que se pueden conectar.

Los mdulos de comunicacin inalmbrica USR WIFI232 poseen una


velocidad de transmisin de hasta 460800 baudios y una
transmisin/recepcin de datos de hasta 100 Mbps por tanto se podra
implementar para transmisin de video.

16. COMENTARIOS
Debido a que el protocolo de comunicaciones IEEE 802,11 empleado en el
prototipo es compatible con dispositivos mviles, es posible crear una
aplicacin mvil para monitorear las variables medidas.

Se espera que cada tarjeta de sensores tenga una vida til para operacin
continua sin que necesite reparaciones o reemplazo de dispositivos igual a
superior a cada mdulo WIFI, y de acuerdo con la hoja de datos del
fabricante, se puede estimar en 12 meses, que es el tiempo medio de vida.

17. CONCLUSIONES

Las variables que se quieran medir en una SmartHome se puede integrar a


una estacin de monitoreo (cuyo mdulo de comunicaciones es el USR-
WIFI232B), siempre y cuando estas no exceda las 32 estaciones. En la
implementacin no fue posible utilizar solo mdulos USR-WIFI232T (es el
mdulo de comunicaciones de cada tarjeta de sensor), debido a que en
configuracin AP, solo puede conectar mximo dos (2) dispositivos como
STA. Por esta razn se tom la decisin de adquirir un mdulo USR-
WIFI232B.

La versatilidad y escalabilidad de estos mdulos permiten que puedan ser


implementados en el aula piloto por el grupo de investigacin LIDER ya que
con la tarjeta de medicin de iluminacin, sera necesario dimerizar el sistema
de iluminacin y habilitar un puerto del microcontrolador como controlador.

Para el control de las ayudas audiovisuales y persianas en el aula piloto el


mdulo con sensor ON-OFF puede ser implementado.

55
18. BIBLIOGRAFA

Albuquerque, H. J. O., & De Aquino Junior, G. S. (2014). A proxy-based


solution for interoperability of smart home protocols. Proceedings - 2014 8th
International Conference on Complex, Intelligent and Software Intensive
Systems, CISIS 2014, 287293. http://doi.org/10.1109/CISIS.2014.96
Java-Based Home Automation System. (2004), 50(2), 498504.
Lpez Antn, D., & Gala Trallero, S. (2012). RED INALMBRICA PARA
INSTRUMENTACIN DE PROCESOS , 2012(707).
Nagli, M., & Souvent, A. (2013). Concept of SmartHome and SmartGrids
integration. IYCE 2013 - 4th International Youth Conference on Energy, 15.
http://doi.org/10.1109/IYCE.2013.6604199
Nelson L Forero, & Gerardo Gordillo. (n.d.). Aplicacin de Redes Inalmbricas
Wi-Fi en Sistemas de Adquisicin y Monitoreo Remoto de Variables
Ambientales y Parmetros de Operacin de Sistemas Fotovoltaicos usando
Instrumentacin Virtual, 16.
Ricardo Gonzlez. (2014). propuesta doctorado domotica - smart cities.
Bogot: Presentacin convocatoria colciencias 2014.
Su, J., Lee, C., & Wu, W. (2006). The D esign and I mplementation of a L ow-
cost and P rogrammable H ome A utomation M odule, 05.
Ziya, A., Member, A., & Buhur, U. (2005). An Internet Based Wireless Home
Automation System for Multifunctional Devices, 11691174.
Zualkernan, I. A., Al-Ali, A. R., Jabbar, M. A., Zabalawi, I., & Wasfy, A. (2009).
InfoPods: Zigbee-based remote information monitoring devices for smart-
homes. IEEE Transactions on Consumer Electronics, 55(3), 12211226.
http://doi.org/10.1109/TCE.2009.5277979
Castillo Cristiano, E. N., & Montoya Crdenas, O. L. (2014). Implementacin
del prototipo de un sistema electrnico de bajo costo que permite el control
inalmbrico de iluminacin domtico basado en el protocolo Zigbee. Bogot:
Universidad Distrital Francisco Jos de Caldas.
Cubillos Cabera, S. A., & Molina Bernal, F. g. (2014). Diseo de la instalacin
elctrica y del sistema de iluminacin con control domtico para el edificio
Newen. Bogot: Universidad Distrital Francisco Jos de Caldas.
Fonseca Rodrguez, P. A. (2007). Diseo de automatismos de iluminacin,
acceso y mobiliario elctrico. Bogot: Universidad Distrital Francisco Jos de
Caldas.
Trivio Paredes, L. F., & Algarn Jimnez, V. J. (2014). Sistema de
informacin para dispositivos mviles que permita el monitoreo y control de
una vivienda automatizada. Bogot: Universidad Distrital Francisco Jos de
Caldas.
Vargas Vargas, F. J. (2013). Diseo e implementacin de una red domtica
de iluminacin, integrando el sistema HRK Domotic Solution y el bus de
comunicaciones HRK-BUS. Bogot: Universidad Distrital Francisco Jos de
Caldas.

56
ANEXO 1 Hoja de datos sensor de temperatura

57
DS18B20 Programmable Resolution
1-Wire Digital Thermometer

General Description Benefits and Features


The DS18B20 digital thermometer provides 9-bit to 12-bit Unique 1-Wire Interface Requires Only One Port
Celsius temperature measurements and has an alarm Pin for Communication
function with nonvolatile user-programmable upper and Reduce Component Count with Integrated
lower trigger points. The DS18B20 communicates over a Temperature Sensor and EEPROM
1-Wire bus that by definition requires only one data line Measures Temperatures from -55C to +125C
(and ground) for communication with a central micro- (-67F to +257F)
processor. In addition, the DS18B20 can derive power 0.5C Accuracy from -10C to +85C
directly from the data line (parasite power), eliminating Programmable Resolution from 9 Bits to 12 Bits
the need for an external power supply. No External Components Required
Each DS18B20 has a unique 64-bit serial code, which Parasitic Power Mode Requires Only 2 Pins for
allows multiple DS18B20s to function on the same 1-Wire Operation (DQ and GND)
bus. Thus, it is simple to use one microprocessor to
Simplifies Distributed Temperature-Sensing
control many DS18B20s distributed over a large area.
Applications with Multidrop Capability
Applications that can benefit from this feature include
Each Device Has a Unique 64-Bit Serial Code
HVAC environmental controls, temperature monitoring
Stored in On-Board ROM
systems inside buildings, equipment, or machinery, and
process monitoring and control systems. Flexible User-Definable Nonvolatile (NV) Alarm Settings
with Alarm Search Command Identifies Devices with
Applications Temperatures Outside Programmed Limits
Thermostatic Controls Available in 8-Pin SO (150 mils), 8-Pin SOP, and
Industrial Systems 3-Pin TO-92 Packages
Consumer Products
Thermometers Pin Configurations
Thermally Sensitive Systems
TOP VIEW
+
N.C. 1 8 N.C.
DS18B20
N.C. 2 DS18B20 7 N.C.
1 2 3
VDD 3 6 N.C.

DQ 4 5 GND

SO (150 mils)
(DS18B20Z)

DQ 1 + 8 VDD
GND DQ VDD N.C. 2 7 N.C.
DS18B20
N.C. 3 6 N.C.
1 2 3 GND 4 5 N.C.

1 SOP
BOTTOM VIEW (DS18B20U)
Ordering Information appears at end of data sheet.
TO-92
(DS18B20)
1-Wire is a registered trademark of Maxim Integrated Products, Inc.

19-7487; Rev 4; 1/15


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

Absolute Maximum Ratings


Voltage Range on Any Pin Relative to Ground.....-0.5V to +6.0V Storage Temperature Range............................. -55C to +125C
Operating Temperature Range.......................... -55C to +125C Solder Temperature................................Refer to the IPC/JEDEC
J-STD-020 Specification.
These are stress ratings only and functional operation of the device at these or any other conditions above those indicated in the operation sections of this specification is not implied. Exposure
to absolute maximum rating conditions for extended periods of time may affect reliability.

DC Electrical Characteristics
(-55C to +125C; VDD = 3.0V to 5.5V)

PARAMETER SYMBOL CONDITIONS MIN TYP MAX UNITS


Supply Voltage VDD Local power (Note 1) +3.0 +5.5 V
Parasite power +3.0 +5.5
Pullup Supply Voltage VPU (Notes 1, 2) V
Local power +3.0 VDD
-10C to +85C 0.5
Thermometer Error tERR (Note 3) C
-55C to +125C 2
Input Logic-Low VIL (Notes 1, 4, 5) -0.3 +0.8 V

Local power +2.2 The lower


Input Logic-High VIH (Notes 1,6) of 5.5 or V
Parasite power +3.0 VDD + 0.3
Sink Current IL VI/O = 0.4V 4.0 mA
Standby Current IDDS (Notes 7, 8) 750 1000 nA
Active Current IDD VDD = 5V (Note 9) 1 1.5 mA
DQ Input Current IDQ (Note 10) 5 A
Drift (Note 11) 0.2 C

Note 1: All voltages are referenced to ground.


Note 2: The Pullup Supply Voltage specification assumes that the pullup device is ideal, and therefore the high level of the
pullup is equal to VPU. In order to meet the VIH spec of the DS18B20, the actual supply rail for the strong pullup transis-
tor must include margin for the voltage drop across the transistor when it is turned on; thus: VPU_ACTUAL = VPU_IDEAL +
VTRANSISTOR.
Note 3: See typical performance curve in Figure 1.
Note 4: Logic-low voltages are specified at a sink current of 4mA.
Note 5: To guarantee a presence pulse under low voltage parasite power conditions, VILMAX may have to be reduced to as low as
0.5V.
Note 6: Logic-high voltages are specified at a source current of 1mA.
Note 7: Standby current specified up to +70C. Standby current typically is 3A at +125C.
Note 8: To minimize IDDS, DQ should be within the following ranges: GND DQ GND + 0.3V or VDD 0.3V DQ VDD.
Note 9: Active current refers to supply current during active temperature conversions or EEPROM writes.
Note 10: DQ line is high (high-Z state).
Note 11: Drift data is based on a 1000-hour stress test at +125C with VDD = 5.5V.

www.maximintegrated.com Maxim Integrated 2


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

AC Electrical CharacteristicsNV Memory


(-55C to +125C; VDD = 3.0V to 5.5V)

PARAMETER SYMBOL CONDITIONS MIN TYP MAX UNITS


NV Write Cycle Time tWR 2 10 ms
EEPROM Writes NEEWR -55C to +55C 50k writes
EEPROM Data Retention tEEDR -55C to +55C 10 years

AC Electrical Characteristics
(-55C to +125C; VDD = 3.0V to 5.5V)

PARAMETER SYMBOL CONDITIONS MIN TYP MAX UNITS


9-bit resolution 93.75
10-bit resolution 187.5
Temperature Conversion Time tCONV (Note 12) ms
11-bit resolution 375
12-bit resolution 750
Time to Strong Pullup On tSPON Start convert T command issued 10 s
Time Slot tSLOT (Note 12) 60 120 s
Recovery Time tREC (Note 12) 1 s
Write 0 Low Time tLOW0 (Note 12) 60 120 s
Write 1 Low Time tLOW1 (Note 12) 1 15 s
Read Data Valid tRDV (Note 12) 15 s
Reset Time High tRSTH (Note 12) 480 s
Reset Time Low tRSTL (Notes 12, 13) 480 s
Presence-Detect High tPDHIGH (Note 12) 15 60 s
Presence-Detect Low tPDLOW (Note 12) 60 240 s
Capacitance CIN/OUT 25 pF
Note 12: See the timing diagrams in Figure 2.
Note 13: Under parasite power, if tRSTL > 960s, a power-on reset can occur.

DS18B20 TYPICAL ERROR CURVE


0.5
0.4
THERMOMETER ERROR (C)

0.3 +3s ERROR


0.2
0.1
0
-0.1
-3s ERROR
-0.2
-0.3
MEAN ERROR
-0.4
-0.5
0 10 20 30 40 50 60 70
TEMPERATURE (C)

Figure 1. Typical Performance Curve

www.maximintegrated.com Maxim Integrated 3


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

1-WIRE WRITE ZERO TIME SLOT

tSLOT
tREC START OF NEXT CYCLE

tLOW0

1-WIRE READ ZERO TIME SLOT

tSLOT
START OF NEXT CYCLE
tREC

tRDV

1-WIRE RESET PULSE

RESET PULSE FROM HOST

tRSTL tRSTH

PRESENCE DETECT
1-WIRE PRESENCE DETECT tPDIH

tPDLOW

Figure 2. Timing Diagrams

Pin Description
PIN
NAME FUNCTION
SO SOP TO-92
1, 2, 6, 2, 3, 5,
N.C. No Connection
7, 8 6, 7
3 8 3 VDD Optional VDD. VDD must be grounded for operation in parasite power mode.
Data Input/Output. Open-drain 1-Wire interface pin. Also provides power to the
4 1 2 DQ
device when used in parasite power mode (see the Powering the DS18B20 section.)
5 4 1 GND Ground

www.maximintegrated.com Maxim Integrated 4


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

Overview DQ pin when the bus is high. The high bus signal also
Figure 3 shows a block diagram of the DS18B20, and charges an internal capacitor (CPP), which then supplies
pin descriptions are given in the Pin Description table. power to the device when the bus is low. This method of
The 64-bit ROM stores the devices unique serial code. deriving power from the 1-Wire bus is referred to as para-
The scratchpad memory contains the 2-byte temperature site power. As an alternative, the DS18B20 may also be
register that stores the digital output from the temperature powered by an external supply on VDD.
sensor. In addition, the scratchpad provides access to the
1-byte upper and lower alarm trigger registers (TH and
OperationMeasuring Temperature
TL) and the 1-byte configuration register. The configura- The core functionality of the DS18B20 is its direct-to-
tion register allows the user to set the resolution of the digital temperature sensor. The resolution of the tempera-
temperature-to-digital conversion to 9, 10, 11, or 12 bits. ture sensor is user-configurable to 9, 10, 11, or 12 bits,
The TH, TL, and configuration registers are nonvolatile corresponding to increments of 0.5C, 0.25C, 0.125C,
(EEPROM), so they will retain data when the device is and 0.0625C, respectively. The default resolution at
powered down. power-up is 12-bit. The DS18B20 powers up in a low-
power idle state. To initiate a temperature measurement
The DS18B20 uses Maxims exclusive 1-Wire bus proto-
and A-to-D conversion, the master must issue a Convert
col that implements bus communication using one control
T [44h] command. Following the conversion, the resulting
signal. The control line requires a weak pullup resistor
thermal data is stored in the 2-byte temperature register
since all devices are linked to the bus via a 3-state or
in the scratchpad memory and the DS18B20 returns to its
open-drain port (the DQ pin in the case of the DS18B20).
idle state. If the DS18B20 is powered by an external sup-
In this bus system, the microprocessor (the master
ply, the master can issue read time slots (see the 1-Wire
device) identifies and addresses devices on the bus
Bus System section) after the Convert T command and
using each devices unique 64-bit code. Because each
the DS18B20 will respond by transmitting 0 while the tem-
device has a unique code, the number of devices that
perature conversion is in progress and 1 when the con-
can be addressed on one bus is virtually unlimited. The
version is done. If the DS18B20 is powered with parasite
1-Wire bus protocol, including detailed explanations of the
power, this notification technique cannot be used since
commands and time slots, is covered in the 1-Wire Bus
the bus must be pulled high by a strong pullup during the
System section.
entire temperature conversion. The bus requirements for
Another feature of the DS18B20 is the ability to oper- parasite power are explained in detail in the Powering the
ate without an external power supply. Power is instead DS18B20 section.
supplied through the 1-Wire pullup resistor through the

VPU
MEMORY
4.7k PARASITE POWER CIRCUIT CONTROL LOGIC DS18B20
DQ
TEMPERATURE
SENSOR

INTERNAL VDD ALARM HIGH TRIGGER (TH)


GND 64-BIT ROM
REGISTER (EEPROM)
AND 1-Wire
CPP PORT ALARM LOW TRIGGER (TL)
SCRATCHPAD
REGISTER (EEPROM)

VDD POWER- CONFIGURATION


SUPPLY SENSE REGISTER (EEPROM)

8-BIT CRC
GENERATOR

Figure 3. DS18B20 Block Diagram

www.maximintegrated.com Maxim Integrated 5


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

The DS18B20 output temperature data is calibrated in OperationAlarm Signaling


degrees Celsius; for Fahrenheit applications, a lookup After the DS18B20 performs a temperature conversion,
table or conversion routine must be used. The tempera- the temperature value is compared to the user-defined
ture data is stored as a 16-bit sign-extended twos comple- twos complement alarm trigger values stored in the
ment number in the temperature register (see Figure 4). 1-byte TH and TL registers (see Figure 5). The sign bit (S)
The sign bits (S) indicate if the temperature is positive indicates if the value is positive or negative: for positive
or negative: for positive numbers S = 0 and for negative numbers S = 0 and for negative numbers S = 1. The TH
numbers S = 1. If the DS18B20 is configured for 12-bit and TL registers are nonvolatile (EEPROM) so they will
resolution, all bits in the temperature register will contain retain data when the device is powered down. TH and TL
valid data. For 11-bit resolution, bit 0 is undefined. For can be accessed through bytes 2 and 3 of the scratchpad
10-bit resolution, bits 1 and 0 are undefined, and for 9-bit as explained in the Memory section.
resolution bits 2, 1, and 0 are undefined. Table 1 gives
examples of digital output data and the corresponding Only bits 11 through 4 of the temperature register are
temperature reading for 12-bit resolution conversions. used in the TH and TL comparison since TH and TL are
8-bit registers. If the measured temperature is lower than

BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0


LS BYTE 23 22 21 20 2-1 2-2 2-3 2-4
BIT 15 BIT 14 BIT 13 BIT 12 BIT 11 BIT 10 BIT 9 BIT 8
MS BYTE S S S S S 26 25 24

S = SIGN

Figure 4. Temperature Register Format

Table 1. Temperature/Data Relationship


DIGITAL OUTPUT DIGITAL OUTPUT
TEMPERATURE (C)
(BINARY) (HEX)
+125 0000 0111 1101 0000 07D0h
+85* 0000 0101 0101 0000 0550h
+25.0625 0000 0001 1001 0001 0191h
+10.125 0000 0000 1010 0010 00A2h
+0.5 0000 0000 0000 1000 0008h
0 0000 0000 0000 0000 0000h
-0.5 1111 1111 1111 1000 FFF8h
-10.125 1111 1111 0101 1110 FF5Eh
-25.0625 1111 1110 0110 1111 FE6Fh
-55 1111 1100 1001 0000 FC90h
*The power-on reset value of the temperature register is +85C.

BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0


S 26 25 24 23 22 21 20

Figure 5. TH and TL Register Format

www.maximintegrated.com Maxim Integrated 6


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

or equal to TL or higher than or equal to TH, an alarm con- by CPP. To assure that the DS18B20 has sufficient supply
dition exists and an alarm flag is set inside the DS18B20. current, it is necessary to provide a strong pullup on the
This flag is updated after every temperature measure- 1-Wire bus whenever temperature conversions are tak-
ment; therefore, if the alarm condition goes away, the flag ing place or data is being copied from the scratchpad to
will be turned off after the next temperature conversion. EEPROM. This can be accomplished by using a MOSFET
The master device can check the alarm flag status of to pull the bus directly to the rail as shown in Figure 6. The
all DS18B20s on the bus by issuing an Alarm Search 1-Wire bus must be switched to the strong pullup within
[ECh] command. Any DS18B20s with a set alarm flag will 10s (max) after a Convert T [44h] or Copy Scratchpad
respond to the command, so the master can determine [48h] command is issued, and the bus must be held high
exactly which DS18B20s have experienced an alarm by the pullup for the duration of the conversion (tCONV)
condition. If an alarm condition exists and the TH or TL or data transfer (tWR = 10ms). No other activity can take
settings have changed, another temperature conversion place on the 1-Wire bus while the pullup is enabled.
should be done to validate the alarm condition. The DS18B20 can also be powered by the conventional
method of connecting an external power supply to the
Powering the DS18B20 VDD pin, as shown in Figure 7. The advantage of this
The DS18B20 can be powered by an external supply on method is that the MOSFET pullup is not required, and
the VDD pin, or it can operate in parasite power mode, the 1-Wire bus is free to carry other traffic during the tem-
which allows the DS18B20 to function without a local perature conversion time.
external supply. Parasite power is very useful for applica- The use of parasite power is not recommended for tem-
tions that require remote temperature sensing or that are peratures above +100C since the DS18B20 may not be
very space constrained. Figure 3 shows the DS18B20s able to sustain communications due to the higher leak-
parasite-power control circuitry, which steals power from age currents that can exist at these temperatures. For
the 1-Wire bus via the DQ pin when the bus is high. The applications in which such temperatures are likely, it is
stolen charge powers the DS18B20 while the bus is high, strongly recommended that the DS18B20 be powered by
and some of the charge is stored on the parasite power an external power supply.
capacitor (CPP) to provide power when the bus is low.
In some situations the bus master may not know whether
When the DS18B20 is used in parasite power mode, the
the DS18B20s on the bus are parasite powered or pow-
VDD pin must be connected to ground.
ered by external supplies. The master needs this informa-
In parasite power mode, the 1-Wire bus and CPP can pro- tion to determine if the strong bus pullup should be used
vide sufficient current to the DS18B20 for most operations during temperature conversions. To get this information,
as long as the specified timing and voltage requirements the master can issue a Skip ROM [CCh] command fol-
are met (see the DC Electrical Characteristics and AC lowed by a Read Power Supply [B4h] command followed
Electrical Characteristics). However, when the DS18B20 by a read time slot. During the read time slot, parasite
is performing temperature conversions or copying data powered DS18B20s will pull the bus low, and externally
from the scratchpad memory to EEPROM, the operating powered DS18B20s will let the bus remain high. If the
current can be as high as 1.5mA. This current can cause bus is pulled low, the master knows that it must supply
an unacceptable voltage drop across the weak 1-Wire the strong pullup on the 1-Wire bus during temperature
pullup resistor and is more current than can be supplied conversions.

VPU

DS18B20 DS18B20
VPU VPU VDD (EXTERNAL
GND DQ VDD GND DQ VDD SUPPLY)
P P
4.7k 4.7k

1-Wire BUS TO OTHER 1-Wire BUS TO OTHER


1-Wire DEVICES 1-Wire DEVICES

Figure 6. Supplying the Parasite-Powered DS18B20 During Figure 7. Powering the DS18B20 with an External Supply
Temperature Conversions

www.maximintegrated.com Maxim Integrated 7


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

64-BIT Lasered ROM code ter data, which is explained in detail in the Configuration
Each DS18B20 contains a unique 64bit code (see Figure Register section. Bytes 5, 6, and 7 are reserved for inter-
8) stored in ROM. The least significant 8 bits of the ROM nal use by the device and cannot be overwritten.
code contain the DS18B20s 1-Wire family code: 28h. The Byte 8 of the scratchpad is read-only and contains the
next 48 bits contain a unique serial number. The most CRC code for bytes 0 through 7 of the scratchpad.
significant 8 bits contain a cyclic redundancy check (CRC) The DS18B20 generates this CRC using the method
byte that is calculated from the first 56 bits of the ROM described in the CRC Generation section.
code. A detailed explanation of the CRC bits is provided Data is written to bytes 2, 3, and 4 of the scratchpad using
in the CRC Generation section. The 64-bit ROM code and the Write Scratchpad [4Eh] command; the data must be
associated ROM function control logic allow the DS18B20 transmitted to the DS18B20 starting with the least signifi-
to operate as a 1-Wire device using the protocol detailed cant bit of byte 2. To verify data integrity, the scratchpad
in the 1-Wire Bus System section. can be read (using the Read Scratchpad [BEh] command)
after the data is written. When reading the scratchpad,
Memory data is transferred over the 1-Wire bus starting with the
The DS18B20s memory is organized as shown in Figure least significant bit of byte 0. To transfer the TH, TL and
9. The memory consists of an SRAM scratchpad with configuration data from the scratchpad to EEPROM, the
nonvolatile EEPROM storage for the high and low alarm master must issue the Copy Scratchpad [48h] command.
trigger registers (TH and TL) and configuration register.
Data in the EEPROM registers is retained when the
Note that if the DS18B20 alarm function is not used,
device is powered down; at power-up the EEPROM data
the TH and TL registers can serve as general-purpose
is reloaded into the corresponding scratchpad locations.
memory. All memory commands are described in detail in
Data can also be reloaded from EEPROM to the scratch-
the DS18B20 Function Commands section.
pad at any time using the Recall E2 [B8h] command. The
Byte 0 and byte 1 of the scratchpad contain the LSB and master can issue read time slots following the Recall E2
the MSB of the temperature register, respectively. These command and the DS18B20 will indicate the status of the
bytes are read-only. Bytes 2 and 3 provide access to TH recall by transmitting 0 while the recall is in progress and
and TL registers. Byte 4 contains the configuration regis- 1 when the recall is done.

8-BIT CRC 48-BIT SERIAL NUMBER 8-BIT FAMILY CODE (28h)


MSB LSB MSB LSB MSB LSB

Figure 8. 64-Bit Lasered ROM Code

SCRATCHPAD
(POWER-UP STATE)

BYTE 0 TEMPERATURE LSB (50h)


(85C)
BYTE 1 TEMPERATURE MSB (05h) EEPROM

BYTE 2 TH REGISTER OR USER BYTE 1* TH REGISTER OR USER BYTE 1*


BYTE 3 TL REGISTER OR USER BYTE 2* TL REGISTER OR USER BYTE 2*
BYTE 4 CONFIGURATION REGISTER* CONFIGURATION REGISTER*
BYTE 5 RESERVED (FFh)
BYTE 6 RESERVED
BYTE 7 RESERVED (10h)
BYTE 8 CRC*

*POWER-UP STATE DEPENDS ON VALUE(S) STORED IN EEPROM.

Figure 9. DS18B20 Memory Map

www.maximintegrated.com Maxim Integrated 8


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

Configuration Register received error free. The comparison of CRC values and
Byte 4 of the scratchpad memory contains the configura- the decision to continue with an operation are determined
tion register, which is organized as illustrated in Figure 10. entirely by the bus master. There is no circuitry inside the
The user can set the conversion resolution of the DS18B20 DS18B20 that prevents a command sequence from pro-
using the R0 and R1 bits in this register as shown in Table ceeding if the DS18B20 CRC (ROM or scratchpad) does
2. The power-up default of these bits is R0 = 1 and R1 = not match the value generated by the bus master.
1 (12-bit resolution). Note that there is a direct tradeoff The equivalent polynomial function of the CRC (ROM or
between resolution and conversion time. Bit 7 and bits 0 to scratchpad) is:
4 in the configuration register are reserved for internal use CRC = X8 + X5 + X4 + 1
by the device and cannot be overwritten.
The bus master can re-calculate the CRC and compare it
CRC Generation to the CRC values from the DS18B20 using the polyno-
mial generator shown in Figure 11. This circuit consists
CRC bytes are provided as part of the DS18B20s 64-bit
of a shift register and XOR gates, and the shift register
ROM code and in the 9th byte of the scratchpad memory.
bits are initialized to 0. Starting with the least significant
The ROM code CRC is calculated from the first 56 bits
bit of the ROM code or the least significant bit of byte 0
of the ROM code and is contained in the most significant
in the scratchpad, one bit at a time should shifted into the
byte of the ROM. The scratchpad CRC is calculated from
shift register. After shifting in the 56th bit from the ROM or
the data stored in the scratchpad, and therefore it chang-
the most significant bit of byte 7 from the scratchpad, the
es when the data in the scratchpad changes. The CRCs
polynomial generator will contain the recalculated CRC.
provide the bus master with a method of data validation
Next, the 8-bit ROM code or scratchpad CRC from the
when data is read from the DS18B20. To verify that data
DS18B20 must be shifted into the circuit. At this point, if
has been read correctly, the bus master must re-calculate
the re-calculated CRC was correct, the shift register will
the CRC from the received data and then compare this
contain all 0s. Additional information about the Maxim
value to either the ROM code CRC (for ROM reads) or
1-Wire cyclic redundancy check is available in Application
to the scratchpad CRC (for scratchpad reads). If the cal-
Note 27: Understanding and Using Cyclic Redundancy
culated CRC matches the read CRC, the data has been
Checks with Maxim iButton Products.

BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0


0 R1 R0 1 1 1 1 1

Figure 10. Configuration Register

Table 2. Thermometer Resolution Configuration


RESOLUTION
R1 R0 MAX CONVERSION TIME
(BITS)
0 0 9 93.75ms (tCONV/8)
0 1 10 187.5ms (tCONV/4)
1 0 11 375ms (tCONV/2)
1 1 12 750ms (tCONV)

INPUT

XOR XOR XOR

MSB LSB

Figure 11. CRC Generator

www.maximintegrated.com Maxim Integrated 9


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

1-Wire Bus System Transaction Sequence


The 1-Wire bus system uses a single bus master to con- The transaction sequence for accessing the DS18B20 is
trol one or more slave devices. The DS18B20 is always a as follows:
slave. When there is only one slave on the bus, the sys- Step 1. Initialization
tem is referred to as a single-drop system; the system is
multidrop if there are multiple slaves on the bus. Step 2. ROM Command (followed by any required data
exchange)
All data and commands are transmitted least significant
bit first over the 1-Wire bus. Step 3. DS18B20 Function Command (followed by any
required data exchange)
The following discussion of the 1-Wire bus system is
broken down into three topics: hardware configuration, It is very important to follow this sequence every time the
transaction sequence, and 1-Wire signaling (signal types DS18B20 is accessed, as the DS18B20 will not respond
and timing). if any steps in the sequence are missing or out of order.
Exceptions to this rule are the Search ROM [F0h] and
Hardware Configuration Alarm Search [ECh] commands. After issuing either of
these ROM commands, the master must return to Step 1
The 1-Wire bus has by definition only a single data line.
in the sequence.
Each device (master or slave) interfaces to the data line
via an open-drain or 3-state port. This allows each device
Initialization
to release the data line when the device is not transmit-
ting data so the bus is available for use by another device. All transactions on the 1-Wire bus begin with an initializa-
The 1-Wire port of the DS18B20 (the DQ pin) is open tion sequence. The initialization sequence consists of a
drain with an internal circuit equivalent to that shown in reset pulse transmitted by the bus master followed by
Figure 12. presence pulse(s) transmitted by the slave(s). The pres-
ence pulse lets the bus master know that slave devices
The 1-Wire bus requires an external pullup resistor of (such as the DS18B20) are on the bus and are ready
approximately 5k; thus, the idle state for the 1-Wire to operate. Timing for the reset and presence pulses is
bus is high. If for any reason a transaction needs to be detailed in the 1-Wire Signaling section.
suspended, the bus MUST be left in the idle state if the
transaction is to resume. Infinite recovery time can occur ROM Commands
between bits so long as the 1-Wire bus is in the inactive
After the bus master has detected a presence pulse, it
(high) state during the recovery period. If the bus is held
can issue a ROM command. These commands operate
low for more than 480s, all components on the bus will
on the unique 64-bit ROM codes of each slave device
be reset.
and allow the master to single out a specific device if
many are present on the 1-Wire bus. These commands
also allow the master to determine how many and what
types of devices are present on the bus or if any device
VPU has experienced an alarm condition. There are five ROM
commands, and each command is 8 bits long. The master
DS18B20
4.7k device must issue an appropriate ROM command before
1-Wire PORT
Rx 1-Wire BUS DQ Rx
issuing a DS18B20 function command. A flowchart for
operation of the ROM commands is shown in Figure 13.
5A
TYP
Tx
Search Rom [F0h]
100
MOSFET When a system is initially powered up, the master must
Tx
identify the ROM codes of all slave devices on the bus,
Rx = RECEIVE
Tx = TRANSMIT
which allows the master to determine the number of
slaves and their device types. The master learns the
ROM codes through a process of elimination that requires
the master to perform a Search ROM cycle (i.e., Search
Figure 12. Hardware Configuration ROM command followed by data exchange) as many
times as necessary to identify all of the slave devices.

www.maximintegrated.com Maxim Integrated 10


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

If there is only one slave on the bus, the simpler Read master must return to Step 1 (Initialization) in the transac-
ROM [33h] command can be used in place of the Search tion sequence. See the OperationAlarm Signaling sec-
ROM process. For a detailed explanation of the Search tion for an explanation of alarm flag operation.
ROM procedure, refer to Application Note 937: Book of
iButton Standards. After every Search ROM cycle, the DS18B20 Function Commands
bus master must return to Step 1 (Initialization) in the After the bus master has used a ROM command to
transaction sequence. address the DS18B20 with which it wishes to communi-
cate, the master can issue one of the DS18B20 function
Read Rom [33h]
commands. These commands allow the master to write
This command can only be used when there is one slave to and read from the DS18B20s scratchpad memory,
on the bus. It allows the bus master to read the slaves initiate temperature conversions and determine the power
64-bit ROM code without using the Search ROM proce- supply mode. The DS18B20 function commands, which
dure. If this command is used when there is more than are described below, are summarized in Table 3 and illus-
one slave present on the bus, a data collision will occur trated by the flowchart in Figure 14.
when all the slaves attempt to respond at the same time.
Convert T [44h]
Match Rom [55H]
This command initiates a single temperature conversion.
The match ROM command followed by a 64-bit ROM Following the conversion, the resulting thermal data is
code sequence allows the bus master to address a stored in the 2-byte temperature register in the scratch-
specific slave device on a multidrop or single-drop bus. pad memory and the DS18B20 returns to its low-power
Only the slave that exactly matches the 64-bit ROM code idle state. If the device is being used in parasite power
sequence will respond to the function command issued mode, within 10s (max) after this command is issued
by the master; all other slaves on the bus will wait for a the master must enable a strong pullup on the 1-Wire bus
reset pulse. for the duration of the conversion (tCONV) as described
Skip Rom [CCh] in the Powering the DS18B20 section. If the DS18B20 is
powered by an external supply, the master can issue read
The master can use this command to address all devices
time slots after the Convert T command and the DS18B20
on the bus simultaneously without sending out any ROM
will respond by transmitting a 0 while the temperature
code information. For example, the master can make all
conversion is in progress and a 1 when the conversion is
DS18B20s on the bus perform simultaneous temperature
done. In parasite power mode this notification technique
conversions by issuing a Skip ROM command followed by
cannot be used since the bus is pulled high by the strong
a Convert T [44h] command.
pullup during the conversion.
Note that the Read Scratchpad [BEh] command can
follow the Skip ROM command only if there is a single Write Scratchpad [4Eh]
slave device on the bus. In this case, time is saved by This command allows the master to write 3 bytes of data
allowing the master to read from the slave without send- to the DS18B20s scratchpad. The first data byte is written
ing the devices 64-bit ROM code. A Skip ROM command into the TH register (byte 2 of the scratchpad), the second
followed by a Read Scratchpad command will cause byte is written into the TL register (byte 3), and the third
a data collision on the bus if there is more than one byte is written into the configuration register (byte 4). Data
slave since multiple devices will attempt to transmit data must be transmitted least significant bit first. All three
simultaneously. bytes MUST be written before the master issues a reset,
or the data may be corrupted.
Alarm Search [ECh]
The operation of this command is identical to the operation Read Scratchpad [BEh]
of the Search ROM command except that only slaves with This command allows the master to read the contents of
a set alarm flag will respond. This command allows the the scratchpad. The data transfer starts with the least sig-
master device to determine if any DS18B20s experienced nificant bit of byte 0 and continues through the scratchpad
an alarm condition during the most recent temperature until the 9th byte (byte 8 CRC) is read. The master may
conversion. After every Alarm Search cycle (i.e., Alarm issue a reset to terminate reading at any time if only part
Search command followed by data exchange), the bus of the scratchpad data is needed.
iButton is a registered trademark of Maxim Integrated Products, Inc.

www.maximintegrated.com Maxim Integrated 11


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

Copy Scratchpad [48h] following the Recall E2 command and the DS18B20 will
This command copies the contents of the scratchpad indicate the status of the recall by transmitting 0 while the
TH, TL and configuration registers (bytes 2, 3 and 4) to recall is in progress and 1 when the recall is done. The
EEPROM. If the device is being used in parasite power recall operation happens automatically at power-up, so
mode, within 10s (max) after this command is issued the valid data is available in the scratchpad as soon as power
master must enable a strong pullup on the 1-Wire bus for is applied to the device.
at least 10ms as described in the Powering the DS18B20 Read Power Supply [B4h]
section.
The master device issues this command followed by a
Recall E2 [B8h] read time slot to determine if any DS18B20s on the bus
This command recalls the alarm trigger values (TH and are using parasite power. During the read time slot, para-
TL) and configuration data from EEPROM and places the site powered DS18B20s will pull the bus low, and exter-
data in bytes 2, 3, and 4, respectively, in the scratchpad nally powered DS18B20s will let the bus remain high. See
memory. The master device can issue read time slots the Powering the DS18B20 section for usage information
for this command.

Table 3. DS18B20 Function Command Set

1-Wire BUS ACTIVITY AFTER


COMMAND DESCRIPTION PROTOCOL NOTES
COMMAND IS ISSUED

TEMPERATURE CONVERSION COMMANDS


DS18B20 transmits conversion status
Convert T Initiates temperature conversion. 44h to master (not applicable for parasite- 1
powered DS18B20s).
MEMORY COMMANDS
Read Reads the entire scratchpad including the DS18B20 transmits up to 9 data bytes
BEh 2
Scratchpad CRC byte. to master.
Write Writes data into scratchpad bytes 2, 3, and Master transmits 3 data bytes to
4Eh 3
Scratchpad 4 (TH, TL, and configuration registers). DS18B20.
Copy Copies TH, TL, and configuration register
48h None 1
Scratchpad data from the scratchpad to EEPROM.
Recalls TH, TL, and configuration register DS18B20 transmits recall status to
Recall E2 B8h
data from EEPROM to the scratchpad. master.
Read Power Signals DS18B20 power supply mode to DS18B20 transmits supply status to
B4h
Supply the master. master.
Note 1: For parasite-powered DS18B20s, the master must enable a strong pullup on the 1-Wire bus during temperature conver-
sions and copies from the scratchpad to EEPROM. No other bus activity may take place during this time.
Note 2: The master can interrupt the transmission of data at any time by issuing a reset.
Note 3: All three bytes must be written before a reset is issued.

www.maximintegrated.com Maxim Integrated 12


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

MASTER Tx RESET PULSE


INITIALIZATION
SEQUENCE
DS18B20 Tx PRESENCE PULSE

MASTER Tx ROM COMMAND

33h READ N 55h MATCH N F0h N ECh N CCh N


ROM ROM SEARCH ROM ALARM SEARCH SKIP ROM
COMMAND COMMAND COMMAND COMMAND COMMAND

Y Y Y Y Y

DS18B20 Tx BIT 0 DS18B20 Tx BIT 0


MASTER Tx
BIT 0 DS18B20 Tx BIT 0 DS18B20 Tx BIT 0
MASTER Tx BIT 0 MASTER TX BIT 0

N N N DEVICE(S) N
BIT 0 BIT 0
WITH ALARM
MATCH ? MATCH ?
FLAG SET ?

DS18B20 TX Y Y Y
FAMILY CODE 1
BYTE

DS18B20 Tx BIT 1
MASTER Tx
DS18B20 Tx BIT 1 DS18B20 Tx BIT 1
SERIAL NUMBER
MASTER Tx BIT 1
6 BYTES

DS18B20 Tx
BIT 1 N N BIT 1
CRC BYTE
MATCH? MATCH?

Y Y

DS18B20 Tx BIT 63
MASTER Tx
BIT 63 DS18B20 Tx BIT 63
MASTER Tx BIT 63

BIT 63 N N BIT 63
MATCH? MATCH?

Y Y

MASTER Tx FUNCTION
COMMAND (FIGURE 14)

Figure 13. ROM Commands Flowchart

www.maximintegrated.com Maxim Integrated 13


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

MASTER Tx 44h CONVERT N 48h COPY N


FUNCTION COMMAND TEMPERATURE ? SCRATCHPAD ?

Y Y

N PARASITE Y N PARASITE Y
POWER ? POWER ?

DS18B20 BEGINS
CONVERSION
MASTER ENABLES STRONG MASTER ENABLES STRONG
PULL-UP ON DQ PULL-UP ON DQ

DEVICE
N DS18B20 CONVERTS COPY IN N DATA COPIED FROM
CONVERTING
TEMPERATURE ?
TEMPERATURE PROGRESS ? SCRATCHPAD TO EEPROM

Y MASTER DISABLES Y MASTER DISABLES


STRONG PULLUP STRONG PULLUP
MASTER MASTER MASTER MASTER
Rx 0s Rx 1s Rx 0s Rx 1s

N B4h READ N B8h N BEh READ N 4Eh WRITE


POWER SUPPLY ? RECALL E2 ? SCRATCHPAD ? SCRATCHPAD ?

Y Y Y Y

MASTER BEGINS
N PARASITE Y DATA RECALL FROM MASTER Rx DATA
POWER ? E2 PROM BYTE FROM MASTER Tx TH BYTE TO
SCRATCHPAD SCRATCHPAD

MASTER MASTER
MASTER Tx TL BYTE TO
Rx 1s Rx 0s DEVICE BUSY N MASTER Tx Y
SCRATCHPAD
RECALLING RESET ?
DATA ?

N MASTER TX CONFIG. BYTE


Y
TO SCRATCHPAD
MASTER MASTER
Rx 0s Rx 1s N HAVE 8 BYTES
BEEN READ ?

MASTER Rx
SCRATCHPAD CRC
BYTE

RETURN TO INITIALIZATION
SEQUENCE (FIGURE 13)
FOR NEXT TRANSACTION

Figure 14. DS18B20 Function Commands Flowchart

www.maximintegrated.com Maxim Integrated 14


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

1-Wire Signaling Read/Write Time Slots


The DS18B20 uses a strict 1-Wire communication pro- The bus master writes data to the DS18B20 during write
tocol to ensure data integrity. Several signal types are time slots and reads data from the DS18B20 during read
defined by this protocol: reset pulse, presence pulse, write time slots. One bit of data is transmitted over the 1-Wire
0, write 1, read 0, and read 1. The bus master initiates all bus per time slot.
these signals, with the exception of the presence pulse.
Write Time Slots
Initialization ProcedureReset And There are two types of write time slots: Write 1 time slots
Presence Pulses and Write 0 time slots. The bus master uses a Write 1
All communication with the DS18B20 begins with an ini- time slot to write a logic 1 to the DS18B20 and a Write
tialization sequence that consists of a reset pulse from the 0 time slot to write a logic 0 to the DS18B20. All write
master followed by a presence pulse from the DS18B20. time slots must be a minimum of 60s in duration with a
This is illustrated in Figure 15. When the DS18B20 sends minimum of a 1s recovery time between individual write
the presence pulse in response to the reset, it is indicating slots. Both types of write time slots are initiated by the
to the master that it is on the bus and ready to operate. master pulling the 1-Wire bus low (see Figure 14).
During the initialization sequence the bus master trans- To generate a Write 1 time slot, after pulling the 1-Wire
mits (TX) the reset pulse by pulling the 1-Wire bus low bus low, the bus master must release the 1-Wire bus
for a minimum of 480s. The bus master then releases within 15s. When the bus is released, the 5k pullup
the bus and goes into receive mode (RX). When the bus resistor will pull the bus high. To generate a Write 0 time
is released, the 5k pullup resistor pulls the 1-Wire bus slot, after pulling the 1-Wire bus low, the bus master must
high. When the DS18B20 detects this rising edge, it waits continue to hold the bus low for the duration of the time
15s to 60s and then transmits a presence pulse by pull- slot (at least 60s).
ing the 1-Wire bus low for 60s to 240s. The DS18B20 samples the 1-Wire bus during a window
that lasts from 15s to 60s after the master initiates the
write time slot. If the bus is high during the sampling win-
dow, a 1 is written to the DS18B20. If the line is low, a 0
is written to the DS18B20.

MASTER Tx RESET PULSE MASTER Rx


480s MINIMUM 480s MINIMUM
DS18B20 DS18B20 TX PRESENCE
WAITS 15-60s PULSE 60-240S
VPU

1-Wire BUS

GND

LINE TYPE LEGEND


BUS MASTER PULLING LOW
DS18B20 PULLING LOW
RESISTOR PULLUP

Figure 15. Initialization Timing

www.maximintegrated.com Maxim Integrated 15


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

START START
OF SLOT OF SLOT
MASTER WRITE 0 SLOT
1s < TREC < MASTER WRITE 1 SLOT
60s < Tx 0 < 120s

1s
VPU

1-Wire BUS

GND
DS18B20 SAMPLES DS18B20 SAMPLES
MIN TYP MAX MIN TYP MAX

15s 15s 30s 15s 15s 30s

MASTER READ 0 SLOT MASTER READ 1 SLOT


1s < TREC <
VPU

1-Wire BUS

GND
MASTER SAMPLES > 1s
MASTER SAMPLES
> 1s
15s 45s 15s

LINE TYPE LEGEND


BUS MASTER PULLING LOW DS18B20 PULLING LOW RESISTOR PULLUP

Figure 16. Read/Write Time Slot Timing Diagram

Read Time Slots read time slot, the DS18B20 will begin transmitting a 1
The DS18B20 can only transmit data to the master when or 0 on bus. The DS18B20 transmits a 1 by leaving the
the master issues read time slots. Therefore, the master bus high and transmits a 0 by pulling the bus low. When
must generate read time slots immediately after issuing transmitting a 0, the DS18B20 will release the bus by the
a Read Scratchpad [BEh] or Read Power Supply [B4h] end of the time slot, and the bus will be pulled back to
command, so that the DS18B20 can provide the request- its high idle state by the pullup resister. Output data from
ed data. In addition, the master can generate read time the DS18B20 is valid for 15s after the falling edge that
slots after issuing Convert T [44h] or Recall E2 [B8h] com- initiated the read time slot. Therefore, the master must
mands to find out the status of the operation as explained release the bus and then sample the bus state within
in the DS18B20 Function Commands section. 15s from the start of the slot.

All read time slots must be a minimum of 60s in duration Figure 17 illustrates that the sum of TINIT, TRC, and
with a minimum of a 1s recovery time between slots. A TSAMPLE must be less than 15s for a read time slot.
read time slot is initiated by the master device pulling the Figure 18 shows that system timing margin is maximized
1-Wire bus low for a minimum of 1s and then releasing by keeping TINIT and TRC as short as possible and by
the bus (see Figure 16). After the master initiates the locating the master sample time during read time slots
towards the end of the 15s period.

www.maximintegrated.com Maxim Integrated 16


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

VPU
VIH OF MASTER
1-Wire BUS

GND
TINT > 1s TRC MASTER SAMPLES

15s

Figure 17. Detailed Master Read 1 Timing

VPU
VIH OF MASTER
1-Wire BUS

GND
TINT = TRC =
SMALL SMALL MASTER SAMPLES

15s

LINE TYPE LEGEND


BUS MASTER PULLING LOW
RESISTOR PULLUP

Figure 18. Recommended Master Read 1 Timing

Related Application Notes Application Note 162: Interfacing the DS18x20/DS1822


The following application notes can be 1-Wire Temperature Sensor in a Microcontroller
applied to the DS18B20 and are available at Environment
www.maximintegrated.com. Application Note 208: Curve Fitting the Error of a
Application Note 27: Understanding and Using Cyclic Bandgap-Based Digital Temperature Sensor
Redundancy Checks with Maxim iButton Products Application Note 2420: 1-Wire Communication with a
Application Note 122: Using Dallas 1-Wire ICs in 1-Cell Microchip PICmicro Microcontroller
Li-Ion Battery Packs with Low-Side N-Channel Safety Application Note 3754: Single-Wire Serial Bus Carries
FETs Master Isolated Power and Data
Application Note 126: 1-Wire Communication Through Sample 1-Wire subroutines that can be used in conjunc-
Software tion with Application Note 74: Reading and Writing iBut-
tons via Serial Interfaces can be downloaded from the
Maxim website.

www.maximintegrated.com Maxim Integrated 17


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

DS18B20 Operation Example 1 DS18B20 Operation Example 2


In this example there are multiple DS18B20s on the bus In this example there is only one DS18B20 on the bus and
and they are using parasite power. The bus master initi- it is using parasite power. The master writes to the TH, TL,
ates a temperature conversion in a specific DS18B20 and and configuration registers in the DS18B20 scratchpad
then reads its scratchpad and recalculates the CRC to and then reads the scratchpad and recalculates the CRC
verify the data. to verify the data. The master then copies the scratchpad
contents to EEPROM.
MASTER DATA
COMMENTS
MODE (LSB FIRST) MASTER DATA (LSB
COMMENTS
MODE FIRST)
Tx Reset Master issues reset pulse.
Tx Reset Master issues reset pulse.
DS18B20s respond with
Rx Presence
presence pulse. DS18B20 responds with
Rx Presence
presence pulse.
Master issues Match ROM
Tx 55h
command. Master issues Skip ROM
Tx CCh
command.
64-bit ROM Master sends DS18B20 ROM
Tx
code code. Master issues Write Scratchpad
Tx 4Eh
command.
Master issues Convert T
Tx 44h
command. Master sends three data bytes
Tx 3 data bytes to scratchpad (TH, TL, and
DQ line Master applies strong pullup
config).
Tx held high by to DQ for the duration of the
strong pullup conversion (tCONV). Tx Reset Master issues reset pulse.
Tx Reset Master issues reset pulse. DS18B20 responds with
Rx Presence
presence pulse.
DS18B20s respond with
Rx Presence
presence pulse. Master issues Skip ROM
Tx CCh
command.
Master issues Match ROM
Tx 55h
command. Master issues Read Scratchpad
Tx BEh
command.
64-bit ROM Master sends DS18B20 ROM
Tx
code code. Master reads entire scratchpad
Master issues Read Scratchpad including CRC. The master then
Tx BEh
command. recalculates the CRC of the
first eight data bytes from the
Master reads entire scratchpad Rx 9 data bytes scratchpad and compares the
including CRC. The master then calculated CRC with the read
recalculates the CRC of the CRC (byte 9). If they match,
first eight data bytes from the the master continues; if not, the
Rx 9 data bytes scratchpad and compares the read operation is repeated.
calculated CRC with the read
CRC (byte 9). If they match, Tx Reset Master issues reset pulse.
the master continues; if not, the DS18B20 responds with
read operation is repeated. Rx Presence
presence pulse.
Master issues Skip ROM
Tx CCh
command.
Master issues Copy Scratchpad
Tx 48h
command.
DQ line Master applies strong pullup to
Tx held high by DQ for at least 10ms while copy
strong pullup operation is in progress.

www.maximintegrated.com Maxim Integrated 18


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

Ordering Information
PART TEMP RANGE PIN-PACKAGE TOP MARK
DS18B20 -55C to +125C 3 TO-92 18B20
DS18B20+ -55C to +125C 3 TO-92 18B20
DS18B20/T&R -55C to +125C 3 TO-92 (2000 Piece) 18B20
DS18B20+T&R -55C to +125C 3 TO-92 (2000 Piece) 18B20
DS18B20-SL/T&R -55C to +125C 3 TO-92 (2000 Piece)* 18B20
DS18B20-SL+T&R -55C to +125C 3 TO-92 (2000 Piece)* 18B20
DS18B20U -55C to +125C 8 FSOP 18B20
DS18B20U+ -55C to +125C 8 FSOP 18B20
DS18B20U/T&R -55C to +125C 8 FSOP (3000 Piece) 18B20
DS18B20U+T&R -55C to +125C 8 FSOP (3000 Piece) 18B20
DS18B20Z -55C to +125C 8 SO DS18B20
DS18B20Z+ -55C to +125C 8 SO DS18B20
DS18B20Z/T&R -55C to +125C 8 SO (2500 Piece) DS18B20
DS18B20Z+T&R -55C to +125C 8 SO (2500 Piece) DS18B20
+Denotes a lead-free package. A + will appear on the top mark of lead-free packages.
T&R = Tape and reel.
*TO-92 packages in tape and reel can be ordered with straight or formed leads. Choose SL for straight leads. Bulk TO-92 orders
are straight leads only.

www.maximintegrated.com Maxim Integrated 19


DS18B20 Programmable Resolution
1-Wire Digital Thermometer

Revision History
REVISION PAGES
DESCRIPTION
DATE CHANGED
In the Absolute Maximum Ratings section, removed the reflow oven temperature value of +220C.
030107 19
Reference to JEDEC specification for reflow remains.
In the OperationAlarm Signaling section, added or equal to in the description for a TH alarm
5
condition
101207
In the Memory section, removed incorrect text describing memory. 7
In the Configuration Register section, removed incorrect text describing configuration register. 8
In the Ordering Information table, added TO-92 straight-lead packages and included a note that the
042208 2
TO-92 package in tape and reel can be ordered with either formed or straight leads.
1/15 Updated Benefits and Features section 1

For pricing, delivery, and ordering information, please contact Maxim Direct at 1-888-629-4642, or visit Maxim Integrateds website at www.maximintegrated.com.

Maxim Integrated cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim Integrated product. No circuit patent licenses
are implied. Maxim Integrated reserves the right to change the circuitry and specifications without notice at any time. The parametric values (min and max limits)
shown in the Electrical Characteristics table are guaranteed. Other parametric values quoted in this data sheet are provided for guidance.

Maxim Integrated and the Maxim Integrated logo are trademarks of Maxim Integrated Products, Inc. 2015 Maxim Integrated Products, Inc. 20
ANEXO 2 Hoja de datos sensor de luz

58
r TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
r
TAOS059N MARCH 2009

D Approximates Human Eye Response PACKAGE CS


6-LEAD CHIPSCALE
D Programmable Interrupt Function with (TOP VIEW)
User-Defined Upper and Lower Threshold
Settings
VDD 1 6 SDA
D 16-Bit Digital Output with SMBus (TSL2560)
at 100 kHz or I2C (TSL2561) Fast-Mode at ADDR SEL 2 5 INT
400 kHz
D Programmable Analog Gain and Integration GND 3 4 SCL
Time Supporting 1,000,000-to-1 Dynamic
Range
D Automatically Rejects 50/60-Hz Lighting PACKAGE T
6-LEAD TMB
Ripple
(TOP VIEW)
D Low Active Power (0.75 mW Typical) with
Power Down Mode VDD 1 6 SDA
D RoHS Compliant
ADDR SEL 2 5 INT

GND 3 4 SCL

Description PACKAGE FN
DUAL FLAT NO-LEAD
The TSL2560 and TSL2561 are light-to-digital (TOP VIEW)
converters that transform light intensity to a digital
signal output capable of direct I2C (TSL2561) or VDD 1 6 SDA
SMBus (TSL2560) interface. Each device com-
bines one broadband photodiode (visible plus ADDR SEL 2 5 INT
infrared) and one infrared-responding photodiode
GND 3 4 SCL
on a single CMOS integrated circuit capable of
providing a near-photopic response over an
effective 20-bit dynamic range (16-bit resolution).
PACKAGE CL
Two integrating ADCs convert the photodiode 6-LEAD ChipLED
currents to a digital output that represents the (TOP VIEW)
irradiance measured on each channel. This digital SDA 5 4 SCL
output can be input to a microprocessor where
illuminance (ambient light level) in lux is derived
using an empirical formula to approximate the INT 6 3 ADDR SEL
human eye response. The TSL2560 device
permits an SMB-Alert style interrupt, and the VDD 1 2 GND
TSL2561 device supports a traditional level style
interrupt that remains asserted until the firmware Package Drawings are Not to Scale

clears it.
While useful for general purpose light sensing applications, the TSL2560/61 devices are designed particularly
for display panels (LCD, OLED, etc.) with the purpose of extending battery life and providing optimum viewing
in diverse lighting conditions. Display panel backlighting, which can account for up to 30 to 40 percent of total
platform power, can be automatically managed. Both devices are also ideal for controlling keyboard illumination
based upon ambient lighting conditions. Illuminance information can further be used to manage exposure
control in digital cameras. The TSL2560/61 devices are ideal in notebook/tablet PCs, LCD monitors, flat-panel
televisions, cell phones, and digital cameras. In addition, other applications include street light control, security
lighting, sunlight harvesting, machine vision, and automotive instrumentation clusters.

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r
Texas Advanced Optoelectronic Solutions Inc.
1001 Klein Road S Suite 300 S Plano, TX 75074 S (972)
r 673-0759
www.taosinc.com 1
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

Functional Block Diagram

Channel 0
Visible and IR Integrating
A/D Converter

Channel 1
VDD = 2.7 V to 3.5 V IR Only

Command ADC
ADDR SEL Address Select Interrupt INT
Register Register

SCL
Two-Wire Serial Interface
SDA

Detailed Description
The TSL2560 and TSL2561 are second-generation ambient light sensor devices. Each contains two integrating
analog-to-digital converters (ADC) that integrate currents from two photodiodes. Integration of both channels
occurs simultaneously. Upon completion of the conversion cycle, the conversion result is transferred to the
Channel 0 and Channel 1 data registers, respectively. The transfers are double-buffered to ensure that the
integrity of the data is maintained. After the transfer, the device automatically begins the next integration cycle.
Communication to the device is accomplished through a standard, two-wire SMBus or I2C serial bus.
Consequently, the TSL256x device can be easily connected to a microcontroller or embedded controller. No
external circuitry is required for signal conditioning, thereby saving PCB real estate as well. Since the output
of the TSL256x device is digital, the output is effectively immune to noise when compared to an analog signal.
The TSL256x devices also support an interrupt feature that simplifies and improves system efficiency by
eliminating the need to poll a sensor for a light intensity value. The primary purpose of the interrupt function is
to detect a meaningful change in light intensity. The concept of a meaningful change can be defined by the user
both in terms of light intensity and time, or persistence, of that change in intensity. The TSL256x devices have
the ability to define a threshold above and below the current light level. An interrupt is generated when the value
of a conversion exceeds either of these limits.

Available Options
DEVICE INTERFACE PACKAGE LEADS PACKAGE DESIGNATOR ORDERING NUMBER
TSL2560 SMBus Chipscale CS TSL2560CS
TSL2560 SMBus TMB-6 T TSL2560T
TSL2560 SMBus Dual Flat No-Lead 6 FN TSL2560FN
TSL2560 SMBus ChipLED-6 CL TSL2560CL
TSL2561 I2C Chipscale CS TSL2561CS
TSL2561 I2C TMB-6 T TSL2561T
TSL2561 I2C Dual Flat No-Lead 6 FN TSL2561FN
TSL2561 I2C ChipLED-6 CL TSL2561CL

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
2 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

Terminal Functions
TERMINAL
CS, T, FN CL TYPE DESCRIPTION
NAME PKG PKG
NO. NO.
ADDR SEL 2 3 I SMBus device select three-state
GND 3 2 Power supply ground. All voltages are referenced to GND.
INT 5 6 O Level or SMB Alert interrupt open drain.
SCL 4 4 I SMBus serial clock input terminal clock signal for SMBus serial data.
SDA 6 5 I/O SMBus serial data I/O terminal serial data I/O for SMBus.
VDD 1 1 Supply voltage.

Absolute Maximum Ratings over operating free-air temperature range (unless otherwise noted)
Supply voltage, VDD (see Note 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 V
Digital output voltage range, VO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0.5 V to 3.8 V
Digital output current, IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 mA to 20 mA
Storage temperature range, Tstg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40C to 85C
ESD tolerance, human body model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2000 V
Stresses beyond those listed under absolute maximum ratings may cause permanent damage to the device. These are stress ratings only, and
functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not
implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability.
NOTE 1: All voltages are with respect to GND.

Recommended Operating Conditions


MIN NOM MAX UNIT
Supply voltage, VDD 2.7 3 3.6 V
Operating free-air temperature, TA 30 70 C
SCL, SDA input low voltage, VIL 0.5 0.8 V
SCL, SDA input high voltage, VIH 2.1 3.6 V

Electrical Characteristics over recommended operating free-air temperature range (unless


otherwise noted)
PARAMETER TEST CONDITIONS MIN TYP MAX UNIT
Active 0.24 0.6 mA
IDD Supply current
Power down 3.2 15 A
3 mA sink current 0 0.4 V
VOL INT SDA output low voltage
INT,
6 mA sink current 0 0.6 V
I LEAK Leakage current 5 5 A

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 3
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

Operating Characteristics, High Gain (16), VDD = 3 V, TA = 25C, (unless otherwise noted) (see
Notes 2, 3, 4, 5)
TSL2560T, FN, & CL
TSL2560CS, TSL2561CS
PARAMETER TEST CONDITIONS CHANNEL TSL2561T, FN & CL UNIT
MIN TYP MAX MIN TYP MAX
fosc Oscillator frequency 690 735 780 690 735 780 kHz
Ch0 0 4 0 4
Dark ADC count value Ee = 0
0, Tint = 402 ms counts
Ch1 0 4 0 4
Ch0 65535 65535
Tint > 178 ms
Ch1 65535 65535
Full scale ADC count Ch0 37177 37177
Tint = 101 ms counts
value (Note 6) Ch1 37177 37177
Ch0 5047 5047
Tint = 13.7
13 7 ms
Ch1 5047 5047
p = 640 nm, Tint = 101 ms Ch0 750 1000 1250
Ee = 36.3 W/cm2 Ch1 200
counts
p = 940 nm, Tint = 101 ms Ch0 700 1000 1300
Ee = 119 W/cm2 Ch1 820
ADC count value
p = 640 nm, Tint = 101 ms Ch0 750 1000 1250
Ee = 41 W/cm2 Ch1 190
counts
p = 940 nm, Tint = 101 ms Ch0 700 1000 1300
Ee = 135 W/cm2 Ch1 850
ADC countt value
l ratio:
ti p = 640 nm,
nm Tint = 101 ms 0 15
0.15 0 20
0.20 0.25
0 25 0.14
0 14 0 19
0.19 0.24
0 24
Ch1/Ch0 p = 940 nm,
nm Tint = 101 ms 0 69
0.69 0 82
0.82 0.95
0 95 0.70
0 70 0 85
0.85 1
Ch0 27.5 24.4
p = 640 nm,
nm Tint = 101 ms counts/
Ch1 5.5 4.6
Re Irradiance responsivity (W/
Ch0 8.4 7.4 cm2)
p = 940 nm,
nm Tint = 101 ms
Ch1 6.9 6.3
Fluorescent light source: Ch0 36 35
Tint = 402 ms Ch1 4 3.8 counts/
Rv Illuminance responsivity
Incandescent light source: Ch0 144 129 lux
Tint = 402 ms Ch1 72 67
Fluorescent light source:
0.11 0.11
ADC count value ratio: Tint = 402 ms
Ch1/Ch0 Incandescent light source:
05
0.5 0 52
0.52
Tint = 402 ms
Fluorescent light source: Ch0 2.3 2.2
Illuminance responsivity, Tint = 402 ms Ch1 0.25 0.24 counts/
Rv
low gain mode (Note 7) Incandescent light source: Ch0 9 8.1 lux
Tint = 402 ms Ch1 4.5 4.2
Fluorescent light source:
(Sensor Lux) / 0.65 1 1.35 0.65 1 1.35
Tint = 402 ms
(actual Lux),
Lux) high gain
mode (Note 8) Incandescent light source:
0.60 1 1.40 0.60 1 1.40
Tint = 402 ms

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
4 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

NOTES: 2. Optical measurements are made using small-angle incident radiation from light-emitting diode optical sources. Visible 640 nm LEDs
and infrared 940 nm LEDs are used for final product testing for compatibility with high-volume production.
3. The 640 nm irradiance Ee is supplied by an AlInGaP light-emitting diode with the following characteristics: peak wavelength
p = 640 nm and spectral halfwidth = 17 nm.
4. The 940 nm irradiance Ee is supplied by a GaAs light-emitting diode with the following characteristics: peak wavelength
p = 940 nm and spectral halfwidth = 40 nm.
5. Integration time Tint, is dependent on internal oscillator frequency (fosc) and on the integration field value in the timing register as
described in the Register Set section. For nominal fosc = 735 kHz, nominal Tint = (number of clock cycles)/fosc.
Field value 00: Tint = (11 918)/fosc = 13.7 ms
Field value 01: Tint = (81 918)/fosc = 101 ms
Field value 10: Tint = (322 918)/fosc = 402 ms
Scaling between integration times vary proportionally as follows: 11/322 = 0.034 (field value 00), 81/322 = 0.252 (field value 01),
and 322/322 = 1 (field value 10).
6. Full scale ADC count value is limited by the fact that there is a maximum of one count per two oscillator frequency periods and also
by a 2-count offset.
Full scale ADC count value = ((number of clock cycles)/2 2)
Field value 00: Full scale ADC count value = ((11 918)/2 2) = 5047
Field value 01: Full scale ADC count value = ((81 918)/2 2) = 37177
Field value 10: Full scale ADC count value = 65535, which is limited by 16 bit register. This full scale ADC count value is reached
for 131074 clock cycles, which occurs for Tint = 178 ms for nominal fosc = 735 kHz.
7. Low gain mode has 16 lower gain than high gain mode: (1/16 = 0.0625).
8. The sensor Lux is calculated using the empirical formula shown on p. 22 of this data sheet based on measured Ch0 and Ch1 ADC
count values for the light source specified. Actual Lux is obtained with a commercial luxmeter. The range of the (sensor Lux) / (actual
Lux) ratio is estimated based on the variation of the 640 nm and 940 nm optical parameters. Devices are not 100% tested with
fluorescent or incandescent light sources.

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 5
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

AC Electrical Characteristics, VDD = 3 V, TA = 25C (unless otherwise noted)


PARAMETER TEST CONDITIONS MIN TYP MAX UNIT
t(CONV) Conversion time 12 100 400 ms
Clock frequency (I2C only) 0 400 kHz
f(SCL)
Clock frequency (SMBus only) 10 100 kHz
t(BUF) Bus free time between start and stop condition 1.3 s
Hold time after (repeated) start condition. After
t(HDSTA) 0.6 s
this period, the first clock is generated.
t(SUSTA) Repeated start condition setup time 0.6 s
t(SUSTO) Stop condition setup time 0.6 s
t(HDDAT) Data hold time 0 0.9 s
t(SUDAT) Data setup time 100 ns
t(LOW) SCL clock low period 1.3 s
t(HIGH) SCL clock high period 0.6 s
t(TIMEOUT) Detect clock/data low timeout (SMBus only) 25 35 ms
tF Clock/data fall time 300 ns
tR Clock/data rise time 300 ns
Ci Input pin capacitance 10 pF
Specified by design and characterization; not production tested.

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
6 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

PARAMETER MEASUREMENT INFORMATION


t(LOW) t(R) t(F)

VIH
SCL
VIL

t(HDSTA) t(HIGH) t(SUSTA)

t(BUF) t(HDDAT) t(SUDAT) t(SUSTO)

VIH
SDA
VIL

P S S P
Stop Start Start Stop
Condition Condition t(LOWSEXT)
SCLACK SCLACK
t(LOWMEXT) t(LOWMEXT) t(LOWMEXT)

SCL

SDA

Figure 1. Timing Diagrams

1 9 1 9

SCL

SDA A6 A5 A4 A3 A2 A1 A0 R/W D7 D6 D5 D4 D3 D2 D1 D0

Start by ACK by ACK by Stop by


Master TSL256x TSL256x Master
Frame 1 SMBus Slave Address Byte Frame 2 Command Byte

Figure 2. Example Timing Diagram for SMBus Send Byte Format

1 9 1 9

SCL

SDA A6 A5 A4 A3 A2 A1 A0 R/W D7 D6 D5 D4 D3 D2 D1 D0

Start by ACK by NACK by Stop by


Master TSL256x Master Master
Frame 1 SMBus Slave Address Byte Frame 2 Data Byte From TSL256x

Figure 3. Example Timing Diagram for SMBus Receive Byte Format

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 7
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

TYPICAL CHARACTERISTICS

SPECTRAL RESPONSIVITY

0.8
Channel 0
Normalized Responsivity

Photodiode

0.6

0.4

0.2
Channel 1
Photodiode

0
300 400 500 600 700 800 900 1000 1100
Wavelength nm
Figure 4

NORMALIZED RESPONSIVITY NORMALIZED RESPONSIVITY


vs. vs.
ANGULAR DISPLACEMENT CS PACKAGE ANGULAR DISPLACEMENT T PACKAGE
1.0 1.0

0.8 0.8
Normalized Responsivity

Normalized Responsivity

Optical Axis
Optical Axis

0.6 0.6

0.4 0.4

0.2 0.2

0 0
90 60 30 0 30 60 90 90 60 30 0 30 60 90
 Angular Displacement  Angular Displacement

Figure 5 Figure 6

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
8 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

NORMALIZED RESPONSIVITY NORMALIZED RESPONSIVITY


vs. vs.
ANGULAR DISPLACEMENT FN PACKAGE ANGULAR DISPLACEMENT CL PACKAGE
1.0 1.0

0.8 0.8

Normalized Responsivity
Normalized Responsivity

Optical Axis
Optical Axis
0.6 0.6

0.4 0.4

0.2 0.2

0 0
90 60 30 0 30 60 90 90 60 30 0 30 60 90
 Angular Displacement  Angular Displacement

Figure 7 Figure 8

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 9
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

PRINCIPLES OF OPERATION

Analog-to-Digital Converter
The TSL256x contains two integrating analog-to-digital converters (ADC) that integrate the currents from the
channel 0 and channel 1 photodiodes. Integration of both channels occurs simultaneously, and upon completion
of the conversion cycle the conversion result is transferred to the channel 0 and channel 1 data registers,
respectively. The transfers are double buffered to ensure that invalid data is not read during the transfer. After
the transfer, the device automatically begins the next integration cycle.

Digital Interface
Interface and control of the TSL256x is accomplished through a two-wire serial interface to a set of registers
that provide access to device control functions and output data. The serial interface is compatible with System
Management Bus (SMBus) versions 1.1 and 2.0, and I2C bus Fast-Mode. The TSL256x offers three slave
addresses that are selectable via an external pin (ADDR SEL). The slave address options are shown in Table 1.

Table 1. Slave Address Selection


ADDR SEL TERMINAL LEVEL SLAVE ADDRESS SMB ALERT ADDRESS
GND 0101001 0001100
Float 0111001 0001100
VDD 1001001 0001100

NOTE: The Slave and SMB Alert Addresses are 7 bits. Please note the SMBus and I2C protocols on pages 9 through 12. A read/write bit should
be appended to the slave address by the master device to properly communicate with the TSL256X device.

SMBus and I2C Protocols


Each Send and Write protocol is, essentially, a series of bytes. A byte sent to the TSL256x with the most
significant bit (MSB) equal to 1 will be interpreted as a COMMAND byte. The lower four bits of the COMMAND
byte form the register select address (see Table 2), which is used to select the destination for the subsequent
byte(s) received. The TSL256x responds to any Receive Byte requests with the contents of the register
specified by the stored register select address.
The TSL256X implements the following protocols of the SMB 2.0 specification:
D Send Byte Protocol
D Receive Byte Protocol
D Write Byte Protocol
D Write Word Protocol
D Read Word Protocol
D Block Write Protocol
D Block Read Protocol

The TSL256X implements the following protocols of the Philips Semiconductor I2C specification:
D I2C Write Protocol
D I2C Read (Combined Format) Protocol

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
10 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

When an SMBus Block Write or Block Read is initiated (see description of COMMAND Register), the byte
following the COMMAND byte is ignored but is a requirement of the SMBus specification. This field contains
the byte count (i.e. the number of bytes to be transferred). The TSL2560 (SMBus) device ignores this field and
extracts this information by counting the actual number of bytes transferred before the Stop condition is
detected.
When an I2C Write or I2C Read (Combined Format) is initiated, the byte count is also ignored but follows the
SMBus protocol specification. Data bytes continue to be transferred from the TSL2561 (I2C) device to Master
until a NACK is sent by the Master.
The data formats supported by the TSL2560 and TSL2561 devices are:
D Master transmitter transmits to slave receiver (SMBus and I2C):
The transfer direction in this case is not changed.
D Master reads slave immediately after the first byte (SMBus only):
At the moment of the first acknowledgment (provided by the slave receiver) the master transmitter
becomes a master receiver and the slave receiver becomes a slave transmitter.
D Combined format (SMBus and I2C):
During a change of direction within a transfer, the master repeats both a START condition and the slave
address but with the R/W bit reversed. In this case, the master receiver terminates the transfer by
generating a NACK on the last byte of the transfer and a STOP condition.

For a complete description of SMBus protocols, please review the SMBus Specification at
http://www.smbus.org/specs. For a complete description of I2C protocols, please review the I2C Specification
at http://www.semiconductors.philips.com.

1 7 1 1 8 1 1
S Slave Address Wr A Data Byte A P

X X

A Acknowledge (this bit position may be 0 for an ACK or 1 for a NACK)

P Stop Condition

Rd Read (bit value of 1)

S Start Condition

Sr Repeated Start Condition

Wr Write (bit value of 0)

X Shown under a field indicates that that field is required to have a value of X

... Continuation of protocol

Master-to-Slave

Slave-to-Master

Figure 9. SMBus and I2C Packet Protocol Element Key

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 11
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

1 7 1 1 8 1 1
S Slave Address Wr A Data Byte A P

Figure 10. SMBus Send Byte Protocol

1 7 1 1 8 1 1
S Slave Address Rd A Data Byte A P
1

Figure 11. SMBus Receive Byte Protocol

1 7 1 1 8 1 8 1 1
S Slave Address Wr A Command Code A Data Byte A P

Figure 12. SMBus Write Byte Protocol

1 7 1 1 8 1 1 7 1 1 8 1 1
S Slave Address Wr A Command Code A S Slave Address Rd A Data Byte Low A P

Figure 13. SMBus Read Byte Protocol

1 7 1 1 8 1 8 1 8 1 1
S Slave Address Wr A Command Code A Data Byte Low A Data Byte High A P

Figure 14. SMBus Write Word Protocol

1 7 1 1 8 1 1 7 1 1 8 1
S Slave Address Wr A Command Code A S Slave Address Rd A Data Byte Low A ...
8 1 1
Data Byte High A P

Figure 15. SMBus Read Word Protocol

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
12 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

1 7 1 1 8 1 8 1 8 1
S Slave Address Wr A Command Code A Byte Count = N A Data Byte 1 A ...
8 1 8 1 1
Data Byte 2 A ... Data Byte N A P

Figure 16. SMBus Block Write or I2C Write Protocols


NOTE: The I2C write protocol does not use the Byte Count packet, and the Master will continue sending Data Bytes until the Master initiates a
Stop condition. See the Command Register on page 13 for additional information regarding the Block Read/Write protocol.

1 7 1 1 8 1 1 7 1 1 8 1
S Slave Address Wr A Command Code A Sr Slave Address Rd A Byte Count = N A ...
8 1 8 1 8 1 1
Data Byte 1 A Data Byte 2 A ... Data Byte N A P

Figure 17. SMBus Block Read or I2C Read (Combined Format) Protocols
NOTE: The I2C read protocol does not use the Byte Count packet, and the Master will continue receiving Data Bytes until the Master initiates
a Stop Condition. See the Command Register on page 13 for additional information regarding the Block Read/Write protocol.

Register Set
The TSL256x is controlled and monitored by sixteen registers (three are reserved) and a command register
accessed through the serial interface. These registers provide for a variety of control functions and can be read
to determine results of the ADC conversions. The register set is summarized in Table 2.

Table 2. Register Address


ADDRESS RESISTER NAME REGISTER FUNCTION
COMMAND Specifies register address
0h CONTROL Control of basic functions
1h TIMING Integration time/gain control
2h THRESHLOWLOW Low byte of low interrupt threshold
3h THRESHLOWHIGH High byte of low interrupt threshold
4h THRESHHIGHLOW Low byte of high interrupt threshold
5h THRESHHIGHHIGH High byte of high interrupt threshold
6h INTERRUPT Interrupt control
7h Reserved
8h CRC Factory test not a user register
9h Reserved
Ah ID Part number/ Rev ID
Bh Reserved
Ch DATA0LOW Low byte of ADC channel 0
Dh DATA0HIGH High byte of ADC channel 0
Eh DATA1LOW Low byte of ADC channel 1
Fh DATA1HIGH High byte of ADC channel 1

The mechanics of accessing a specific register depends on the specific SMB protocol used. Refer to the section
on SMBus protocols. In general, the COMMAND register is written first to specify the specific control/status
register for following read/write operations.

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 13
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

Command Register
The command register specifies the address of the target register for subsequent read and write operations.
The Send Byte protocol is used to configure the COMMAND register. The command register contains eight bits
as described in Table 3. The command register defaults to 00h at power on.

Table 3. Command Register

7 6 5 4 3 2 1 0

CMD CLEAR WORD BLOCK ADDRESS COMMAND

Reset Value: 0 0 0 0 0 0 0 0

FIELD BIT DESCRIPTION


CMD 7 Select command register. Must write as 1.
CLEAR 6 Interrupt clear. Clears any pending interrupt. This bit is a write-one-to-clear bit. It is self clearing.
SMB Write/Read Word Protocol. 1 indicates that this SMB transaction is using either the SMB Write Word or
WORD 5 Read Word protocol.
Block Write/Read Protocol. 1 indicates that this transaction is using either the Block Write or the Block Read
BLOCK 4 protocol. See Note below.
Register Address. This field selects the specific control or status register for following write and read
ADDRESS 3:0 commands according to Table 2.

NOTE: An I2C block transaction will continue until the Master sends a stop condition. See Figure 16 and Figure 17. Unlike the I2C protocol, the
SMBus read/write protocol requires a Byte Count. All four ADC Channel Data Registers (Ch through Fh) can be read simultaneously in
a single SMBus transaction. This is the only 32-bit data block supported by the TSL2560 SMBus protocol. The BLOCK bit must be set
to 1, and a read condition should be initiated with a COMMAND CODE of 9Bh. By using a COMMAND CODE of 9Bh during an SMBus
Block Read Protocol, the TSL2560 device will automatically insert the appropriate Byte Count (Byte Count = 4) as illustrated in Figure 17.
A write condition should not be used in conjunction with the Bh register.

Control Register (0h)


The CONTROL register contains two bits and is primarily used to power the TSL256x device up and down as
shown in Table 4.

Table 4. Control Register

7 6 5 4 3 2 1 0

0h Resv Resv Resv Resv Resv Resv POWER CONTROL

Reset Value: 0 0 0 0 0 0 0 0

FIELD BIT DESCRIPTION


Resv 7:2 Reserved. Write as 0.
Power up/power down. By writing a 03h to this register, the device is powered up. By writing a 00h to this
register, the device is powered down.
POWER 1:0
NOTE: If a value of 03h is written, the value returned during a read cycle will be 03h. This feature can be
used to verify that the device is communicating properly.

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
14 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

Timing Register (1h)


The TIMING register controls both the integration time and the gain of the ADC channels. A common set of
control bits is provided that controls both ADC channels. The TIMING register defaults to 02h at power on.

Table 5. Timing Register

7 6 5 4 3 2 1 0

1h Resv Resv Resv GAIN Manual Resv INTEG TIMING

Reset Value: 0 0 0 0 0 0 1 0

FIELD BIT DESCRIPTION


Resv 75 Reserved. Write as 0.
Switches gain between low gain and high gain modes. Writing a 0 selects low gain (1); writing a 1 selects
GAIN 4 high gain (16).
Manual timing control. Writing a 1 begins an integration cycle. Writing a 0 stops an integration cycle.
Manual 3
NOTE: This field only has meaning when INTEG = 11. It is ignored at all other times.
Resv 2 Reserved. Write as 0.
INTEG 1:0 Integrate time. This field selects the integration time for each conversion.

Integration time is dependent on the INTEG FIELD VALUE and the internal clock frequency. Nominal integration
times and respective scaling between integration times scale proportionally as shown in Table 6. See Note 5
and Note 6 on page 5 for detailed information regarding how the scale values were obtained; see page 22 for
further information on how to calculate lux.

Table 6. Integration Time


INTEG FIELD VALUE SCALE NOMINAL INTEGRATION TIME
00 0.034 13.7 ms
01 0.252 101 ms
10 1 402 ms
11 N/A

The manual timing control feature is used to manually start and stop the integration time period. If a particular
integration time period is required that is not listed in Table 6, then this feature can be used. For example, the
manual timing control can be used to synchronize the TSL256x device with an external light source (e.g. LED).
A start command to begin integration can be initiated by writing a 1 to this bit field. Correspondingly, the
integration can be stopped by simply writing a 0 to the same bit field.

Interrupt Threshold Register (2h 5h)


The interrupt threshold registers store the values to be used as the high and low trigger points for the comparison
function for interrupt generation. If the value generated by channel 0 crosses below or is equal to the low
threshold specified, an interrupt is asserted on the interrupt pin. If the value generated by channel 0 crosses
above the high threshold specified, an interrupt is asserted on the interrupt pin. Registers THRESHLOWLOW
and THRESHLOWHIGH provide the low byte and high byte, respectively, of the lower interrupt threshold.
Registers THRESHHIGHLOW and THRESHHIGHHIGH provide the low and high bytes, respectively, of the
upper interrupt threshold. The high and low bytes from each set of registers are combined to form a 16-bit
threshold value. The interrupt threshold registers default to 00h on power up.

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 15
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

Table 7. Interrupt Threshold Register


REGISTER ADDRESS BITS DESCRIPTION
THRESHLOWLOW 2h 7:0 ADC channel 0 lower byte of the low threshold
THRESHLOWHIGH 3h 7:0 ADC channel 0 upper byte of the low threshold
THRESHHIGHLOW 4h 7:0 ADC channel 0 lower byte of the high threshold
THRESHHIGHHIGH 5h 7:0 ADC channel 0 upper byte of the high threshold

NOTE: Since two 8-bit values are combined for a single 16-bit value for each of the high and low interrupt thresholds, the Send Byte protocol should
not be used to write to these registers. Any values transferred by the Send Byte protocol with the MSB set would be interpreted as the
COMMAND field and stored as an address for subsequent read/write operations and not as the interrupt threshold information as desired.
The Write Word protocol should be used to write byte-paired registers. For example, the THRESHLOWLOW and THRESHLOWHIGH
registers (as well as the THRESHHIGHLOW and THRESHHIGHHIGH registers) can be written together to set the 16-bit ADC value in
a single transaction.

Interrupt Control Register (6h)


The INTERRUPT register controls the extensive interrupt capabilities of the TSL256x. The TSL256x permits
both SMB-Alert style interrupts as well as traditional level-style interrupts. The interrupt persist bit field
(PERSIST) provides control over when interrupts occur. A value of 0 causes an interrupt to occur after every
integration cycle regardless of the threshold settings. A value of 1 results in an interrupt after one integration
time period outside the threshold window. A value of N (where N is 2 through15) results in an interrupt only if
the value remains outside the threshold window for N consecutive integration cycles. For example, if N is equal
to 10 and the integration time is 402 ms, then the total time is approximately 4 seconds.
When a level Interrupt is selected, an interrupt is generated whenever the last conversion results in a value
outside of the programmed threshold window. The interrupt is active-low and remains asserted until cleared by
writing the COMMAND register with the CLEAR bit set.
In SMBAlert mode, the interrupt is similar to the traditional level style and the interrupt line is asserted low. To
clear the interrupt, the host responds to the SMBAlert by performing a modified Receive Byte operation, in which
the Alert Response Address (ARA) is placed in the slave address field, and the TSL256x that generated the
interrupt responds by returning its own address in the seven most significant bits of the receive data byte. If more
than one device connected on the bus has pulled the SMBAlert line low, the highest priority (lowest address)
device will win communication rights via standard arbitration during the slave address transfer. If the device
loses this arbitration, the interrupt will not be cleared. The Alert Response Address is 0Ch.
When INTR = 11, the interrupt is generated immediately following the SMBus write operation. Operation then
behaves in an SMBAlert mode, and the software set interrupt may be cleared by an SMBAlert cycle.

NOTE: Interrupts are based on the value of Channel 0 only.

Table 8. Interrupt Control Register

7 6 5 4 3 2 1 0

6h Resv Resv INTR PERSIST INTERRUPT

Reset Value: 0 0 0 0 0 0 0 0

FIELD BITS DESCRIPTION


Resv 7:6 Reserved. Write as 0.
INTR 5:4 INTR Control Select. This field determines mode of interrupt logic according to Table 9, below.
PERSIST 3:0 Interrupt persistence. Controls rate of interrupts to the host processor as shown in Table 10, below.

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
16 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

Table 9. Interrupt Control Select


INTR FIELD VALUE READ VALUE
00 Interrupt output disabled
01 Level Interrupt
10 SMBAlert compliant
11 Test Mode: Sets interrupt and functions as mode 10

NOTE: Field value of 11 may be used to test interrupt connectivity in a system or to assist in debugging interrupt service routine software.

Table 10. Interrupt Persistence Select


PERSIST FIELD VALUE INTERRUPT PERSIST FUNCTION
0000 Every ADC cycle generates interrupt
0001 Any value outside of threshold range
0010 2 integration time periods out of range
0011 3 integration time periods out of range
0100 4 integration time periods out of range
0101 5 integration time periods out of range
0110 6 integration time periods out of range
0111 7 integration time periods out of range
1000 8 integration time periods out of range
1001 9 integration time periods out of range
1010 10 integration time periods out of range
1011 11 integration time periods out of range
1100 12 integration time periods out of range
1101 13 integration time periods out of range
1110 14 integration time periods out of range
1111 15 integration time periods out of range

ID Register (Ah)
The ID register provides the value for both the part number and silicon revision number for that part number.
It is a read-only register, whose value never changes.

Table 11. ID Register

7 6 5 4 3 2 1 0

Ah PARTNO REVNO ID

Reset Value:

FIELD BITS DESCRIPTION


PARTNO 7:4 Part Number Identification: field value 0000 = TSL2560, field value 0001 = TSL2561
REVNO 3:0 Revision number identification

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 17
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

ADC Channel Data Registers (Ch Fh)


The ADC channel data are expressed as 16-bit values spread across two registers. The ADC channel 0 data
registers, DATA0LOW and DATA0HIGH provide the lower and upper bytes, respectively, of the ADC value of
channel 0. Registers DATA1LOW and DATA1HIGH provide the lower and upper bytes, respectively, of the ADC
value of channel 1. All channel data registers are read-only and default to 00h on power up.

Table 12. ADC Channel Data Registers


REGISTER ADDRESS BITS DESCRIPTION
DATA0LOW Ch 7:0 ADC channel 0 lower byte
DATA0HIGH Dh 7:0 ADC channel 0 upper byte
DATA1LOW Eh 7:0 ADC channel 1 lower byte
DATA1HIGH Fh 7:0 ADC channel 1 upper byte

The upper byte data registers can only be read following a read to the corresponding lower byte register. When
the lower byte register is read, the upper eight bits are strobed into a shadow register, which is read by a
subsequent read to the upper byte. The upper register will read the correct value even if additional ADC
integration cycles end between the reading of the lower and upper registers.
NOTE: The Read Word protocol can be used to read byte-paired registers. For example, the DATA0LOW and DATA0HIGH registers (as well as
the DATA1LOW and DATA1HIGH registers) may be read together to obtain the 16-bit ADC value in a single transaction

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
18 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

APPLICATION INFORMATION: SOFTWARE

Basic Operation
After applying VDD, the device will initially be in the power-down state. To operate the device, issue a command
to access the CONTROL register followed by the data value 03h to power up the device. At this point, both ADC
channels will begin a conversion at the default integration time of 400 ms. After 400 ms, the conversion results
will be available in the DATA0 and DATA1 registers. Use the following pseudo code to read the data registers:

// Read ADC Channels Using Read Word Protocol RECOMMENDED


Address = 0x39 //Slave addr also 0x29 or 0x49

//Address the Ch0 lower data register and configure for Read Word
Command = 0xAC //Set Command bit and Word bit

//Reads two bytes from sequential registers 0x0C and 0x0D


//Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
Channel0 = 256 * DataHigh + DataLow

//Address the Ch1 lower data register and configure for Read Word
Command = 0xAE //Set bit fields 7 and 5

//Reads two bytes from sequential registers 0x0E and 0x0F


//Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
Channel1 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte

// Read ADC Channels Using Read Byte Protocol


Address = 0x39 //Slave addr also 0x29 or 0x49
Command = 0x8C //Address the Ch0 lower data register
ReadByte (Address, Command, DataLow) //Result returned in DataLow
Command = 0x8D //Address the Ch0 upper data register
ReadByte (Address, Command, DataHigh) //Result returned in DataHigh
Channel0 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte

Command = 0x8E //Address the Ch1 lower data register


ReadByte (Address, Command, DataLow) //Result returned in DataLow
Command = 0x8F //Address the Ch1 upper data register
ReadByte (Address, Command, DataHigh) //Result returned in DataHigh
Channel1 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 19
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

APPLICATION INFORMATION: SOFTWARE

Configuring the Timing Register


The command, timing, and control registers are initialized to default values on power up. Setting these registers
to the desired values would be part of a normal initialization or setup procedure. In addition, to maximize the
performance of the device under various conditions, the integration time and gain may be changed often during
operation. The following pseudo code illustrates a procedure for setting up the timing register for various
options:

// Set up Timing Register


//Low Gain (1x), integration time of 402ms (default value)
Address = 0x39
Command = 0x81
Data = 0x02
WriteByte(Address, Command, Data)

//Low Gain (1x), integration time of 101ms


Data = 0x01
WriteByte(Address, Command, Data)

//Low Gain (1x), integration time of 13.7ms


Data = 0x00
WriteByte(Address, Command, Data)

//High Gain (16x), integration time of 101ms


Data = 0x11
WriteByte(Address, Command, Data)

//Read data registers (see Basic Operation example)

//Perform Manual Integration


//Set up for manual integration with Gain of 1x
Data = 0x03
//Set manual integration mode device stops converting
WriteByte(Address, Command, Data)

//Begin integration period


Data = 0x0B
WriteByte(Address, Command, Data)

//Integrate for 50ms


Sleep (50) //Wait for 50ms

//Stop integrating
Data = 0x03
WriteByte(Address, Command, Data)

//Read data registers (see Basic Operation example)

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
20 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

APPLICATION INFORMATION: SOFTWARE

Interrupts
The interrupt feature of the TSL256x device simplifies and improves system efficiency by eliminating the need
to poll the sensor for a light intensity value. Interrupt styles are determined by the INTR field in the Interrupt
Register. The interrupt feature may be disabled by writing a field value of 00h to the Interrupt Control Register
so that polling can be performed.
The versatility of the interrupt feature provides many options for interrupt configuration and usage. The primary
purpose of the interrupt function is to provide a meaningful change in light intensity. However, it also be used
as an end-of-conversion signal. The concept of a meaningful change can be defined by the user both in terms
of light intensity and time, or persistence, of that change in intensity. The TSL256x device implements two
16-bit-wide interrupt threshold registers that allow the user to define a threshold above and below the current
light level. An interrupt will then be generated when the value of a conversion exceeds either of these limits. For
simplicity of programming, the threshold comparison is accomplished only with Channel 0. This simplifies
calculation of thresholds that are based, for example, on a percent of the current light level. It is adequate to
use only one channel when calculating light intensity differences since, for a given light source, the channel 0
and channel 1 values are linearly proportional to each other and thus both values scale linearly with light
intensity.
To further control when an interrupt occurs, the TSL256x device provides an interrupt persistence feature. This
feature allows the user to specify a number of conversion cycles for which a light intensity exceeding either
interrupt threshold must persist before actually generating an interrupt. This can be used to prevent transient
changes in light intensity from generating an unwanted interrupt. With a value of 1, an interrupt occurs
immediately whenever either threshold is exceeded. With values of N, where N can range from 2 to 15, N
consecutive conversions must result in values outside the interrupt window for an interrupt to be generated. For
example, if N is equal to 10 and the integration time is 402 ms, then an interrupt will not be generated unless
the light level persists for more than 4 seconds outside the threshold.
Two different interrupt styles are available: Level and SMBus Alert. The difference between these two interrupt
styles is how they are cleared. Both result in the interrupt line going active low and remaining low until the
interrupt is cleared. A level style interrupt is cleared by setting the CLEAR bit (bit 6) in the COMMAND register.
The SMBus Alert style interrupt is cleared by an Alert Response as described in the Interrupt Control Register
section and SMBus specification.
To configure the interrupt as an end-of-conversion signal, the interrupt PERSIST field is set to 0. Either Level
or SMBus Alert style can be used. An interrupt will be generated upon completion of each conversion. The
interrupt threshold registers are ignored. The following example illustrates the configuration of a level interrupt:

// Set up endofconversion interrupt, Level style


Address = 0x39 //Slave addr also 0x29 or 0x49
Command = 0x86 //Address Interrupt Register
Data = 0x10 //Level style, every ADC cycle
WriteByte(Address, Command, Data)

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 21
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

APPLICATION INFORMATION: SOFTWARE

The following example pseudo code illustrates the configuration of an SMB Alert style interrupt when the light
intensity changes 20% from the current value, and persists for 3 conversion cycles:

// Read current light level


Address = 0x39 //Slave addr also 0x29 or 0x49
Command = 0xAC //Set Command bit and Word bit
ReadWord (Address, Command, DataLow, DataHigh)
Channel0 = (256 * DataHigh) + DataLow

//Calculate upper and lower thresholds


T_Upper = Channel0 + (0.2 * Channel0)
T_Lower = Channel0 (0.2 * Channel0)

//Write the lower threshold register


Command = 0xA2 //Addr lower threshold reg, set Word Bit
WriteWord (Address, Command, T_Lower.LoByte, T_Lower.HiByte)

//Write the upper threshold register


Command = 0xA4 //Addr upper threshold reg, set Word bit
WriteWord (Address, Command, T_Upper.LoByte, T_Upper.HiByte)

//Enable interrupt
Command = 0x86 //Address interrupt register
Data = 0x23 //SMBAlert style, PERSIST = 3
WriteByte(Address, Command, Data)

In order to generate an interrupt on demand during system test or debug, a test mode (INTR = 11) can be used.
The following example illustrates how to generate an interrupt on demand:

// Generate an interrupt
Address = 0x39 //Slave addr also 0x29 or 0x49
Command = 0x86 //Address Interrupt register
Data = 0x30 //Test interrupt
WriteByte(Address, Command, Data)

//Interrupt line should now be low

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
22 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

APPLICATION INFORMATION: SOFTWARE

Calculating Lux
The TSL256x is intended for use in ambient light detection applications such as display backlight control, where
adjustments are made to display brightness or contrast based on the brightness of the ambient light, as
perceived by the human eye. Conventional silicon detectors respond strongly to infrared light, which the human
eye does not see. This can lead to significant error when the infrared content of the ambient light is high, such
as with incandescent lighting, due to the difference between the silicon detector response and the brightness
perceived by the human eye.
This problem is overcome in the TSL256x through the use of two photodiodes. One of the photodiodes
(channel 0) is sensitive to both visible and infrared light, while the second photodiode (channel 1) is sensitive
primarily to infrared light. An integrating ADC converts the photodiode currents to digital outputs. Channel 1
digital output is used to compensate for the effect of the infrared component of light on the channel 0 digital
output. The ADC digital outputs from the two channels are used in a formula to obtain a value that approximates
the human eye response in the commonly used Illuminance unit of Lux:
CS Package
For 0 < CH1/CH0  0.52 Lux = 0.0315  CH0 0.0593  CH0  ((CH1/CH0)1.4)
For 0.52 < CH1/CH0  0.65 Lux = 0.0229  CH0 0.0291  CH1
For 0.65 < CH1/CH0  0.80 Lux = 0.0157  CH0 0.0180  CH1
For 0.80 < CH1/CH0  1.30 Lux = 0.00338  CH0 0.00260  CH1
For CH1/CH0 > 1.30 Lux = 0

T, FN, and CL Package


For 0 < CH1/CH0  0.50 Lux = 0.0304  CH0 0.062  CH0  ((CH1/CH0)1.4)
For 0.50 < CH1/CH0  0.61 Lux = 0.0224  CH0 0.031  CH1
For 0.61 < CH1/CH0  0.80 Lux = 0.0128  CH0 0.0153  CH1
For 0.80 < CH1/CH0  1.30 Lux = 0.00146  CH0 0.00112  CH1
For CH1/CH0 > 1.30 Lux = 0

The formulas shown above were obtained by optical testing with fluorescent and incandescent light sources,
and apply only to open-air applications. Optical apertures (e.g. light pipes) will affect the incident light on the
device.

Simplified Lux Calculation


Below is the argument and return value including source code (shown on following page) for calculating lux.
The source code is intended for embedded and/or microcontroller applications. Two individual code sets are
provided, one for the T, FN, and CL packages, and one for the CS package. All floating point arithmetic
operations have been eliminated since embedded controllers and microcontrollers generally do not support
these types of operations. Since floating point has been removed, scaling must be performed prior to calculating
illuminance if the integration time is not 402 ms and/or if the gain is not 16 as denoted in the source code on
the following pages. This sequence scales first to mitigate rounding errors induced by decimal math.

extern unsigned int CalculateLux(unsigned int iGain, unsigned int tInt, unsigned int
ch0, unsigned int ch1, int iType)

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 23
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

//****************************************************************************
//
// Copyright E 20042005 TAOS, Inc.
//
// THIS CODE AND INFORMATION IS PROVIDED AS IS WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Module Name:
// lux.cpp
//
//****************************************************************************

#define LUX_SCALE 14 // scale by 2^14


#define RATIO_SCALE 9 // scale ratio by 2^9

//
// Integration time scaling factors
//

#define CH_SCALE 10 // scale channel values by 2^10


#define CHSCALE_TINT0 0x7517 // 322/11 * 2^CH_SCALE
#define CHSCALE_TINT1 0x0fe7 // 322/81 * 2^CH_SCALE

//
// T, FN, and CL Package coefficients
//
// For Ch1/Ch0=0.00 to 0.50
// Lux/Ch0=0.03040.062*((Ch1/Ch0)^1.4)
// piecewise approximation
// For Ch1/Ch0=0.00 to 0.125:
// Lux/Ch0=0.03040.0272*(Ch1/Ch0)
//
// For Ch1/Ch0=0.125 to 0.250:
// Lux/Ch0=0.03250.0440*(Ch1/Ch0)
//
// For Ch1/Ch0=0.250 to 0.375:
// Lux/Ch0=0.03510.0544*(Ch1/Ch0)
//
// For Ch1/Ch0=0.375 to 0.50:
// Lux/Ch0=0.03810.0624*(Ch1/Ch0)
//
// For Ch1/Ch0=0.50 to 0.61:
// Lux/Ch0=0.02240.031*(Ch1/Ch0)
//
// For Ch1/Ch0=0.61 to 0.80:
// Lux/Ch0=0.01280.0153*(Ch1/Ch0)
//
// For Ch1/Ch0=0.80 to 1.30:
// Lux/Ch0=0.001460.00112*(Ch1/Ch0)
//
// For Ch1/Ch0>1.3:
// Lux/Ch0=0
//
#define K1T 0x0040 // 0.125 * 2^RATIO_SCALE
#define B1T 0x01f2 // 0.0304 * 2^LUX_SCALE
#define M1T 0x01be // 0.0272 * 2^LUX_SCALE

#define K2T 0x0080 // 0.250 * 2^RATIO_SCALE

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
24 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

#define B2T 0x0214 // 0.0325 * 2^LUX_SCALE


#define M2T 0x02d1 // 0.0440 * 2^LUX_SCALE

#define K3T 0x00c0 // 0.375 * 2^RATIO_SCALE


#define B3T 0x023f // 0.0351 * 2^LUX_SCALE
#define M3T 0x037b // 0.0544 * 2^LUX_SCALE

#define K4T 0x0100 // 0.50 * 2^RATIO_SCALE


#define B4T 0x0270 // 0.0381 * 2^LUX_SCALE
#define M4T 0x03fe // 0.0624 * 2^LUX_SCALE
#define K5T 0x0138 // 0.61 * 2^RATIO_SCALE
#define B5T 0x016f // 0.0224 * 2^LUX_SCALE
#define M5T 0x01fc // 0.0310 * 2^LUX_SCALE

#define K6T 0x019a // 0.80 * 2^RATIO_SCALE


#define B6T 0x00d2 // 0.0128 * 2^LUX_SCALE
#define M6T 0x00fb // 0.0153 * 2^LUX_SCALE

#define K7T 0x029a // 1.3 * 2^RATIO_SCALE


#define B7T 0x0018 // 0.00146 * 2^LUX_SCALE
#define M7T 0x0012 // 0.00112 * 2^LUX_SCALE

#define K8T 0x029a // 1.3 * 2^RATIO_SCALE


#define B8T 0x0000 // 0.000 * 2^LUX_SCALE
#define M8T 0x0000 // 0.000 * 2^LUX_SCALE

//
// CS package coefficients
//
// For 0 <= Ch1/Ch0 <= 0.52
// Lux/Ch0 = 0.03150.0593*((Ch1/Ch0)^1.4)
// piecewise approximation
// For 0 <= Ch1/Ch0 <= 0.13
// Lux/Ch0 = 0.03150.0262*(Ch1/Ch0)
// For 0.13 <= Ch1/Ch0 <= 0.26
// Lux/Ch0 = 0.03370.0430*(Ch1/Ch0)
// For 0.26 <= Ch1/Ch0 <= 0.39
// Lux/Ch0 = 0.03630.0529*(Ch1/Ch0)
// For 0.39 <= Ch1/Ch0 <= 0.52
// Lux/Ch0 = 0.03920.0605*(Ch1/Ch0)
// For 0.52 < Ch1/Ch0 <= 0.65
// Lux/Ch0 = 0.02290.0291*(Ch1/Ch0)
// For 0.65 < Ch1/Ch0 <= 0.80
// Lux/Ch0 = 0.001570.00180*(Ch1/Ch0)
// For 0.80 < Ch1/Ch0 <= 1.30
// Lux/Ch0 = 0.003380.00260*(Ch1/Ch0)
// For Ch1/Ch0 > 1.30
// Lux = 0
//
#define K1C 0x0043 // 0.130 * 2^RATIO_SCALE
#define B1C 0x0204 // 0.0315 * 2^LUX_SCALE
#define M1C 0x01ad // 0.0262 * 2^LUX_SCALE

#define K2C 0x0085 // 0.260 * 2^RATIO_SCALE


#define B2C 0x0228 // 0.0337 * 2^LUX_SCALE
#define M2C 0x02c1 // 0.0430 * 2^LUX_SCALE

#define K3C 0x00c8 // 0.390 * 2^RATIO_SCALE


#define B3C 0x0253 // 0.0363 * 2^LUX_SCALE
#define M3C 0x0363 // 0.0529 * 2^LUX_SCALE

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 25
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

#define K4C 0x010a // 0.520 * 2^RATIO_SCALE


#define B4C 0x0282 // 0.0392 * 2^LUX_SCALE
#define M4C 0x03df // 0.0605 * 2^LUX_SCALE

#define K5C 0x014d // 0.65 * 2^RATIO_SCALE


#define B5C 0x0177 // 0.0229 * 2^LUX_SCALE
#define M5C 0x01dd // 0.0291 * 2^LUX_SCALE

#define K6C 0x019a // 0.80 * 2^RATIO_SCALE


#define B6C 0x0101 // 0.0157 * 2^LUX_SCALE
#define M6C 0x0127 // 0.0180 * 2^LUX_SCALE

#define K7C 0x029a // 1.3 * 2^RATIO_SCALE


#define B7C 0x0037 // 0.00338 * 2^LUX_SCALE
#define M7C 0x002b // 0.00260 * 2^LUX_SCALE

#define K8C 0x029a // 1.3 * 2^RATIO_SCALE


#define B8C 0x0000 // 0.000 * 2^LUX_SCALE
#define M8C 0x0000 // 0.000 * 2^LUX_SCALE

// lux equation approximation without floating point calculations


//////////////////////////////////////////////////////////////////////////////
// Routine: unsigned int CalculateLux(unsigned int ch0, unsigned int ch0, int iType)
//
// Description: Calculate the approximate illuminance (lux) given the raw
// channel values of the TSL2560. The equation if implemented
// as a piecewise linear approximation.
//
// Arguments: unsigned int iGain gain, where 0:1X, 1:16X
// unsigned int tInt integration time, where 0:13.7mS, 1:100mS, 2:402mS,
// 3:Manual
// unsigned int ch0 raw channel value from channel 0 of TSL2560
// unsigned int ch1 raw channel value from channel 1 of TSL2560
// unsigned int iType package type (T or CS)
//
// Return: unsigned int the approximate illuminance (lux)
//
//////////////////////////////////////////////////////////////////////////////
unsigned int CalculateLux(unsigned int iGain, unsigned int tInt, unsigned int ch0,
unsigned int ch1, int iType)
{

//
// first, scale the channel values depending on the gain and integration time
// 16X, 402mS is nominal.
// scale if integration time is NOT 402 msec
unsigned long chScale;
unsigned long channel1;
unsigned long channel0;
switch (tInt)
{
case 0: // 13.7 msec
chScale = CHSCALE_TINT0;
break;
case 1: // 101 msec
chScale = CHSCALE_TINT1;
break;
default: // assume no scaling
chScale = (1 << CH_SCALE);

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
26 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

break;
}

// scale if gain is NOT 16X


if (!iGain) chScale = chScale << 4; // scale 1X to 16X

// scale the channel values


channel0 = (ch0 * chScale) >> CH_SCALE;
channel1 = (ch1 * chScale) >> CH_SCALE;
//

// find the ratio of the channel values (Channel1/Channel0)


// protect against divide by zero
unsigned long ratio1 = 0;
if (channel0 != 0) ratio1 = (channel1 << (RATIO_SCALE+1)) / channel0;

// round the ratio value


unsigned long ratio = (ratio1 + 1) >> 1;

// is ratio <= eachBreak ?


unsigned int b, m;
switch (iType)
{

case 0: // T, FN and CL package


if ((ratio >= 0) && (ratio <= K1T))
{b=B1T; m=M1T;}
else if (ratio <= K2T)
{b=B2T; m=M2T;}
else if (ratio <= K3T)
{b=B3T; m=M3T;}
else if (ratio <= K4T)
{b=B4T; m=M4T;}
else if (ratio <= K5T)
{b=B5T; m=M5T;}
else if (ratio <= K6T)
{b=B6T; m=M6T;}
else if (ratio <= K7T)
{b=B7T; m=M7T;}
else if (ratio > K8T)
{b=B8T; m=M8T;}
break;

case 1:// CS package


if ((ratio >= 0) && (ratio <= K1C))
{b=B1C; m=M1C;}
else if (ratio <= K2C)
{b=B2C; m=M2C;}
else if (ratio <= K3C)
{b=B3C; m=M3C;}
else if (ratio <= K4C)
{b=B4C; m=M4C;}
else if (ratio <= K5C)
{b=B5C; m=M5C;}
else if (ratio <= K6C)
{b=B6C; m=M6C;}
else if (ratio <= K7C)
{b=B7C; m=M7C;}

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 27
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

else if (ratio > K8C)


{b=B8C; m=M8C;}
break;
}

unsigned long temp;


temp = ((channel0 * b) (channel1 * m));

// do not allow negative lux value


if (temp < 0) temp = 0;

// round lsb (2^(LUX_SCALE1))


temp += (1 << (LUX_SCALE1));

// strip off fractional portion


unsigned long lux = temp >> LUX_SCALE;

return(lux);

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
28 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

APPLICATION INFORMATION: HARDWARE

Power Supply Decoupling and Application Hardware Circuit


The power supply lines must be decoupled with a 0.1 F capacitor placed as close to the device package as
possible (Figure 18). The bypass capacitor should have low effective series resistance (ESR) and low effective
series inductance (ESI), such as the common ceramic types, which provide a low impedance path to ground
at high frequencies to handle transient currents caused by internal logic switching.

VBUS VDD

0.1 F
TSL2560/
RP RP RPI TSL2561

INT

SCL

SDA

Figure 18. Bus Pull-Up Resistors

Pull-up resistors (Rp) maintain the SDAH and SCLH lines at a high level when the bus is free and ensure the
signals are pulled up from a low to a high level within the required rise time. For a complete description of the
SMBus maximum and minimum Rp values, please review the SMBus Specification at
http://www.smbus.org/specs. For a complete description of I2C maximum and minimum Rp values, please
review the I2C Specification at http://www.semiconductors.philips.com.
A pull-up resistor (RPI) is also required for the interrupt (INT), which functions as a wired-AND signal in a similar
fashion to the SCL and SDA lines. A typical impedance value between 10 k and 100 k can be used. Please
note that while Figure 18 shows INT being pulled up to VDD, the interrupt can optionally be pulled up to VBUS.

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 29
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

APPLICATION INFORMATION: HARDWARE

PCB Pad Layout


Suggested PCB pad layout guidelines for the TMB-6 (T) surface mount package, chipscale (CS) package, Dual
Flat No-Lead (FN) surface mount package, and ChipLED6 (CL) surface mount package are shown in
Figure 19, Figure 20, Figure 21, and Figure 22.

3.80
0.90 0.90

0.25
0.70

2.60 0.70

0.70

NOTES: A. All linear dimensions are in millimeters.


B. This drawing is subject to change without notice.

Figure 19. Suggested T Package PCB Layout

0.50

0.50

6   0.21

0.50

NOTES: A. All linear dimensions are in millimeters.


B. This drawing is subject to change without notice.

Figure 20. Suggested CS Package PCB Layout

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
30 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

2.90
1.30 1.30

0.40

0.65

1.70

0.65

0.40

NOTES: A. All linear dimensions are in millimeters.


B. This drawing is subject to change without notice.

Figure 21. Suggested FN Package PCB Layout

1.30
0.43
0.40

0.65

0.40

0.70 0.70

NOTES: A. All linear dimensions are in millimeters.


B. This drawing is subject to change without notice.

Figure 22. Suggested CL Package PCB Layout

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 31
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MECHANICAL DATA
PACKAGE CS Six-Lead Chipscale Device

TOP VIEW

PIN OUT
BOTTOM VIEW

1398
6 1

5 2
171

203 4 3
465

END VIEW 1250

400  50
700  55

6  100 TYP 30

BOTTOM VIEW SIDE VIEW

375  30
6   210  30

500

1750

500

Pb
375  30 500
Lead Free

NOTES: A. All linear dimensions are in micrometers. Dimension tolerance is 25 m unless otherwise noted.
B. Solder bumps are formed of Sn (96.5%), Ag (3%), and Cu (0.5%).
C. The top of the photodiode active area is 410 m below the top surface of the package.
D. The layer above the photodiode is glass and epoxy with an index of refraction of 1.53.
E. This drawing is subject to change without notice.

Figure 23. Package CS Six-Lead Chipscale Packaging Configuration

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
32 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MECHANICAL DATA

PACKAGE TMB-6 Six-Lead Surface Mount Device

TOP VIEW TOP VIEW


1.90 0.31

PIN 1

R 0.20
2.60 6 Pls

PIN 4

3.80

Photo-Active Area
END VIEW
0.88

1.35

0.50
BOTTOM VIEW
0.90
TYP 0.90 TYP
0.60
TYP

0.30
TYP
Pb
0.30
TYP Lead Free

NOTES: A. All linear dimensions are in millimeters. Dimension tolerance is 0.20 mm unless otherwise noted.
B. The photo-active area is 1398 m by 203 m.
C. Package top surface is molded with an electrically nonconductive clear plastic compound having an index of refraction of 1.55.
D. Contact finish is 0.5 m minimum of soft gold plated over a 18 m thick copper foil pattern with a 5 m to 9 m nickel barrier.
E. The underside of the package includes copper traces used to connect the pads during package substrate fabrication. Accordingly,
exposed traces and vias should not be placed under the footprint of the TMB package in a PCB layout.
F. This package contains no lead (Pb).
G. This drawing is subject to change without notice.

Figure 24. Package T Six-Lead TMB Plastic Surface Mount Packaging Configuration

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 33
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MECHANICAL DATA
PACKAGE FN Dual Flat No-Lead
TOP VIEW

PIN OUT
TOP VIEW
PIN 1

VDD 1 6 DATA

2000  75
ADR 2 5 INT

GND 3 4 CLK

2000
 75
Photo-Active Area

END VIEW SIDE VIEW

650  50
203  8
Seating Plane 650
300
BOTTOM VIEW  50

PIN 1

Pb
750  150 Lead Free

NOTES: A. All linear dimensions are in micrometers. Dimension tolerance is 20 m unless otherwise noted.
B. The photo-active area is 1398 m by 203 m.
C. Package top surface is molded with an electrically nonconductive clear plastic compound having an index of refraction of 1.55.
D. Contact finish is copper alloy A194 with pre-plated NiPdAu lead finish.
E. This package contains no lead (Pb).
F. This drawing is subject to change without notice.

Figure 25. Package FN Dual Flat No-Lead Packaging Configuration

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
34 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MECHANICAL DATA

PACKAGE CL-6 Six-Lead Surface Mount Device

TOP VIEW 2.60 TOP VIEW


0.25 0.25

0.35 5 4

2.20 0.70 6 3
Pin 1 Marker
1.05
0.35 1 2
0.55 Photo-Active Area

SIDE VIEW
2 0.30

0.55

0.18

BOTTOM VIEW
6  0.65

4  0.35

6  R 0.18

Pb
Lead Free

NOTES: A. All linear dimensions are in millimeters. Dimension tolerance is 0.20 mm unless otherwise noted.
B. The photo-active area is 1398 m by 203 m.
C. Package top surface is molded with an electrically nonconductive clear plastic compound having an index of refraction of 1.55.
D. Contact finish is 0.1 m (minimum) to 1.0 m (maximum) of soft gold plated over a 15 m (minimum) to 30 m (maximum) thick
copper foil pattern with a 3 m (minimum) to 15 m (maximum) nickel barrier.
E. This package contains no lead (Pb).
F. This drawing is subject to change without notice.

Figure 26. Package CL Six-Lead ChipLED Plastic Surface Mount Packaging Configuration

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 35
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MECHANICAL DATA
TOP VIEW

2.00  0.05 1.75


4.00 4.00  1.50

B
+ 0.30
8.00
0.10

3.50  0.05

 0.60
 0.05
A A B

DETAIL A DETAIL B

5 Max 5 Max
0.250
1.35  0.05  0.02 1.85  0.05 0.97  0.05
Ao Bo Ko

NOTES: A. All linear dimensions are in millimeters. Dimension tolerance is 0.10 mm unless otherwise noted.
B. The dimensions on this drawing are for illustrative purposes only. Dimensions of an actual carrier may vary slightly.
C. Symbols on drawing Ao, Bo, and Ko are defined in ANSI EIA Standard 481B 2001.
D. Each reel is 178 millimeters in diameter and contains 3500 parts.
E. TAOS packaging tape and reel conform to the requirements of EIA Standard 481B.
F. In accordance with EIA standard, device pin 1 is located next to the sprocket holes in the tape.
G. This drawing is subject to change without notice.

Figure 27. TSL2560/TSL2561 Chipscale Carrier Tape

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
36 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MECHANICAL DATA

0.30  0.050 2.10

SIDE VIEW

1.75  0.100 B  1.50 4  0.100 END VIEW


8 Typ 2  0.100

TOP VIEW 12  0.100

5.50
 0.100
 1.50 R 0.20 TYP B A A

DETAIL B
DETAIL A

2.90  0.100 Ao

3.09 MAX

R 0.20 TYP

R 0.20 TYP

4.29 MAX

4.10  0.100 Bo

1.80 Ko

NOTES: A. All linear dimensions are in millimeters.


B. The dimensions on this drawing are for illustrative purposes only. Dimensions of an actual carrier may vary slightly.
C. Symbols on drawing Ao, Bo, and Ko are defined in ANSI EIA Standard 481B 2001.
D. Each reel is 178 millimeters in diameter and contains 1000 parts.
E. TAOS packaging tape and reel conform to the requirements of EIA Standard 481B.
F. In accordance with EIA standard, device pin 1 is located next to the sprocket holes in the tape.
G. This drawing is subject to change without notice.

Figure 28. TSL2560/TSL2561 TMB Carrier Tape

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 37
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MECHANICAL DATA
TOP VIEW

2.00  0.05 1.75


4.00 4.00  1.50

B
+ 0.30
8.00
0.10

3.50  0.05

 1.00
 0.25
A A B

DETAIL A DETAIL B

5 Max 5 Max
0.254
2.18  0.05  0.02 0.83  0.05 2.18  0.05
Ao Ko Bo

NOTES: H. All linear dimensions are in millimeters. Dimension tolerance is 0.10 mm unless otherwise noted.
I. The dimensions on this drawing are for illustrative purposes only. Dimensions of an actual carrier may vary slightly.
J. Symbols on drawing Ao, Bo, and Ko are defined in ANSI EIA Standard 481B 2001.
K. Each reel is 178 millimeters in diameter and contains 3500 parts.
L. TAOS packaging tape and reel conform to the requirements of EIA Standard 481B.
M. In accordance with EIA standard, device pin 1 is located next to the sprocket holes in the tape.
N. This drawing is subject to change without notice.

Figure 29. TSL2560/TSL2561 FN Carrier Tape

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
38 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MECHANICAL DATA
TOP VIEW

2.00  0.05 1.75


 1.50
4.00 4.00 + 0.10

B
8.0  0.2

3.50  0.05

 1.00
A A B

DETAIL A DETAIL B

5 Max 5 Max
0.20
2.4  0.05 2.9 0.7
Ao Bo Ko
NOTES: A. All linear dimensions are in millimeters. Dimension tolerance is 0.10 mm unless otherwise noted.
B. The dimensions on this drawing are for illustrative purposes only. Dimensions of an actual carrier may vary slightly.
C. Symbols on drawing Ao, Bo, and Ko are defined in ANSI EIA Standard 481B 2001.
D. Each reel is 178 millimeters in diameter and contains 2500 parts.
E. TAOS packaging tape and reel conform to the requirements of EIA Standard 481B.
F. In accordance with EIA standard, device pin 1 is located next to the sprocket holes in the tape.
G. This drawing is subject to change without notice.

Figure 30. TSL2560/TSL2561 CL Carrier Tape

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 39
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MANUFACTURING INFORMATION

The CS, T, FN, and CL packages have been tested and have demonstrated an ability to be reflow soldered to
a PCB substrate. The process, equipment, and materials used in these test are detailed below.
The solder reflow profile describes the expected maximum heat exposure of components during the solder
reflow process of product on a PCB. Temperature is measured on top of component. The components should
be limited to a maximum of three passes through this solder reflow profile.

Table 13. TSL2560/61 Solder Reflow Profile


PARAMETER REFERENCE TSL2560/61
Average temperature gradient in preheating 2.5C/sec
Soak time tsoak 2 to 3 minutes
Time above 217C t1 Max 60 sec
Time above 230C t2 Max 50 sec
Time above Tpeak 10C t3 Max 10 sec
Peak temperature in reflow Tpeak 260 C (0C/+5C)
Temperature gradient in cooling Max 5C/sec

Not to scale for reference only


Tpeak
T3

T2

T1
Temperature (C)

Time (sec) t3
t2
tsoak t1

Figure 31. TSL2560/TSL2561 Solder Reflow Profile Graph

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
40 www.taosinc.com
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

MANUFACTURING INFORMATION

Moisture Sensitivity
Optical characteristics of the device can be adversely affected during the soldering process by the release and
vaporization of moisture that has been previously absorbed into the package molding compound. To ensure the
package molding compound contains the smallest amount of absorbed moisture possible, each device is
dry-baked prior to being packed for shipping. Devices are packed in a sealed aluminized envelope with silica
gel to protect them from ambient moisture during shipping, handling, and storage before use.

The CS package has been assigned a moisture sensitivity level of MSL 2 and the devices should be stored under
the following conditions:
Temperature Range 5C to 50C
Relative Humidity 60% maximum
Floor Life 1 year out of bag at ambient < 30C / 60% RH
Rebaking will be required if the aluminized envelope has been open for more than 1 year. If rebaking is required,
it should be done at 90C for 3 hours.

The T, FN, and CL packages have been assigned a moisture sensitivity level of MSL 3 and the devices should
be stored under the following conditions:
Temperature Range 5C to 50C
Relative Humidity 60% maximum
Total Time 6 months from the date code on the aluminized envelope if unopened
Opened Time 168 hours or fewer
Rebaking will be required if the devices have been stored unopened for more than 6 months or if the aluminized
envelope has been open for more than 168 hours. If rebaking is required, it should be done at 90C for 4 hours.

The LUMENOLOGY r Company Copyright E 2009, TAOS Inc.


r

r
www.taosinc.com 41
TSL2560, TSL2561
LIGHT-TO-DIGITAL CONVERTER
TAOS059N MARCH 2009

PRODUCTION DATA information in this document is current at publication date. Products conform to
specifications in accordance with the terms of Texas Advanced Optoelectronic Solutions, Inc. standard
warranty. Production processing does not necessarily include testing of all parameters.

LEAD-FREE (Pb-FREE) and GREEN STATEMENT


Pb-Free (RoHS) TAOS terms Lead-Free or Pb-Free mean semiconductor products that are compatible with the current
RoHS requirements for all 6 substances, including the requirement that lead not exceed 0.1% by weight in homogeneous
materials. Where designed to be soldered at high temperatures, TAOS Pb-Free products are suitable for use in specified
lead-free processes.

Green (RoHS & no Sb/Br) TAOS defines Green to mean Pb-Free (RoHS compatible), and free of Bromine (Br) and
Antimony (Sb) based flame retardants (Br or Sb do not exceed 0.1% by weight in homogeneous material).

Important Information and Disclaimer The information provided in this statement represents TAOS knowledge and
belief as of the date that it is provided. TAOS bases its knowledge and belief on information provided by third parties,
and makes no representation or warranty as to the accuracy of such information. Efforts are underway to better integrate
information from third parties. TAOS has taken and continues to take reasonable steps to provide representative
and accurate information but may not have conducted destructive testing or chemical analysis on incoming materials and
chemicals. TAOS and TAOS suppliers consider certain information to be proprietary, and thus CAS numbers and other
limited information may not be available for release.

NOTICE
Texas Advanced Optoelectronic Solutions, Inc. (TAOS) reserves the right to make changes to the products contained in this
document to improve performance or for any other purpose, or to discontinue them without notice. Customers are advised
to contact TAOS to obtain the latest product information before placing orders or designing TAOS products into systems.

TAOS assumes no responsibility for the use of any products or circuits described in this document or customer product
design, conveys no license, either expressed or implied, under any patent or other right, and makes no representation that
the circuits are free of patent infringement. TAOS further makes no claim as to the suitability of its products for any particular
purpose, nor does TAOS assume any liability arising out of the use of any product or circuit, and specifically disclaims any
and all liability, including without limitation consequential or incidental damages.

TEXAS ADVANCED OPTOELECTRONIC SOLUTIONS, INC. PRODUCTS ARE NOT DESIGNED OR INTENDED FOR
USE IN CRITICAL APPLICATIONS IN WHICH THE FAILURE OR MALFUNCTION OF THE TAOS PRODUCT MAY
RESULT IN PERSONAL INJURY OR DEATH. USE OF TAOS PRODUCTS IN LIFE SUPPORT SYSTEMS IS EXPRESSLY
UNAUTHORIZED AND ANY SUCH USE BY A CUSTOMER IS COMPLETELY AT THE CUSTOMERS RISK.

LUMENOLOGY, TAOS, the TAOS logo, and Texas Advanced Optoelectronic Solutions are registered trademarks of Texas Advanced
Optoelectronic Solutions Incorporated.

Copyright E 2009, TAOS Inc. The LUMENOLOGY r Company


r

r
42 www.taosinc.com
ANEXO 3 Hoja de datos modulo WIFI USR-WIFI232T

59
ANEXO 4 Hoja de datos modulo WIFI USR-WIFI232B

60

Das könnte Ihnen auch gefallen