Download sistema inteligente de alumbrado en carreteras - IIT

Document related concepts

Resistive opto-isolator wikipedia , lookup

Lego Mindstorms wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Charlieplexing wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
SISTEMA INTELIGENTE DE ALUMBRADO
EN CARRETERAS
Author: María del Carmen Álvarez Álvarez
Director: Ankit Jain, Jonathan Makela
Madrid
Junio 2016
Declaro, bajo mi responsabilidad, que el Proyecto presentado con el título
“Sistema inteligente de alumbrado en carreteras”
en la ETS de Ingeniería - ICAI de la Universidad Pontificia Comillas en el
curso académico (2015/16) es de mi autoría, original e inédito y
no ha sido presentado con anterioridad a otros efectos.
El Proyecto no es plagio de otro, ni total ni parcialmente y la información que ha sido
tomada de otros documentos está debidamente referenciada.
Fdo.: María del Carmen Álvarez Álvarez
Fecha: 17/06/2016
Autorizada la entrega del proyecto
EL DIRECTOR DEL PROYECTO
Fdo.: Jonathan Makela
Fecha: 27/ 06/ 2016
Vº Bº del Coordinador de Proyectos
Fdo.: David Contreras Bárcena
Fecha: 27/06/2016
AUTORIZACIÓN PARA LA DIGITALIZACIÓN, DEPÓSITO Y DIVULGACIÓN EN RED DE
PROYECTOS FIN DE GRADO, FIN DE MÁSTER, TESINAS O MEMORIAS DE
BACHILLERATO
1º. Declaración de la autoría y acreditación de la misma.
El autor Dña. María del Carmen Álvarez Álvarez
DECLARA ser el titular de los derechos de propiedad intelectual de la obra: “Sistema de iluminación
inteligente para carreteras”, que ésta es una obra original, y que ostenta la condición de autor en el
sentido que otorga la Ley de Propiedad Intelectual.
2º. Objeto y fines de la cesión.
Con el fin de dar la máxima difusión a la obra citada a través del Repositorio institucional de la
Universidad, el autor CEDE a la Universidad Pontificia Comillas, de forma gratuita y no exclusiva,
por el máximo plazo legal y con ámbito universal, los derechos de digitalización, de archivo, de
reproducción, de distribución y de comunicación pública, incluido el derecho de puesta a disposición
electrónica, tal y como se describen en la Ley de Propiedad Intelectual. El derecho de transformación
se cede a los únicos efectos de lo dispuesto en la letra a) del apartado siguiente.
3º. Condiciones de la cesión y acceso
Sin perjuicio de la titularidad de la obra, que sigue correspondiendo a su autor, la cesión de
derechos contemplada en esta licencia habilita para:
a) Transformarla con el fin de adaptarla a cualquier tecnología que permita incorporarla a internet
y hacerla accesible; incorporar metadatos para realizar el registro de la obra e incorporar
“marcas de agua” o cualquier otro sistema de seguridad o de protección.
b) Reproducirla en un soporte digital para su incorporación a una base de datos electrónica,
incluyendo el derecho de reproducir y almacenar la obra en servidores, a los efectos de
garantizar su seguridad, conservación y preservar el formato.
c) Comunicarla, por defecto, a través de un archivo institucional abierto, accesible de modo libre
y gratuito a través de internet.
d) Cualquier otra forma de acceso (restringido, embargado, cerrado) deberá solicitarse
expresamente y obedecer a causas justificadas.
e) Asignar por defecto a estos trabajos una licencia Creative Commons.
f) Asignar por defecto a estos trabajos un HANDLE (URL persistente).
4º. Derechos del autor.
El autor, en tanto que titular de una obra tiene derecho a:
a) Que la Universidad identifique claramente su nombre como autor de la misma
b) Comunicar y dar publicidad a la obra en la versión que ceda y en otras posteriores a través de
cualquier medio.
c) Solicitar la retirada de la obra del repositorio por causa justificada.
d) Recibir notificación fehaciente de cualquier reclamación que puedan formular terceras personas
en relación con la obra y, en particular, de reclamaciones relativas a los derechos de propiedad
intelectual sobre ella.
•
5º. Deberes del autor.
El autor se compromete a:
a)
Garantizar que el compromiso que adquiere mediante el presente escrito no infringe ningún
derecho de terceros, ya sean de propiedad industrial, intelectual o cualquier otro.
b) Garantizar que el contenido de las obras no atenta contra los derechos al honor, a la
intimidad y a la imagen de terceros.
c) Asumir toda reclamación o responsabilidad, incluyendo las indemnizaciones por daños, que
pudieran ejercitarse contra la Universidad por terceros que vieran infringidos sus derechos e
intereses a causa de la cesión.
d) Asumir la responsabilidad en el caso de que las instituciones fueran condenadas por infracción
de derechos derivada de las obras objeto de la cesión.
6º. Fines y funcionamiento del Repositorio Institucional.
La obra se pondrá a disposición de los usuarios para que hagan de ella un uso justo y respetuoso
con los derechos del autor, según lo permitido por la legislación aplicable, y con fines de estudio,
investigación, o cualquier otro fin lícito. Con dicha finalidad, la Universidad asume los siguientes
deberes y se reserva las siguientes facultades:
!
!
!
!
La Universidad informará a los usuarios del archivo sobre los usos permitidos, y no
garantiza ni asume responsabilidad alguna por otras formas en que los usuarios hagan un uso
posterior de las obras no conforme con la legislación vigente. El uso posterior, más allá de la
copia privada, requerirá que se cite la fuente y se reconozca la autoría, que no se obtenga
beneficio comercial, y que no se realicen obras derivadas.
La Universidad no revisará el contenido de las obras, que en todo caso permanecerá bajo la
responsabilidad exclusive del autor y no estará obligada a ejercitar acciones legales en nombre
del autor en el supuesto de infracciones a derechos de propiedad intelectual derivados del
depósito y archivo de las obras. El autor renuncia a cualquier reclamación frente a la
Universidad por las formas no ajustadas a la legislación vigente en que los usuarios hagan uso de
las obras.
La Universidad adoptará las medidas necesarias para la preservación de la obra en un futuro.
La Universidad se reserva la facultad de retirar la obra, previa notificación al autor, en supuestos
suficientemente justificados, o en caso de reclamaciones de terceros.
Madrid, a 27 de Junio de 2016
Fdo. María del Carmen Álvarez Álvarez
Motivos para solicitar el acceso restringido, cerrado o embargado del trabajo en el Repositorio Institucional:
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
SMART HIGHWAY LIGHT POSTS
Author: María del Carmen Álvarez Álvarez
Director: Ankit Jain, Jonathan Makela
Madrid
June 2016
Acknowledgements
To my parents, who have always worked very hard so that I could receive an outstanding
education.
SISTEMA INTELIGENTE DE ALUMBRADO EN CARRETERAS
Autor: Álvarez Álvarez, María del Carmen
Director: Jain, Ankit
Makela, Jonathan
RESUMEN DEL PROYECTO
El exceso de farolas encendidas en carreteras cuando el tráfico es escaso, contribuye al
consumo excesivo de energía y, por consiguiente, a elevados costes de iluminación. Este
proyecto presenta un sistema formado por módulos, que a su vez están compuestos por dos
unidades de control, permitiendo que las farolas se adapten a la densidad y velocidad del
tráfico. Los objetivos perseguidos son: la reducción de costes, el ahorro energético y la
contribución al dark-sky movement.
Palabras clave: Wireless, Ultrasonido, Sensores, Exterior, Carretera.
1. Introducción
Este proyecto ha sido desarrollado en la Universidad de Illinois at Urbana-Chamapign
con el objetivo de reducir el consumo excesivo de energía en autopistas o carreteras.
Una tramo de carretera que implemente este sistema, deberá estar dividida en varios
módulos, cada uno de los cuales contendrá una unidad de control de sensores y otra
unidad de control de luces. Estas unidades y módulos, se comunicarán entre sí
utilizando XBEEs, que permiten que se establezca una comunicación wireless entre
ellos . Cada unidad de control de sensores implementa un algoritmo que calcula la
duración optima, dependiendo del tráfico, de iluminado de las farolas pertenecientes a
su respectivo módulo. Además, los módulos podrán comunicarse entre sí para evitar
errores del sistema, convirtiéndolo en un sistema tolerante a fallos.
A día de hoy, los sistemas de control de alumbrado presentes en las smart cities son,
en gran parte, de carácter centralizado, como el instalado en Eindhoven [1]. Estos
sistemas, calculan la densidad de tráfico y su velocidad media mediante el uso de
radares. Se envía la información recopilada a una unidad central encargada de analizar
y procesar los datos para configurar las farolas como se desee. Otros sistemas
alternativos, como el de Roosegaarde [2] y Solar Roadways [3], utilizan superficies
inteligentes, como el tempered glass, en vez de asfalto, para iluminar las vías.
Adaptándose, así, a las necesidades del tráfico. Sin embargo, este tipo de sistemas
necesitarán de un gran presupuesto para poder reemplazar la superficie por la que se
circula.
El proyecto propuesto presenta una solución no centralizada a los problemas que
conllevan los sistemas anteriores. Para ellos se construirá un sistema que mediante una
serie de módulos conectados en serie que se comunican entre sí, aseguran una
adaptabilidad rápida a cambios en el tráfico y a errores que pueden darse. Además,
nuestro sistema inteligente de alumbrado para carreteras, reutiliza todo el hardware ya
existente en las autopistas y carreteras, necesitando una inversión inicial despreciable
comparada con la de algunos de los sistemas mencionados anteriormente.
2. Definición del proyecto
Cada módulo del sistema se compone de una unidad de control de sensores y otra de
luces. Cada sensor contiene un transceptor XBEE, cuatro sensores de ultrasonidos, un
microcontrolador y una fotorresistencia. Cada unidad de control de luces contiene
cuatro LEDs (farolas para nuestro modelo a pequeña escala), un transceptor XBEE y
un microcontrolador.
La unidad de control de sensores es capaz de calcular la densidad del tráfico y la
velocidad a la que circulan. Seguidamente, se calcula el tiempo que las farolas de ese
mismo módulo deben de estar encendidas en función de las variables anteriores, entre
otras cosas. Una vez hallada la duración optima, mediante el algoritmo desarrollado en
el proyecto, se envía ésta a la unidad de control de luces, junto con información
adicional mediante comunicación wireless. Se envían letras de una unidad a otra, cada
una de las cuales con un significado diferente. Cada actualización en la unidad de
control de sensores (por ejemplo un nuevo vehículo entrando en el módulo) modifica
la configuración establecida de luces, en menos de 0.3 segundos. Los módulos
contiguos se comunican entre sí para prevenir situaciones en las que se puede producir
un error, comunicándose utilizando los mismos transceptores que se usan para la
comunicación interna entre la unidad de control de sensores y la unidad de control de
luces.
3. Descripción del sistema/modelo
Para desarrollar este proyecto, se llevaron a cabo una serie de reuniones semanales en
las cuales se establecían objetivos. Estas reuniones permitieron que, tanto los
miembros del equipo, como el director, pudiesen decidir cuales de los objetivos
establecidos habían sido cumplidos y cuales necesitaban mejorarse. El método usado
para desarrollar este proyecto ha sido el de scrum. Este método ha sido el
seleccionado, puesto que facilita la separación de tareas entre miembros del equipo, así
como la identificación de problemas y permite la realización de un horario previo a
cumplir.
Durante la etapa de diseño del sistema, nos dimos cuenta de que la gran mayoría de los
sistemas actuales de iluminación eran centralizados. Esto requiere una gran cantidad
de hardware para el análisis y almacenamiento de datos. Además, hace que este tipo
de sistemas respondan más lentamente a cambios inesperados, haciéndolos menos
tolerantes a fallos. Por ello, pensamos en un sistema en el cual los módulos se
conectasen en serie, permitiendo que se comunicasen con sus “vecinos” de manera
rápida y efectiva. Las situaciones en las que se produce un error pueden ser, así,
fácilmente resueltas al permitir que los módulos contiguos cambien su
comportamiento para complementar el fallo del módulo contiguo.
Para permitir el funcionamiento correcto del sistema, en primer lugar, la
fotorresistencia debe detectar si la intensidad luminosa es menor que cierto umbral
establecido. Una vez que esto haya sucedido, la unidad de control de sensores
comienza a funcionar, implementando el algoritmo diseñado en este proyecto. La parte
más complicada de diseñar fue dicho algoritmo, debido a la necesidad de recibir
actualizaciones constantemente y a la necesidad de actualizar la configuración de las
luces de forma continuada.
El algoritmo funciona de la siguiente manera: se calcula la velocidad de cada vehículo
que entra en el módulo, teniendo en cuenta el tiempo que ha tardado en circular entre
ambos sensores. Una vez que la velocidad ha sido calculada, el tiempo “t” que indica
el tiempo que las farolas deberían de estar encendidas, suponiendo que no hay más
vehículos en el módulo, se calcula. Inspirados por numerosos protocolos de redes,
como por ejemplo UDP, a cada vehículo se le asigna una etiqueta conteniendo dos
valores: el sello de tiempo en el cual el vehículo entró en el módulo y el tiempo “t”
que se calculó previamente. El algoritmo se encarga de decidir que etiqueta se
considera la “etiqueta principal”, es decir la etiqueta que se tiene en cuenta a la hora de
decidir cuanto tiempo se iluminan las farolas de dicho módulo. Paralelamente, el
número de vehículos entrando en el módulo se almacena en una variable que afecta el
número de farolas que se encienden en el módulo en cuestión. Una vez se ha decidido
un cual es la “etiqueta principal” y se sabe cuántos vehículos hay dentro del módulo, la
unidad de control de sensores le comunica dicha información a la unidad de control de
luces.
Cada 0.1 segundos, la unidad de control de sensores actualiza la información enviada a
la unidad de control de luces mediante el envío de una letra que podrá ser descifrada
utilizando un código alfabético. Cada letra recibida se interpreta de forma diferente
por la unidad de control de luces. Los módulos están preparados para enfrentarse a
situaciones en las que se produce un error, por ejemplo, si la unidad de control de
sensores falla, nada se recibirá en la unidad de control de luces. Si esto sucede, la
unidad de control de luces será capaz de identificar esta situación y se comunicará con
el módulo “vecino”, el cual actuará de manera diferente, adaptándose así a la
situación.
Figura 1. Interacción entre unidad de control de sensores y unidad de control de luces.
4. Resultados
El sistema final, satisface todos los requisitos especificados en las tablas 6 y 7. A la hora de
realizar la demostración, hubo un problema al soldar las conexiones de larga distancia , lo
cual no nos permitió hacer la demostración con la fuente de alimentación diseñada. Sin
embargo, se comprobó el funcionamiento de esta, de manera independiente, al retirar las
conexiones de larga distancia.
Teniendo en cuenta dos situaciones que pueden darse, una en la cual el tráfico en un tramo
de carretera es denso y otra en la cual la densidad del tráfico es baja, obtuvimos el impacto
económico y medioambiental del sistema desarrollado, comparado con los sistemas de
iluminación tradicionales implementados actualmente. En áreas en las que la densidad del
tráfico era baja, un único módulo compuesto de cuatro farolas, tendría un coste anual de
13.04€ en lugar de 326.36€. En áreas en las que el tráfico era denso, un único módulo
compuesto de cuatro farolas, tendría un coste anual de 81.06€ en lugar de 326.36€. Las
emisiones de dióxido de carbono se verían reducidas de 1758.9 kg a 70.356 kg y 439.725
kg, respectivamente.
Figura 2. Beneficios globales de la implementación de nuestro sistema durante el primer año (por cada
módulo).
5. Conclusiones
Tras analizar los resultados obtenidos, podemos concluir que el impacto económico y
medioambiental de dicho sistema sería notable si se implementase en carreteras,
especialmente en aquellos tramos en los cuales la densidad de tráfico es baja. En función
de los cálculos obtenidos, podemos concluir que los costes de iluminación y las emisiones
de dióxido de carbono se verían reducidos si dicho sistema se llegase a implementar. Si se
implementa el sistema inteligente de alumbrado en carreteras en tramos en los que la
densidad del tráfico es alta, se ahorran 245,30€ por módulo por año. La cifra asciende a
313,32€ en tramos con densidad de tráfico alta. Se sabe que el coste de implementación de
un módulo implica una inversión inicial de 176,79€, por lo cual podemos concluir que la
implementación del sistema es rentable en ambos casos en menos de un año.
El trabajo llevado a cabo este semestre, constituye un punto de inicio sólido para un
cambio en los sistemas de iluminación de carreteras.
6. Referencias
[1]
Braw, E., “Illuminating cities with sustainable smart lighting systems”, The Guardian,
March 2014. http://www.theguardian.com/sustainable-business/sustainable-smart-lightingsystems-cities
[2] Studio Roosegaarde , “Smart Highways”
https://www.studioroosegaarde.net/project/smart-highway/info/
[3] “Solar Roadways” http://www.solarroadways.com
SMART HIGHWAY LIGHT POSTS
Author: Álvarez Álvarez, María del Carmen
Director: Jain, Ankit
Makela, Jonathan
ABSTRACT
Excess amount of highway light posts being lit in highways when traffic is limited,
contributes to excessive energy consumption and large costs. Our solution consists of a two
unit per module system, which allows light posts to adapt to traffic density and speed,
resulting in saved energy, decreased costs and contributing to the dark sky movement.
Keywords: Wireless, Ultrasonic, Sensors, Outdoors, Highway.
1. Introduction
This project has been developed at the University of Illinois at Urbana-Champaign
with the aim of reducing excess energy consumption in highways and roads. A
highway section, which implements this system, has to be divided into a number of
modules, each one of them containing a sensor control unit and a light control unit.
These units and modules, communicate with each other using XBEEs which enable
wireless communication to take place. Every sensor control unit implements an
algorithm that calculates the optimal time, according to traffic, a certain number of
light posts have to be turned on. In addition, modules are able to communicate with
each other to prevent malfunctions and to allow fault tolerance, making it an errorprone system.
Nowadays, centralized light control systems are already present in smart cities, such as
Eindhoven [1]. These systems, calculate traffic density and mean speed using radars
and sends this information to a central unit where this information is analyzed and
allows light posts to be configured accordingly. Alternative systems, such as
Roosegaarde [2] and Solar Roadways [3], use smart surfaces, such as tempered glass,
instead of asphalt or concrete, to illuminate roads that adapt to traffic needs. However,
this type of systems need a very large initial investment to substitute all the alreadyexisting surfaces. This project presents a solution, which unlike the previously
mentioned systems, is a non-centralized solution of modules connected in series,
which communicate with each other, ensuring fast adaptability to traffic and errors.
The Smart Highway Light Posts solution presented in this project, instead, makes use
of the hardware that is already present in highways.
2. Project Definition
Every module in this system is made up of a sensor control and a light control unit.
Each sensor unit contains an XBEE transceiver, four ultrasonic sensors, a
microcontroller and a photo resistor. Each light unit contains four LEDs (small scale
representation of light posts), an XBEE transceiver and a microcontroller.
The sensor control unit is able to calculate the car density and speed of the vehicles
entering the module. Next, a certain amount of time for the light posts to be lit is
calculated using an algorithm that optimizes this value. This value, together with other
information, is sent through a wireless channel to the transceiver in the light control
unit using a letter code. Every update in the sensor control unit (i.e.: new car entering
the module) modifies the lighting configuration in less than 0.3 seconds. Consecutive
modules communicate with each other, to prevent error situations, using the same
XBEEs used for internal communication within a module.
3. Model/System Description
To develop this project, a series of weekly meetings with previously established goals
were set. These meetings allowed both the teammates and the project director to
discuss which of the weekly goals had been achieved. The method used to develop this
project has been incremental. This has been the chosen method due to the fact that it
allows tasks to be easily separated between individuals, it makes problem
identification easier and it allows a predictable schedule to be created.
When deciding how to design this system, we realized most of the current system
designs were centralized. This requires a large amount of hardware for data analysis
and storage. In addition, it makes it less responsive to unexpected changes and more
error prone. We, therefore, thought of a system where modules were connected in
series, allowing these modules to communicate with neighboring ones. Error situations
can be automatically handled by allowing its neighbors to change its behavior if this
type of situation takes place.
For the whole system to work, the photo resistor has to detect that light intensity falls
beneath a certain threshold. Once this happens, the sensor unit starts working,
implementing an algorithm we designed. The most complicated part to design was this
algorithm, due to the fact that it had to constantly receive sensor readings as updates,
and change the light configuration according to this.
To implement this, every vehicle going by has its speed calculated by taking into
account the time taken to go through two sensors in the module. Once the speed is
calculated, the time the light posts in that module should be turned on theoretically if
that vehicle were the only one in the module, “t”, is calculated too. Inspired by a
number of networking protocols, such as UDP, every vehicle has a tag assigned to it.
This tag contains two values: the timestamp at which the vehicle is recorded and time
“t”. The algorithm is in charge of deciding which tag is the primary tag, which means
which tag is taken into account in the light post unit. At the same time the number of
vehicles going through a certain module is recorded in an independent variable,
affecting the number of light posts that are turned on. Once a final value for the light
posts to be turned on is decided, the sensor control unit communicated with the light
control unit.
Every 0.1s the sensor unit updates the light unit by sending a new character, which can
be deciphered using a letter code. Each character received is interpreted differently by
the light control unit. Modules are prepared for error situations, for example, if the
sensor control unit is not working, nothing will be received by the light control unit.
The light unit will detect this situation and will communicate with its neighbors to
alert them of an error situation taking place.
Figure 1. Interaction between the sensor control and the light control units.
4. Results
The final system produced, satisfies all of the requirements specified in Tables 6 and 7.
Issued with soldered connections prevented some of the power supply functionalities to be
verified during demonstration, despite the fact that the power supply did work as expected
and was verified independently.
By taking into consideration two hypothetical situations, one where traffic was dense and
another one where traffic was low, we found out the economic and environmental impact
of our developed system was remarkable, compared to typical lighting systems. In areas
where traffic was light, a single module containing four light posts would have a cost of
13.04€ per year instead of 326.36€ in typical systems. In areas where traffic was dense, a
single module containing four light posts would have a cost of 81.06€ per year instead of
326.36€. Carbon dioxide emission would be reduced from 1758.9 kg to 70.356 kg and
439.725 kg, respectively.
Table 1. Benefits of our system’s implementation during the first year (per module).
5. Conclusions
After analyzing the previous results, we can conclude that the economic and environmental
impact of this system would be very noticeable if implemented in highways, especially in
those areas where the amount of traffic is relatively small. Knowing that for one module in
an area with little traffic, 313.32€ are saved in a year by implementing the Smart Highway
Light Posts system, combined with the fact that the initial investment needed for one
module totals 176.79€, we can conclude that implementing our system will be profitable in
less than a year. The same occurs in areas where traffic is dense, as 245,30€ would be
saved in a year which still makes it profitable in less than a year, compared to the initial
investment.
The work produced this semester is a robust starting point to a change in public lighting
systems for highways.
6. References
[1]
Braw, E., “Illuminating cities with sustainable smart lighting systems”, The Guardian,
March 2014. http://www.theguardian.com/sustainable-business/sustainable-smart-lightingsystems-cities
[2] Studio Roosegaarde , “Smart Highways”
https://www.studioroosegaarde.net/project/smart-highway/info/
[3] “Solar Roadways” http://www.solarroadways.com
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
ÍNDICE DE LA MEMORIA
Index
Chapter 1. Introduction ........................................................................................................ 6
Chapter 2. State of the Art.................................................................................................... 7
2.1 Eindhoven Illumination System ............................................................................................ 7
2.2 Studio Roosegaarde ............................................................................................................... 7
2.3 Solar Roadways ..................................................................................................................... 8
2.4 Analysis ................................................................................................................................. 9
Chapter 3. Motivation......................................................................................................... 10
3.1 Motivation .............................................................................................................................. 10
3.2 Objectives............................................................................................................................... 11
3.3 Methodology .......................................................................................................................... 12
3.4 Methodology .......................................................................................................................... 16
3.4.1 Hardware ........................................................................................................................ 16
3.4.2 Software .......................................................................................................................... 17
Chapter 4. Technologies Used............................................................................................ 19
4.1 Sensor Unit............................................................................................................................. 19
4.1.1 Battery............................................................................................................................. 19
4.1.2 Sensors ............................................................................................................................ 20
4.1.3 Microcontroller............................................................................................................... 20
4.1.4 Photo resistor.................................................................................................................. 21
4.1.5 Transceiver ..................................................................................................................... 22
4.2 Light Control Unit.................................................................................................................. 22
4.2.1 Transceiver ..................................................................................................................... 23
4.2.2 LEDs ............................................................................................................................... 23
4.2.3 Microcontroller............................................................................................................... 23
4.2.4 Battery............................................................................................................................. 24
Chapter 5. Developed System ............................................................................................. 25
5.1 General Description................................................................................................................ 26
5.2 Design Review ....................................................................................................................... 27
I
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
ÍNDICE DE LA MEMORIA
5.3 Sensor Control Unit................................................................................................................ 28
5.4 Light Control Unit.................................................................................................................. 29
5.5 Power Supply Design ............................................................................................................. 30
5.6 Implementation ...................................................................................................................... 32
5.6.1 Power Supply Schematic................................................................................................. 32
5.6.2 Sensor Control Unit Schematic....................................................................................... 33
5.6.3 Light Control Unit Schematic ......................................................................................... 34
5.6.4 Software Implementation ................................................................................................ 35
Chapter 6. Requirements and Verifications ...................................................................... 43
6.1 Safety Considerations............................................................................................................. 45
6.1.1 Safety Statement.............................................................................................................. 45
6.1.2 Safety Gear ..................................................................................................................... 46
6.1.3 Testing Environment ....................................................................................................... 46
6.1.4 Circuit Safety .................................................................................................................. 46
6.2 Ethics...................................................................................................................................... 46
Chapter 7. Results............................................................................................................... 48
7.1 Serial Monitor Testing ........................................................................................................... 50
7.2 Ultrasonic Sensor Testing ...................................................................................................... 50
7.3 XBEE Testing ........................................................................................................................ 52
7.4 Photo Resistor Testing ........................................................................................................... 52
7.5 Power Supply Test Results..................................................................................................... 53
7.6 Economic Impact.................................................................................................................... 54
7.6.1 Section with Low Traffic Density.................................................................................... 54
7.6.2 Section with High Traffic Density................................................................................... 56
7.7 Environmental Impact ............................................................................................................ 56
Chapter 8. Conclusions ...................................................................................................... 58
8.1 Accomplishments ................................................................................................................... 58
8.2 Future Works.......................................................................................................................... 62
References 65
II
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
ÍNDICE DE FIGURAS
Index of Figures
FIGURE1.INTERACTIONBETWEENTHESENSORCONTROLANDTHELIGHTCONTROLUNITS. .................................................17
FIGURE3.FUNCTIONALITIESOFSOLARROADSCOMPAREDTOCONCRETEANDASPHALTROADS.(SOURCE
HTTP://WWW.SOLARROADWAYS.COM).............................................................................................................8
FIGURE4.METHODOLOGYSTAGES. .........................................................................................................................12
FIGURE5.SCHEDULE(PART1). ...............................................................................................................................15
FIGURE6.SCHEDULE(PART2). ...............................................................................................................................16
FIGURE7.X9VDURACELLBATTERY. ........................................................................................................................19
FIGURE8.MB1000ULTRASONICSENSOR. ..............................................................................................................20
FIGURE9.ATMEGA328P. ...................................................................................................................................21
FIGURE10.GL5528PHOTORESISTOR. ....................................................................................................................21
FIGURE11.XBEETRANSCEIVERFORWIRELESSCOMMUNICATION..................................................................................22
FIGURE12.LEDS. ................................................................................................................................................23
FIGURE13.LAYOUTOFONEMODULE.......................................................................................................................25
FIGURE14.HIGH-LEVELBLOCKDIAGRAMOFONEMODULEOFTHESYSTEM......................................................................27
FIGURE15.HIGH-LEVELBLOCKDIAGRAMOFSENSORCONTROLUNIT. .............................................................................28
FIGURE16.HIGH-LEVELBLOCKDIAGRAMOFLIGHTCONTROLUNIT.................................................................................29
FIGURE17.POWERSUPPLYSIMULATION. .................................................................................................................31
FIGURE18.POWERSUPPLYIMPLEMENTATION. ..........................................................................................................32
FIGURE19.SENSORCONTROLUNITSCHEMATIC. ........................................................................................................33
FIGURE20.LIGHTCONTROLUNITSCHEMATIC. ...........................................................................................................34
FIGURE21.LUMINOSITYDETECTIONCODEIMPLEMENTATION. ......................................................................................35
FIGURE22.VIRTUALTAGASSIGNEDTOVEHICLESDETECTEDBYTHESENSORS....................................................................36
FIGURE23.ALGORITHMSIMULATION.......................................................................................................................37
FIGURE24.ALGORITHMSIMULATION.......................................................................................................................38
FIGURE25.SOFTWAREALGORITHMFLOWCHART........................................................................................................39
FIGURE26.TIMECHECK. .......................................................................................................................................40
FIGURE27.LETTERCODEIMPLEMENTATIONATTRANSMITTER. .....................................................................................41
FIGURE28.TESTINGTHEDETECTIONOFTARGETSINSENSOR1ANDSENSOR2. ................................................................51
FIGURE29.CHARACTERSRECEIVEDINLEDUNIT,FORXBEETESTING. ...........................................................................52
FIGURE30.PHOTORESISTORTESTING.......................................................................................................................53
FIGURE31.OUTPUTVOLTAGEOFPOWERSUPPLY. ......................................................................................................53
III
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
ÍNDICE DE FIGURAS
FIGURE32.HIGHWAYSECTIONTOBEANALYZED. .......................................................................................................54
FIGURE33.ECONOMICIMPACTOFONEMODULEWITHANDWITHOUTIMPLEMENTINGS.H.L.(SMARTHIGHWAYLIGHTPOSTS).
...............................................................................................................................................................59
FIGURE34.ENVIRONMENTALIMPACTOFONEMODULEWITHANDWITHOUTIMPLEMENTINGS.H.L.(SMARTHIGHWAYLIGHT
POSTS)......................................................................................................................................................59
FIGURE35.SEPARATIONDISTANCESOFASCALEDVERSIONOFAS.H.L.MODULE. .............................................................62
FIGURE36.FOURMODULESINSERIES. .....................................................................................................................62
IV
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
ÍNDICE DE FIGURAS
Index of Tables
TABLE1.BENEFITSOFOURSYSTEM’SIMPLEMENTATIONDURINGTHEFIRSTYEAR(PERMODULE)..........................................17
TABLE2.HARDWAREANDCOSTREQUIREDFORONESMALLSCALEMODULEOFTHISPROJECTTOBEDEVELOPED. .....................17
TABLE3.PARTICIPANTSANDLABORCOSTS. ...............................................................................................................17
TABLE4.POWERCONSUMPTIONFOREACHCOMPONENT. ............................................................................................30
TABLE5.LETTERCODEUSEDFORWIRELESSTRANSMISSION...........................................................................................41
TABLE6.LETTERCODEINTERPRETEDATRECEIVER. ......................................................................................................42
TABLE7.HARDWAREREQUIREMENTSANDVERIFICATIONS............................................................................................44
TABLE8.SOFTWAREREQUIREMENTSANDVERIFICATIONS.............................................................................................45
TABLE9.HARDWAREREQUIREMENTSANDRESULTS. ...................................................................................................48
TABLE10.SOFTWAREREQUIREMENTSANDRESULTS. ..................................................................................................50
TABLE11.SMARTHIGHWAYLIGHTPOSTSENVIRONMENTALIMPACTINAREASWITHLOWTRAFFICDENSITY. .........................57
TABLE12.SMARTHIGHWAYLIGHTPOSTSENVIRONMENTALIMPACTINAREASWITHHIGHTRAFFICDENSITY..........................57
TABLE13.SMARTHIGHWAYLIGHTPOSTSVIABILITYINAREASWITHLOWTRAFFICDENSITY. ................................................60
TABLE14.SMARTHIGHWAYLIGHTPOSTSVIABILITYINAREASWITHHIGHTRAFFICDENSITY. ...............................................60
TABLE15.BENEFITSOFOURSYSTEM’SIMPLEMENTATIONDURINGTHEFIRSTYEAR(PERMODULE)........................................61
V
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 1. Introduction
CHAPTER 1. INTRODUCTION
Excess amount of highway light posts being lit contributes to excessive energy
consumption, large costs, and a lot of money wasted on keeping highway lights lit. There
are too many light posts turned on in highway areas where not a single car is driving
through, contributing to light pollution.
The dark sky movement is a movement that aims to reduce light pollution to reduce the its
effects on the environment because many species depend on the environment and adapt
their amount of hours of sleep to daytime and nighttime. Light pollution alters these
species’ biological cycles. Excess illumination at night affects wildlife, disrupting their life
cycles and bringing negative consequences to them. Light pollution has also been
discovered to affect human health, crime and safety and energy consumption. The dark
sky movement is gaining importance at the same time as environmental awareness is
increasingly gaining importance in most countries due to an increase in natural disasters
and resource scarcity.
Lighting expenses make up 10% of the U.S. total electric consumption [2], therefore,
reducing the amount of money spent in highway lighting, can have a great impact in a
country’s economic performance.
6
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 2. State of the Art
CHAPTER 2. STATE OF THE ART
Nowadays, global warming and environmental has started to concern a number of
countries and cities around the World. Some cities have started implementing smart
illumination systems. We will now discuss a series of examples of leading edge
illumination technologies.
2.1
EINDHOVEN ILLUMINATION SYSTEM
The city of Eindhoven has started implementing a smart illumination system [8], which
combines sustainability and residents’ well-being, which includes a series of
characteristics:
•
Empty streets have their lights automatically switched off if no pedestrians or
vehicles are going through. Wireless sensors are used for this purpose.
•
•
•
Each individual streetlight can be controlled by a central computer.
City residents are able to create their own mood lighting.
Light posts can remember a resident’s way home and can even guide a resident
home.
•
Illuminated pedestrian crossings with sensor that enable white stripes to illuminate
when no vehicles are near, indicating it is safe for pedestrians to cross.
•
2.2
Paintings projected onto road surfaces to indicate temperature and other features.
STUDIO ROOSEGAARDE
Studio Roosegaarde has designed an “interactive and sustainable” road design, which
adapts to traffic using an energy-efficient system [9]. The system can be summarized in a
series of “glowing lines” made out of paint. The coated surface is illuminated using solar
panels as a power supply. The amount of light pollution this system emits is lower than the
7
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 2. State of the Art
amount regular Systems produce, as the light intensity is less and “friendlier” to the
environment. Future works include highway lanes, which are able to charge electric cars.
The problem with this system is that its implementation is very expensive due to the
necessity of replacing typical road surfaces by a new material that enables many of these
functionalities to happen.
2.3
SOLAR ROADWAYS
Solar Roads is a solution that substitutes typical asphalt road surfaces by “specially
engineered solar panels that can be walked and driven upon” [10]. This tempered glass
surface contains LEDs that can indicate road characteristics to vehicles driving through it.
Figure X shows its main functionalities compared to concrete and asphalt:
Figure 2. Functionalities of solar roads compared to concrete and asphalt roads. (Source
http://www.solarroadways.com)
8
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 2. State of the Art
This solution introduces a large number of new environmental-friendly functionalities,
however, the cost of implementing it is extremely big and proportional to the number of
kilometers needed to be covered by this leading-edge surface.
2.4
ANALYSIS
As we have seen in the previous examples, smart cities and smart road surfaces are the
most outstanding leading-edge technologies. However, there are a series disadvantages that
come along with each of these previously mentioned systems, especially if applied to
highways instead of short-distance roads.
The Eindhoven Illumination System, as well as any other similar system which is used in
Smart Cities, relies heavily on a central server or computer. All the information is gathered
and processed in this central module, which is what determines the city’s behavior. It is
true that this central node may make error detection tasks easier, however, avoiding
information to go through this central-processing node, would allow the city to react
rapidly to unexpected changes, as well as reducing the amount of unnecessarily stored
information.
The Studio Roosegaarde and the Solar Roads Solutions both imply a large initial
investment to cover road surfaces. These technologies might guarantee cost reduction in
the long term, however, they should try to make use of the already existing resources in
roads to make implementation easier and more cost-effective.
9
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
CHAPTER 3. MOTIVATION
3.1 MOTIVATION
As explained in the previous chapter, smart cities and other smart lighting technologies
have gained importance during the last decade to try to fulfill the need for energy
consumption reduction. Our solution focuses on highways rather than urban areas, as most
of the previously mention Technologies already focus on this second type.
In 2014, Spain had 166.284 km of highways inside its territory [2]. The rate at this number
increases is fast. The goal of this project is to save wasted energy and money. By reducing
the amount of power used on street lights and highway lights, we can save money on
powering used light posts, allowing the saved money to spent in other major causes which
can benefit society. This project also aims to utilize the amount of light emitted by vehicles
as a method of illumination in highways. Highly congested highways do not need light
posts to serve as guidance as vehicles can serve as a reference to other vehicles. Highway
safety is also an important factor that has been taken into consideration in our project.
This system’s differentiating factor is the idea that instead of sending information to a
central server, which can change the whole highway’s behavior, our solution, allows small
highway segments to adapt real time traffic situations. Each segment behaves differently,
as traffic in one segment does not necessarily have to be related to traffic in another
segment.
10
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
3.2 OBJECTIVES
This project’s objective is to design an efficient, energy-saving system that can be easily
implemented in highways and roads. A small scale implementation of the system will also
be develop to ensure the power supply and the software both work as expected in different
situations.
Wireless communication will be used between modules to reduce physical connection
costs and to ensure adaptability and scalability in case highways need to be modified for
future improvements. The highway is divided into modules. Every module is in charge of
its own sensing and lighting by implementing the algorithm developed in this project.
This project’s objectives are:
•
Energy consumption reduction
•
Adaptability, to traffic density, speed and dispersion.
•
Scalability. Easy to implement changes in the system if the highway suffers any
changes.
•
Error handling. Consecutive neighbors are able to adapt to error situations
•
Energy consumption reduction
11
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
3.3 METHODOLOGY
This project was developed following this scheme:
Figure 3. Methodology stages.
•
Problem definition: This phase was dedicated to finding a motivating project that
fulfilled a need for society.
12
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
•
Analysis of possible solutions: At this point, once the problem had already been
identified (energy consumption reduction in highways), a high level definition of
the solution was created at this stage. In this phase roles had to be clearly identified
and separated, a schedule had to be prepared and weekly meetings had to be preset
in order to allow teammates and the director to organize its weekly agenda. At this
point a series of verifiable requirements had to be describes in a design review
document.
•
Hardware and software design: In this phase, several design solutions were
considered in order to fulfill the already specified requirements. Considerations
such as which wireless technology to use, which type of sensors to use, how the
sensor algorithm should work or how to create an autonomous power supply, were
discussed in this stage.
•
Hardware implementation: Although both software and hardware implementation
tasks were carried out in parallel, it is true that hardware implementation had to be
finished first in order to allow the software to be tested. This phase was carried out
using a white board, where soldered connections were not yet carried out in order
to allow any future changes to take place.
•
Software implementation: This stage followed a clearly defined incremental
methodology. The program’s complexity increases proportionally over recurrent
phases, which need to be tested on hardware.
•
Requirement testing: This phase can be divided into two types of testing. Testing
carried out throughout the whole project development and testing carried out at the
13
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
end of the project. The first type of testing was carried out at the end of the
hardware implementation phase to verify this part of the system worked correctly.
Once this was done, each of the small incremental variations performed on the
software side had to be tested and verified using the hardware side. The second
type was a verification carried out at the end of the whole project development,
where each and every one of the requirements specified at the beginning of the
project had to be verified.
•
Report elaboration: At the end of the project’s development a final report
evaluating the project’s success was developed, where any problems or any
requirements that were not fulfilled had to be specified in order to evaluate the
project’s impact and success. Other aspects such as scalability, economic and
environmental impacts were also taken into consideration.
14
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
Figure 4. Schedule (part 1).
15
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
Figure 5. Schedule (part 2).
3.4 METHODOLOGY
3.4.1 HARDWARE
The hardware required to develop one small-scale module of our project requires the
following hardware components:
Part
Part Number
Quantity
Individual
Cost
Total Cost
Microcontroller
ATMEGA328p
2
$3.70
$7.40
Transceiver
XBEE
2
$25
$50
Photo resistor
GL5528
1
$1
$1
Ultrasonic Sensor
maxSonar MB10400
4
$30
$120
Battery (9V)
Duracell
2
$2
$4
Voltage Regulator
LM2674
2
$1
$2
Resistor (10ohms)
--
16
$0.5
$8
Resistor (2.25k
ohms)
--
4
$0.5
$2
Resistor (30 ohm)
--
2
$0.5
$1
Resistor (40 ohm
--
2
$0.5
$1
LED
--
8
$1
$8
Capacitor (100uF)
--
4
$0.5
$2
16
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
Capacitor (10nF)
--
2
$0.5
$1
Inductor (100uH)
--
2
$0.5
$1
Total
$208.40
Table 2. Hardware and cost required for one small scale module of this project to be developed.
The total cost of one small-scale module, totals $208.4. When implementing this in a large
scale environment, using the already existing Light posts, the total cost would be $200.40,
or 176.79€ (no LEDs needed).
3.4.2 SOFTWARE
The algorithm, wireless communication and functioning of the entire system was
developed using the Arduino development environment.
3.4.2.1 Labor
Name
Hours of Work
Hourly Rate
Total
Kevin Obrzut
260
$30.00
$7,800
Maríaa del Carmen
260
$30.00
$7,800
520
$60.00
$15,600
Álvarez Álvarez
Total
Table 3. Participants and labor costs.
Labor costs total $15,600 or 13,760.75€, assuming this is only an initial investment needed
for the software implementation of one module. This system will be replicated with no
further labor costs, in additional modules.
17
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 3. Motivation
3.4.2.2 Total Costs
The total cost of the project, including hardware, software and labor costs when developed
in a small-scale environment, totals $15,808.40.
18
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 4. Technologies Used
CHAPTER 4. TECHNOLOGIES USED
This section will explain why the previously mentioned technology has been chosen in the
development of this project.
4.1 SENSOR UNIT
This unit is made up of the following major components (ignoring capacitors and
resistors): four sensors (2 for each lane), one transceiver, one photo resistor, one
microcontroller, and one power supply that allows the system to be autonomous.
4.1.1 BATTERY
The power supply consists of a 9V battery and a buck converter IC. This 9V battery
(Duracell) is connected to a 3.3V buck converter IC (LM2674). This regulator has a
maximum current output of 500mA, which is a sufficient supply for both circuits.
Figure 6. X9V Duracell battery.
19
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 4. Technologies Used
4.1.2 SENSORS
The sensor unit contains two ultrasonic sensors (MB 1000). These sensors were planned to
be placed at a distance of three feet apart. They can detect up to 10ft and have a beam
width of 1 ft. By having these two sensors separated by a distance, we can determine both
the speed of passing bicycles and number of passing bicycles. The sensors have three
ways of sending data to the microcontroller; analog, serial, and PWM. For the module
developed in this project the PWM output was the chosen method for three of our sensors
and analog for one. We used analog for one because the PWM output was broken during
assembly. The PWM output of the sensor is connected to the digital input pin on the
ATMEGA328P microcontroller.
Figure 7. MB 1000 ultrasonic sensor.
4.1.3 MICROCONTROLLER
The ATMEGA328P microcontroller was chosen for the development of this project. This
microcontroller is part of the Arduino UNO. We used the Arduino UNO board to program
and test this microcontroller and code. This microcontroller accepts an analog signal from
the light sensor to determine the brightness of day. The microcontroller uses the digital
input for reading the PWM output of the ultrasonic sensors. Finally, the microcontroller
sends a serial digital signal to the transceiver (XBEE). This transceiver will send a wireless
signal to the light control.
20
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 4. Technologies Used
Figure 8. ATMEGA328P.
4.1.4 PHOTO RESISTOR
The photo resistor (GL5528) determines the brightness of the area the module is in. If
sufficient light is detected, the microcontroller will simply keep all of the LEDs off. This
light sensor will be sending an analog signal to the microcontroller for analysis.
Figure 9. GL5528 photo resistor.
21
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 4. Technologies Used
4.1.5 TRANSCEIVER
We used an XBEE 2mW as our transceiver. This transceiver will receive a serial data input
from the microcontroller and when a transmit signal is set high. This will transmit the data
wirelessly to the transceiver on the light control circuit.
The main reason for using XBEEs to establish wireless communication is because of its
simplicity and because it can be easily re-used, allowing scalability and adaptability for
any future changes.
Figure 10. XBEE transceiver for wireless communication.
4.2 LIGHT CONTROL UNIT
The light control unit is in charge or interpreting the information received from the sensor
unit and turning the LEDs on or off according to the instructions received. This unit is
made up one transceiver, four LEDs, one microcontroller, and one power supply that
allows the system to be autonomous.
22
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 4. Technologies Used
4.2.1 TRANSCEIVER
We used an XBEE as our transceiver. This transceiver will receive a serial data input from
the XBEE in the sensor unit and will then send this information to the microcontroller in
the light control circuit.
The main reasons for using XBEEs to establish wireless communication are the same as
the reasons explained in the previous section. (See figure 9).
4.2.2 LEDS
The LEDs were used to simulate the light posts in the light control unit. The chosen type
was L2-0-R5TH50, which guaranteed enough brightness when testing.
Figure 11. LEDs.
4.2.3 MICROCONTROLLER
The ATMEGA328P microcontroller was chosen for the development of this unit. This
microcontroller is part of the Arduino UNO. We used the Arduino UNO board to program
and test this microcontroller and code since all the resources needed were compatible with
it. (See figure 9).
23
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 4. Technologies Used
4.2.4 BATTERY
Just like for the sensor control unit, the power supply consists of a 9V battery and a buck
converter IC.
This 9V battery (Duracell) is connected to a 3.3V buck converter IC
(LM2674). This regulator has a maximum current output of 500mA, which is a sufficient
supply for both circuits. (See Figure 7).
24
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
CHAPTER 5. DEVELOPED SYSTEM
In this section we will analyze one module of the system. The system itself is made up of a
sensor control unit and a light control unit. The figure below shows the design’s physical
layout for our demonstration. The red squares, labeled s1L1, s2L1, s1L2 and s2L2 are
ultrasonic sensors. The grey circles are the LEDs in a module. The first four sensors on the
left determine which of the four LED units should be lit.
Figure 12. Layout of one module.
25
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.1 GENERAL DESCRIPTION
The module itself is divided into two units: the sensor control unit and the light control
unit. Each unit is in charge of different tasks, and they communicate with each other via
wireless communication.
This system can be divided into four tasks it has to perform:
•
Vehicle readings: The sensor control unit is in charge of this task. Both pairs of
sensor for each lane measure the car’s time to get from one sensor to another by
setting a timer that stops once the second “virtual line” of sensors is crossed. Then,
the speed of the vehicle can be easily calculated.
•
Algorithm calculations: The implemented algorithm is able to calculate in the
sensor control unit what the final lighting time to be sent to the light control unit is.
•
Communication: Wireless communication sent the algorithm’s final value in the
form of characters to the light control unit.
•
Light configuration: The light control unit determines which LEDs turn on or off
and at what time.
The main challenge faced when designing this system was the fact that all these four stages
had to happen really fast because of the need for constant update, in case new vehicles
went through the module.
26
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.2 DESIGN REVIEW
Figure 13. High-level block diagram of one module of the system.
Due to complications with demonstrating on an actual road with cars, we planned to
demonstrate in a hallway with bicycles instead of cars. Our project consists of two main
units, a sensor control unit and a light control unit. The sensor control circuit reads in the
data sent from the four sensors. This then uses a complex algorithm to calculate which
LED units should be lit. The data from this circuit is then wirelessly sent to the light
control circuit. This data is then again analyzed and the correspond LED units are lit.
27
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.3 SENSOR CONTROL UNIT
Figure 14. High-level block diagram of sensor control unit.
The microcontroller in the sensor unit accepts an analog signal from the light sensor to
determine the brightness of day. If the light sensors detects the light intensity falls Veneta
a certain threshold, the system will start working, assuming it is night time. This has
priority over the data for the ultrasonic sensors. The microcontroller uses the digital input
for reading the PWM output of the ultrasonic sensors. The data from the ultrasonic sensors
are used to determine the speed and density of passing bikes using an algorithm we
created.
From this, the microcontroller sends a serial digital signal to the
transceiver(XBEE). This transceiver will send a wireless signal to the light control. This
signal will contain the data for which LED unit should be on/off and for how long.
28
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.4 LIGHT CONTROL UNIT
Figure 15. High-level block diagram of light control unit.
This micro controller controls which LED unit should be lit and for how long. The
transceiver will be sending a serial signal to an digital pin on the microcontroller.
Depending on the incoming data, the microcontroller will supply power to the
corresponding LED unit. Each digital pin on the microcontroller controls a single LED,
due to power constraints. Therefore, two digital pins will be used for each LED unit.
29
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.5 POWER SUPPLY DESIGN
To design our power supply, we first had to figure out how much power our project
required. The table below shows the power consumption of our hardware used.
Table 4. Power consumption for each component.
Using these operating conditions, we choose to use a power supply that outputs 3.3V,
which is within all of the parts operating ranges. We found a total current consumption of
at least 350mA to be required as well.
To do this, we choose to use a buck converter IC. The LM2674 IC was chosen for this
project. This IC allows for a 3.3 V output voltage with a guaranteed 500mA output
current. The buck converter was chosen over a voltage regulator due to power efficiency.
The LM2674 has a >90% power efficiency, which would allow us to use our batteries for
much longer.
We also found that the microcontroller pins are able to output at most 20mA of current and
at 3.3 V. By Assuming a voltage drop of 2.4V for each LED and a current usage of 16mA,
we found we could connect one LED to one digital pin on the ATMEGA328p. The
required resistance to connect the LED in series with was determined using Ohm’s law:
30
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
The following power simulation was done on LTspice, to test for the voltage roll impact.
A 9V input was used and our corresponding buck converter setup was used in the
simulator. As we can see, the voltage swing is very minimal was determined to be
sufficient for our project.
Figure 16. Power supply simulation.
31
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.6 IMPLEMENTATION
5.6.1 POWER SUPPLY SCHEMATIC
Figure 17. Power supply implementation.
32
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.6.2 SENSOR CONTROL UNIT SCHEMATIC
Figure 18. Sensor control unit schematic.
33
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.6.3 LIGHT CONTROL UNIT SCHEMATIC
Figure 19. Light control unit schematic.
34
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.6.4 SOFTWARE IMPLEMENTATION
The whole software implementation was done using Arduino code that allows using C
language and its own libraries for program development.
The following screen shots, are sections of the code implementation where a series of
functionalities are achieved in the sensor control unit.
5.6.4.1 Phase 1, Day/Night
Figure 20. Luminosity detection code implementation.
This part of the code takes into account a series of light luminosity readings from the photo
resistor, by saying that if the value goes over a certain threshold (35), the program will
consider this value as day. The program needs to receive 20 values over the threshold to
declare it is daytime, this way ensuring anomalous readings are ignored. Once daytime is
declared, if a value beneath this threshold is received, nighttime is declared. If nighttime is
declared, the rest of the whole system can start working.
35
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.6.4.2 Phase 2, Time Calculations
Once the first sensor detects an obstacle it starts a timer, which is then stopped by the
second sensor. As it can be seen in Figure 21, the time taken for a vehicle to go through the
rest of the module (assuming constant speed) is just the time it takes for it to go through the
sensors, multiplied by a factor of ten.
5.6.4.3 Phase 3, Count
Every time a vehicle is detected the variable count is increased by one, altering the light
configuration in the light control unit, independently from the rest of the system. When the
calculated time for the LEDs to be turned on expires, the variable count also expires. In
addition, the variable count also expires after a certain period of time if no new cars go by.
5.6.4.4 Phase 4, Algorithm
The most complicated part of the software development, was creating an algorithm which
reduced as much as possible the number of calculations that take place when the whole
program is working. Inspired by some network protocols, such as UDP, which implement a
timestamp system, it was decided this could be a good solution for our system. Each
vehicle is assigned a “virtual tag” like the following one:
Figure 21. Virtual tag assigned to vehicles detected by the sensors.
36
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
Every time a new vehicle is detected, a virtual tag is calculated for that specific vehicle.
Lets assume this is the first vehicle to go by, so this tag will be chosen as the primary tag.
•
If no new vehicles go by, the previous tag will remain as the primary tag, and
therefore, the LEDs will be turned off at t=44.7, referring to the figure above.
•
If a new vehicle goes by and the total time is bigger than 44.7, either because of the
time instant at which it was recorded or because of the time the LEDs should be lit
due to the speed of the car, then this new tag becomes the primary tag.
•
If a new vehicle goes by and the total time is bigger than 44.7, then this new tag is
discarded and the primary tag remains the one that was set before.
The following figure shows a situation in which the primary tag is substituted by a new
one, once the second vehicle is detected. The system’s global behavior is also shown in
the following graph.
Figure 22. Algorithm simulation.
37
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
The following figure shows a situation in which the primary tag is not substituted by a
new one, once the second vehicle is detected. The system’s global behavior is shown in
the following graph.
Figure 23. Algorithm simulation.
38
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
Figure 24. Software algorithm flowchart.
● count: number of cars going through module at a given time.
● t_LEDs: computed time LEDs have to be turned on according to a car’s velocity.
● t_current: time instant at a given time.
● t_end: calculated time at which LEDs should turn off, computed for every car
detected.
● t_end_timestamp: calculated time at which LEDs should turn off. This value will be
the one that will actually be affect the LEDs.
5.6.4.5 Phase 5, Time Expiry
At the end of every loop cycle in the transmitter’s Arduino code, the system verifies
whether or not the current time has exceeded ending time specified in the primary tag.
When this happens, the sensor unit notifies the light unit that the LEDs have to be turned
off. Making constant updates possible was a big challenge when trying to implement it.
The following flowchart explains how this was achieved.
39
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
Figure 25. Time check.
● count: number of cars going through module at a given time.
● t_LEDs: computed time LEDs have to be turned on according to a car’s velocity.
● t_current: time instant at a given time.
● t_end: calculated time at which LEDs should turn off, computed for every car
detected.
● t_end_timestamp: calculated time at which LEDs should turn off. This value will be
the one that will actually be affect the LEDs.
5.6.4.6 Phase 6, Transmission
Every time the loop ends, every 100ms, there are only two variables to be considered:
on/off and count. The on/off variable depends on the condition: t_current>t_end. If the
ending time has been reached, then the LEDs should be off, if not the LEDs remain on. A
letter code has been designed in order to to allow the sensor unit to send messages
containing different LEDs configuration. These can be easily interpreted by the light
control unit.
40
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
Letter
Meaning
‘a’
No LEDs on. No vehicles inside the
module or time expired. Daytime.
‘b’
Four LEDs on. One vehicle inside the
module.
‘c’
Three LEDs on. Two vehicles inside
the module.
‘d’
Two LEDs on. Three vehicles inside
the module.
‘e’
One LED on. Four or more vehicles
inside the module.
Table 5. Letter code used for wireless transmission.
.
Figure 26. Letter code implementation at transmitter.
41
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 5. Developed System
5.6.4.7 Phase 7, Reception
Each character received is interpreted differently, as shown in the following table:
Letter
Meaning
‘a’
No LEDs on.
‘b’
Four LEDs on.
‘c’
Three LEDs on.
‘d’
Two LEDs on.
‘e’
One LED on.
Table 6. Letter code interpreted at receiver.
5.6.4.8 Fault Tolerance
If the receiver (transceiver in the light control unit) does not receive any character for a
certain amount of time (one minute), this probably might me due to the fact that the sensor
unit is not working correctly, either because of the sensors, the microcontroller, the
transceiver, the photo resistor, the power supply or because of any other issue.
If this happens, the light control unit assumes there is an error situation and turns on two
out of four LEDs.
42
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 6. Requirements and Verifications
CHAPTER 6. REQUIREMENTS AND VERIFICATIONS
This section describes the requirements this project aims to achieve. The R&V table
describes a series of detailed measurements and functionalities that will be verified at the
end of this project to ensure it fulfills all the specified requirements.
Hardware Requirements
1. Ultrasonic
sensors
1. Minimum range
of 1 +/- 0.5 ft.
2. Can detect objects
going at most
30ft/s.
3. Can read values
for at least every
100 +/- 25
milliseconds.
2.
Photo resistor
1. Can detect
variations of
brightness in the
room.
(~5 lux for a dark room,
~80 lux for hallway lights,
and about 400 lux for a
well lit room). Accuracy of
+/- 20 lux
3. Power Supply
1. Supply a voltage of 3.3
+/-0.25 V.
Verification
1) Connect the ultrasonic sensor to the microprocessor. Then
analyze input data to determine the determined distance. Correct
determined distance if different from actual distance by adding
code. Vary distance by +/- 0.5 feet to determine accuracy.
2) We will ride a bike between both sensors at a
known speed (i.e. 10mph). Knowing that they are 3ft away, we are
able to calculate how long the LEDs have to be lit. If the expected
time is within a range of 1 second with respect to the theoretical
amount of time that the LEDs have been turned on, we can then
verify ultrasound sensors work correctly.
3) Connect the sensor to the Arduino. Set the Arduino to display
the sensor readings every 100 milliseconds, using the serial
monitor tool, to ensure there is constant accurate readings.
1) Connect the photo resistor to the microprocessor. Then analyze
the output resistance to determine the resistance for a lit room and
a dark room.
2) Gradually change the brightness in the room, which will
change the output resistance. An LED will be added to show when
the system recognizes if it is
day or night.
1) Measure the voltage in parallel using a DMM and make sure the
voltage swing is less than 0.25V. Measure the current in series
using a 5 ohm resistor again using DMM. Determine if the
observed current is 1A.
2. Maximum of 1A output
current
43
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 6. Requirements and Verifications
Table 7. Hardware requirements and verifications.
Software Requirements
1. Correct Timing
1. Light posts will light at most 0.5 seconds
after a bike is detected.
2. The time the LEDs are lit must vary
according to the speed of the bike.
•
•
•
5 ft/sec, LEDs stay lit for 11 seconds.
2 ft/sec, LEDs stay lit for 26 seconds.
1ft/sec, LEDs stay lit for 52 seconds.
2. Count
1. If only one vehicle in module, all four light
posts will be turned on.
Verifications
1) Start stopwatch when bike crosses sensor 2 and
stop it when first light post turns on.
2) To test this, we will use a bike traveling at
10mph.
Once the LEDs turn on, they have to be for 3.47
seconds, which is the time it takes for a bike
traveling at 10mph to cross 51ft, which is the length
of our module. We will make the LEDs be kept
turned on for an extra second in case speed changes
meanwhile the vehicle is crossing the
module.
1), 2), 3) Verify by testing all 3 situations with
different numbers of vehicles by passing each
number of vehicles across the sensors to determine
the number of LED units lit.
2. If two vehicles in module, only three out of
four light posts will be turned on.
3. If three vehicles in module, only two out of
four light posts will be turned on.
4. If more than three vehicles in module, one
light post will be turned on.
3. Day or night
1) Gradually change the brightness in the room,
1. If lights in room are turned off, the whole
which will
change the output resistance. Check for variable day
in serial monitor output: day=1 means it is daytime,
day=0 means it is nighttime.
system must start working and vice versa.
The whole LED system starts working when day=0
and stops working if the opposite situation occurs.
Allow for 3-second time interval of convergente
when changing from daytime to nighttime.
4. Algorithm
1) Time time taken for vehicle to go
through both sensors. Multiply this by a
factor of 10.5 (theoretical time LEDs
should be turned on). Slightly bigger
1. Test situation where only one vehicle goes
44
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 6. Requirements and Verifications
through module. Primary tag is not substituted.
factor to allow the vehicle to slow
down, assuming not exactly constant
speed in the whole interval.
2) Repeat 1) and time second vehicle
going though at a slower speed. Verify
time LEDs turn off correspond to time
of second vehicle.
3) Repeat 1) and time second vehicle
going though at a faster speed. Verify
time LEDs turn off correspond to time
of first vehicle.
2. Test situation where two vehicles go through
module at different times. Primary tag is
substituted.
3.Test situation where two vehicles go through
module at different times. Primary tag is
notsubstituted.
5. Time and count expiry
1) Check for established time using serial
monitor and start timer to verify the
LEDs turn off at the speficied time
instant.
2) Let four vehicles go by. Verify one.
LED is turned on. No new vehicles go
by. Wait 30 seconds to verify all LEDs
turn off after count time has expired.
1. All LEDs must turn off after the established
time expires. (+/- 1s allowing for computation
and transmission delays).
2. Count returns to zero after no new cars go by
in 30 seconds.
6. Transmission
1) Verify characters sent from sensor
control unit are correctly received at
light control unit.
1. Wireless communication works correctly.
Table 8. Software requirements and verifications.
6.1 SAFETY CONSIDERATIONS
6.1.1 SAFETY STATEMENT
We are planning to test out project using bicycles. Our initial idea is to user four bicycles,
as we consider this amount of bicycles enough to emulate different situations that occur in
a highway. Bicycles belong to both of us, Kevin Obrzut and Maria del Carmen Alvarez.
Any damage our bicycles may suffer will be our own responsibility and the University of
Illinois will not be at fault.
45
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 6. Requirements and Verifications
6.1.2 SAFETY GEAR
The bicycle riders will be wearing a helmet to protect themselves from any kind of damage
in case they fall. No more protection is required due to the low speed the bicycles will be
reaching.
6.1.3 TESTING ENVIRONMENT
To test our project we will use an indoor hallway. We will not allow people to get into the
are where we will be testing our project, to ensure nobody gets injured.
6.1.4 CIRCUIT SAFETY
No high voltage or high current will be used in our project; therefore general lab safety
procedures will be used. Care will be taken when soldering components to prevent getting
burnt. Power supplies will be turned off when modifying any circuit parts.
6.2 ETHICS
Our project follows the IEEE Code of Ethics. We feel the following statements are
especially relevant and we agree:
1.to accept responsibility in making decisions consistent with the safety, health, and
welfare of the public, and to disclose promptly factors that might endanger the
public or the environment;
3. to be honest and realistic in stating claims or estimates based on available data;
6.to maintain and improve our technical competence and to undertake technological
tasks for others only if qualified by training or experience, or after full disclosure of
pertinent limitations;
7. to seek, accept, and offer honest criticism of technical work, to acknowledge and
correct errors, and to credit properly the contributions of others;
46
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 6. Requirements and Verifications
8. to treat fairly all persons and to not engage in acts of discrimination based on
race, religion, gender, disability, age, national origin, sexual orientation, gender
identity, or gender expression;
This means all decisions and operations will be made taking into consideration safety
guidelines and people’s security. Suggestions made by our TAs, professors and peers will
be constructively taken into account. We feel this project will contribute to society by
increasing environmental awareness.
47
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
CHAPTER 7. RESULTS
The system worked as expected, the requirements table was completed with a results
column where each requirement was verified by the TA during the final demonstration.
Hardware Requirements
Verification
1. Ultrasonic sensors
1. Minimum range of
1 +/- 0.5 ft.
1) Different obstacles were places at different distances from the
sensor, up to a certain distance, of 0.6 ft where the obstacle was not
detected.
2. Can detect objects
going at most 30 ft/s.
2) A vehicle going at 30 ft/s was successfully recorded. The timer
should record 0.1s theoretically, but practically it took 0.1452 s.
3. Can read values
3) This was successfully checked using the serial monitor.
for at least every 100
+/- 25 miliseconds.
2. Photoresistor
1.Can detect variations
of brightness in the
room.
1) The LED added to show either day or night successfully turned
on at nighttime and off at daytime, with a convergence time of
approximately 2 seconds.
(~5 lux for a dark
room,
~80 lux for hallway lights,
and about 400 lux for a
well lit room). Accuracy of
+/- 20 lux
3. Power Supply
1. Supply a voltage of 3.3
+/-0.25 V.
1) The output voltage was measured using a voltmeter which
recorded a measurement of 3.315 V.
2. Maximum of 1A output
current
Table 9. Hardware requirements and results.
48
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
Software Requirements
1. Correct Timing
1.
1. Light posts will light at most 0.5 seconds
after a bike is detected.
2. The time the LEDs are lit must vary
according to the speed of the bike.
Verifications
1) Light posts lit with a time difference of
approximately 0.3s.
2) The vehicles going through were tested at
different speeds and the LEDs lit for the expected
theoretical value.
1.
•
•
•
5 ft/sec, LEDs stay lit for 11 seconds.
2 ft/sec, LEDs stay lit for 26 seconds.
1ft/sec, LEDs stay lit for 52 seconds.
2. Count
1), 2), 3) All situations worked as expected.
5. If only one vehicle in module, all four light
posts will be turned on.
6. If two vehicles in module, only three out of
four light posts will be turned on.
7. If three vehicles in module, only two out of
four light posts will be turned on.
8. If more than three vehicles in module, one
light post will be turned on.
3. Day or night
1) At daytime, vehicles passed throught the sensors
1. If lights in room are turned off, the whole
and no output was seen. At nighttime the whole
system started working.
system must start working and vice versa.
4. Algorithm
Scenarios where all of the three situations
happened were tested successfully. The
scenarios in the simulation were tested to
obtain the same output as in the simulation
with a time difference of +0.8s maximum.
1. Test situation where only one vehicle goes
through module. Primary tag is not substituted.
2. Test situation where two vehicles go through
module at different times. Primary tag is
49
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
substituted.
3.Test situation where two vehicles go through
module at different times. Primary tag is
notsubstituted.
5. Time and count expiry
1. All LEDs must turn off after the established
time expires. (+/- 1s allowing for computation
and transmission delays).
2. Count returns to zero after no new cars go by
1) All LEDs turned off with a maximum time
difference of approximately +/-0.8s form
the theoretical time.
2) Let four vehicles go by. Verify one. LED is
turned on. No new vehicles go by. Wait 30
seconds to verify all LEDs turn off after
count time has expired.
in 30 seconds.
6. Transmission
1. Wireless communication works correctly.
1) Both serial monitors were checked
simultaneously to verify the character sent
was the same as the character received.
Table 10. Software requirements and results.
7.1 SERIAL MONITOR TESTING
To verify each invidiual component worked correctly, a series of tests were performed
where the command Serial.print(“”), was very useful to verify each of them worked as
expected. The following section shows how we tested some of the components using this
feature.
7.2 ULTRASONIC SENSOR TESTING
To test all four ultrasonic sensors, we connected these to the digital pins on the Arduino
UNO. By reading the PWM output of the sensors, we were able to display the results of
the distances on the serial monitor of the Arduino software. However, as distance is not
50
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
relevant for our design, we just displayed whether or not the a target was detected by the
sensor. This is demonstrated in the following figure.
Figure 27. Testing the detection of targets in sensor 1 and sensor 2.
The previous figure contains a lot of additional information. The only relevant parts for
this section are the values “s1” and “s2”. When one target is detected in sensor 1, “s1” is
displayed. When another target is detected in sensor 2, “s2” displayed.
51
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
7.3 XBEE TESTING
To test the XBEE wireless communication two XBEEs were connected to two different
Arduino UNO’s. We can serial print the results we want to send on one of the XBEEs,
then see if the other XBEE receives the same characters.
Figure 28. Characters received in LED unit, for XBEE testing.
7.4 PHOTO RESISTOR TESTING
To test our photoresistor, we connected the photoresistor to an analog pin of the Arduino
UNO. The input voltage could then be read and displayed on the serial monitor of the
Arduino software. Figure 30 displays the input voltage which varies, with light brightness,
next to it the value showing whether we consider this value day (1) or night (0).
52
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
Figure 29. Photoresistor testing.
7.5 POWER SUPPLY TEST RESULTS
We needed to ensure that the XBEE, microcontroller, and sensors were operating at 3.3V.
The image below shows the output voltage of the power supply.
Figure 30. Output voltage of power supply.
53
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
7.6 ECONOMIC IMPACT
A public street/road light post, consumes an average of 165W and 4,100 hours of annual
utilization [3]. This means an average light posts consumes 676.5kWh per year. The price
of one kW/h in 2016 is 0.12061€. [4] Taking into account this information, we can deduce,
that the energy consumed by a single light post has a cost of 81.59€ per year.
Two types of highway sections will be considered. One section with low traffic density and
one with high traffic density.
7.6.1 SECTION WITH LOW TRAFFIC DENSITY
We will model the performance of a section of the AP-6 highway. We have chosen a 5km
section, starting from km number 42 to km number 47 because it is an area where traffic is
not very dense; instead it is frequent to see just one vehicle going through part of the
section. Therefore implementing the Smart Highway light posts system, would make a big
difference, as there are many times when the light posts are turned on and not a single car
is driving through.
Figure 31. Highway section to be analyzed.
54
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
According to the previous data, a light posts is turne don an average of 674 minutes per
day. Assuming the average speed of a car going through is 120km/h, the time a the light
posts in the module should lit would be 5.22 seconds, or 6 allowing for speed changes
when driving through the module.
Assuming every light posts in separated 50m [5], the section shown in the previous figure
contains 100 light posts. Every module contains 4 light posts, therefore there are 25
modules. A vehicle driving through the whole section would take 150 seconds to arrive to
the end of the section. The number of light posts turned on during this journey vary if the
system is implemented or not.
•
Scenario A: No system implementation. 100 light posts are turned on during the
entire journey (150 seconds). Note: 150 seconds is equivalent to 0.0417 hours.
The following equations show how much energy (kWh) are consumed by a light
post and by the entire 5km section during the vehicle’s journey.
•
Scenario B: 4 light posts are turned on for 6 seconds (0.0017 hours) for every
module in the section (25). Power changes due to sensor implementation and
XBEE communication are negligible, as they are very small compared to the
current 165 W used by one light post.
55
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
Assuming the total kWh consumption in Scenario A equals 100% and comparing it to the
same variable in scenario B, it can clearly be seen that the amount of energy consumed has
been reduced by approximately 96%.
As stated previously, the amount of energy consumed by a single light post has a cost of
81.59€ per year, which in sections where traffic is not dense, it can be reduced 96% to a
value of 3.26€ per year. Therefore, a single module containing four light posts would have
a cost of 13.04€ per year instead of 326.36€.
7.6.2 SECTION WITH HIGH TRAFFIC DENSITY
Our system implements an algorithm which takes into account the number of vehicles
inside a module. When the number of vehicles insides the module is larger or equal to four,
only one light post in the section is turned on, to try to make use of light emitted by the
vehicles present in the module, serving as a guide to other vehicles behind them.
This means that instead of having four light posts turned on in a module, only one would
be turned on, thus, reducing energy consumption by 75%. Therefore, the amount of energy
consumed by a single light post would be reduced from 81.59€ per year to 20.40€ per year.
Therefore, a single module containing four light posts would have a cost of 81.06€ per year
instead of 326.36€.
7.7 ENVIRONMENTAL IMPACT
In the previous section, we have found that implementing the Smart Highway light posts
system can have a large economic impact. Using the same scenarios, we can conclude that
in areas with a small amount of traffic, the annual consumption of a single light post will
56
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 7. Results
be reduced from 676.5kWh to 27.06kWh. In areas with a large amount of traffic, this value
can be reduced to 169.125kWh.
The amount of energy saved for one light post in the first case (649.44kWh) implies a
reduction of approximately 422.136 kg of CO2. In the second case, areas with high traffic
density, the amount saved (507.375kWh) reduces the amount of CO2 emitted by 329.794
kg. [6] In a module, containing four light posts, carbon dioxide emission would be reduced
from 1758.9 kg to 70.356 kg and 439.725 kg, respectively.
Traditional lighting system.
Smart Highway Light Posts
(per module)
system. (per module)
Annual energy consumption
2,706 kWh
108.24 kWh
Annual CO2 Emissions
1758.9 kg
70.359 kg
Emissions reduction
1688.541 kg
Table 11. Smart Highway Light Posts environmental impact in areas with low traffic density.
Traditional lighting system.
Smart Highway Light Posts
(per module)
system. (per module)
Annual energy consumption
2,706 kWh
676.5 kWh
Annual CO2 Emissions
1758.9 kg
439.725 kg
Emissions reduction
1319.175 kg
Table 12. Smart Highway Light Posts environmental impact in areas with high traffic density.
57
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 8. Conclusions
CHAPTER 8. CONCLUSIONS
The work produced this semester is a robust starting point to a change in public lighting
systems for highways. In this chapter we will go over our project accomplishments and
how our final version differed from the initial one, as well as how the project can be
developed and improved in the future.
8.1 ACCOMPLISHMENTS
Our final version satisfied all the requirements from out requirements and verifications
table. All of our software side requirements were successfully verified. However, the
power supply did not work when connected to the entire system, but it did work
independently. This might be due to the fact that we had some issues when soldering
connections, which did not allow us to demo the project on a large scale as expected. This
might have been due to the large distances our connections had to have.
We therefore had to demonstrate the software side worked correctly, by placing all the
components in the white board. Once this was carried out, we were able to demonstrate all
six software requirements worked as expected.
This system allows modules to adapt to any error occurring in neighboring modules.
Wireless communication makes this an easy feature to implement, allowing for further
development; due to the letter code which right now only implements 6 out of 26 possible
letters containing different instructions.
As stated in the previous section, the economic and environmental impact of this system
would be very noticeable if implemented in highways, especially in those areas where the
amount of traffic is relatively small. The following figures illustrate this idea.
58
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 8. Conclusions
Figure 32. Economic impact of one module with and without implementing S.H.L. (Smart Highway Light
Posts).
Figure 33. Environmental impact of one module with and without implementing S.H.L. (Smart Highway
Light Posts).
59
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 8. Conclusions
Knowing that for one module in an area with little traffic, 313.32€ are saved in a year by
implementing the Smart Highway Light Posts system, combined with the fact that the
initial investment needed for one module totals 176.79€, we can conclude that
implementing our system will be profitable in less than a year. The same occurs in areas
where traffic is dense, as 245.30€ would be saved in a year which still makes it profitable
in less than a year, compared to the initial investment.
Traditional lighting system.
Smart Highway Light Posts
(per module)
system. (per module)
Annual energy cost
326.36€
13.04€
Cost of implementation
-
176.79€
Total cost (first year)
326.36€
189.83€
Balance
136.53€
Table 13. Smart Highway Light Posts viability in areas with low traffic density.
Traditional lighting system.
Smart Highway Light Posts
(per module)
system. (per module)
Annual energy cost
326.36€
81.06€
Cost of implementation
-
176.79€
Total cost (first year)
326.36€
257.85€
Balance
68.51€
Table 14. Smart Highway Light Posts viability in areas with high traffic density.
60
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 8. Conclusions
The following table contains all the economic and environmental benefits of implementing
the Smart Highway Light Posts system (per module), during the first year. Using the
theoretical values explained in previous chapters, the table compares both sections with
low and high traffic density.
Low traffic density
High traffic density
2,597.76 kWh
2029.5 kWh
CO2 emissions reduction
1688.541 kg
1319.175 kg
Costs reduction
136.53 €
68.51 €
Energy consumption
reduction
Table 15. Benefits of our system’s implementation during the first year (per module).
61
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 8. Conclusions
8.2 FUTURE WORKS
The next phase in the development of the project would be to scale up the already existing
model to adapt it to highway metrics. The first changes to be made include altering the
distances between components to ensure light posts are separated 50 m. The new distances
are illustrated in the following figure.
Figure 34. Separation distances of a scaled version of a S.H.L. module.
Figure 35. Four modules in series.
62
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
Chapter 8. Conclusions
Figure 36 shows how four modules connected in series would look like. The sensor
detection area is two meters long and allows all light posts to be separated 50 meters.
To allow communication to be established between modules, the previously chosen
transceiver model (XBEE 2mW) should be substituted by a transceiver with a larger scope,
because the one that has been used in our implementation has a 120 m scope, which is not
enough for neighboring modules to communicate. A good alternative for a larger scale
model would be any XBEE Pro that has a scope of up to one mile. This will allow
communication between modules with larger distances between them; however, it is not
clear whether or not interference between modules would occur. The study of interfering
modules is out of the scope of this project.
Another future objective is the development of a second module to develop more error
prone functionalities. An example of an error functionality to be added can be the
following:
•
Error scenario: Sensor unit in module 1 goes down. The light control unit XBEE
from module 1 should send a character ‘g’ to the sensor unit XBEE from module 2
if no characters from the sensor control unit from module 1 are received (indicating
something is not working as specified in the sensor control unit). This would allow
the sensor unit from module 2 to adopt a specific behavior under this error
situation.
63
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
64
UNIVERSIDAD PONTIFICIA COMILLAS
ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA (ICAI)
GRADO EN INGENIERÍA TELEMÁTICA
References
REFERENCES
[1]
US Energy Information Administration, “How much energy is used for lighting in the
United States?”, June 2016. https://www.eia.gov/tools/faqs/faq.cfm?id=99&t=3
[2]
Ministerio
de
fomento,
Gobierno
de
España
“Evolución
desde
1970”,
http://www.fomento.gob.es/MFOM/LANG_CASTELLANO/DIRECCIONES_GENERAL
ES/CARRETERAS/CATYEVO_RED_CARRETERAS/EVOLUCION/
[3]
[3]
Ponce
L.,
“PROYECTO
CONTAMINACIÓN
FIN DE MÁSTER: ESTUDIO DE LA
LUMÍNICA
ALUMBRADO
Y
EFICIENCIA
EXTERIOR”,
ENERGÉTICA
Septiembre
EN
2014,
http://repositorio.upct.es/bitstream/handle/10317/4539/tfm382.pdf?sequence=1
[4]
“Precio kWh electricidad”, Junio 2016, www.comparadorluz.com
[5]
Escala de Google Maps, www.googlemaps.com
[6]
“Cómo se calcula”, http://arboliza.es/compensar-co2/calculo-co2.html
[8]
“Illuminating
cities
with
sustainable
smart
lighting
systems”
http://www.theguardian.com/sustainable-business/sustainable-smart-lighting-systems-cities
[9]
“Studio
Roosegaarde
–
https://www.studioroosegaarde.net/project/smart-highway/info/
[10] “Solar Roadways” http://www.solarroadways.com
65
Smart
Highways”