<<

LI-FI APPLICATION USING AMBIENT LIGHT SENSOR

A Project

Presented to the faculty of the Department of Computer Science

California State University, Sacramento

Submitted in partial satisfaction of the requirements for the degree of

MASTER OF SCIENCE

in

Computer Science

by

Khushal Shingala

FALL 2019

© 2019

Khushal Shingala

ALL RIGHTS RESERVED

ii

LI-FI APPLICATION USING AMBIENT LIGHT SENSOR

A Project

by

Khushal Shingala

Approved by:

______, Committee Chair Dr. Xuyu Wang

______, Second Reader Dr. Jingwei Yang

______Date

iii

Student: Khushal Shingala

I certify that this student has met the requirements for format contained in the University format manual, and this project is suitable for electronic submission to the library and credit is to be awarded for the project.

______, Graduate Coordinator ______Dr. Jinsong Ouyang Date

Department of Computer Science

iv

Abstract

of

LI-FI APPLICATION USING AMBIENT LIGHT SENSOR

by

Khushal Shingala

Light is the fastest medium that data can be transferred through. Potential transfer speeds are 1000 times faster than waves can achieve. NASA claims to have had success with transferring data from spacecraft to earth and back using lasers. Space-X plan to use lasers for inter communication in their satellite network and MARS missions. This is the revolution of Li-Fi communication technology. After analysis and study of such technologies, it appears that there were certain imitations to the idea of Light fixture to phone camera data transfer. So, I’m introducing Ambient light sensor approach over camera.

The goal of this project is to deliver the working actual pathway for the development of a Li-Fi system that could later be adapted to the manufacture of LED lighting systems and integrated to be used with mainstream hardware. For this project, an was the easiest way to implement a PC to output connection. A commercial cool white LED was selected for Li-Fi waves due to the centered and even light spectrum it emits. On receiver side, I used ambient light sensor which is also widely v

available in all . Previously, this sensor was not used for Li-Fi communication because of very low sampling rate. So, I’m using sampling rate adjustment property to identify each transmitted signal uniquely. In this project, I’m proposing how to modify frequencies that LED transmits, how to calibrate Ambient light sensor sampling rate and how to handle the environmental noises. So that, we can identify and prove a sensor pathway that will allow the clean and rapid sample rates that we are seeking for Li-Fi communication.

______, Committee Chair

Dr. Xuyu Wang

______Date

vi

DEDICATION

To My Parents

vii

ACKNOWLEDGEMENTS

I thank my professor, Dr. Xuyu Wang, for his guidance and encouragement throughout the project. I thank him for helping me to shape my project idea and giving me good feedback at every step of the project.

I thank professor, Dr. Jingwei Yang for reviewing my report and encouraging me.

Lastly, I would like to thank my parents for trusting me and encouraging me to achieve my goals.

viii

TABLE OF CONTENTS Page

Dedication ...... vii

Acknowledgements ...... viii

List of Tables ...... x

List of Figures ...... xi

Chapter

1. INTRODUCTION ……………………………………………………………… 1

2. LITERATURE REVIEW ...... 4

3. TECHNOLOGIES USED ...... 6

4. OVERVIEW ...... 8

5. SYSTEM ARCHITECTURE ...... 16

6. BIT MAPPING ...... 20

7. ASCII MAPPING ...... 33

8. ALTERNATIVE EXPERIMENTS ...... 37

9. CONCLUSION ...... 42

10. FUTURE WORK ...... 43

References ...... 45

ix

LIST OF TABLES

Tables Page

1. Specifications ...... 19

2. Environment Light Analysis ...... 22

x

LIST OF FIGURES

Figures Page

1. Li-Fi Technology ...... 8

2. Illuminance and Luminance ...... 11

3. 10w Cool White LED ...... 12

4. 5mm Cool White LED ...... 13

5. 10w RGB LED ...... 14

6. Ambient Light Sensor ...... 15

7. System Architecture ...... 16

8. Setup ...... 18

9. Demodulation Workflow ...... 21

10. Arduino And Smartphone Setup ...... 24

11. Decoding Algorithm ...... 25

12. Result Snippet from Smartphone ...... 26

13. 10mm LED – Brightness Vs Distance for Bit 0 ...... 27

14. 10mm LED – Brightness Vs Distance for Bit 1 ...... 28

15. 15mm LED – Brightness Vs Distance for Bit 0 ...... 28

16. 15mm LED – Brightness Vs Distance for Bit 1 ...... 29

17. Bit Error Rate For 10mm LED ...... 30

18. Bit Error Rate For 15mm LED...... 30

xi

19. Angle Vs Brightness For 10mm LED ...... 31

20. Angle Vs Bit Error Rate For 10mm LED...... 32

21. Decoded Data ...... 36

22. 5mm Cool White LED Setup ...... 38

23. 10w RGB LED Setup...... 40

xii

1

Chapter 1: Introduction

Data transfer and communication are one of the activities of our daily activities.

Where we mostly use Bluetooth and Wi-Fi technologies. But, speed of Bluetooth is 3 Mbps or above and speed of Wi-Fi is 1300 Mbps or above, which are very limited. Currently all communication cannot communicate with multiple devices at a time with same speed due to its fixed . To resolve these issues, Professor Harald Hass who is the researcher in mobile and , gave the ideology of transmitting the data using visual light spectrum (380-740 nanometers). He proposed that how usual household

LED bulb can provide the to multiple computer systems with speed up to 224 Gbps. This proposed innovation got famous as Light-Fidelity (Li-Fi).

It is a specific range remote communication technology dependent on LED light, and utilize the light spectrum as a data packets rather than conventional as in Bluetooth or Wi-Fi. Now, the applications and innovations towards Li-Fi communication is revolutionary increasing. I have studied an IEEE paper “CSI-based fingerprinting for indoor localization: A deep learning approach” [1], which mentioned that

Li-Fi communication can be used for Indoor Navigation. Indoor Navigation uses the indoor ceiling LEDs, where LEDs can send its position data. We can also use light's directional property and intensity to map the smartphone's current location and increase the accuracy at several centimeters. This can replace the static indoor maps, cost of mapping the position nodes and limited application of Global (GPS). Currently, innovations in Li-Fi are increasing in area of underwater communication, augmented reality, cellular

2 communication, etc. Due to its speed and encoding feasibility, Li-Fi can have mode data transfer security than Radio Frequency.

There is not much research work available in Ambient Light Sensor (ALS) direction to accommodate the Li-Fi properties and applications. So, I have created the algorithms to transfer the data using low voltage LEDs and solution for sampling rate. Also, how can we increase the transfer speed and adaptiveness.

In this report, I'm proposing the Li-Fi approach using Ambient Light Sensor (ALS).

Due to increased availability and lower cost of Ambient Light Sensor in current smartphones, we can enable the efficient and feasible Li-Fi demodulation. For demodulation part, we can establish a communication channel by dynamically mapping the sampling rate with light frequencies. We can distinguish different characters in data packets using reading light intensity property of ALS. Using that feature, we can demodulate the data packets on smartphone end. We can also map each data packets to specific brightness level to increase the transfer speed.

We are covering following topics in this report: Chapter 2 focuses on more of existing innovation in this field. Chapter 3 describes on the which technologies being used.

Chapter 4 focuses on the how Li-Fi technology can change the data transfer speed and what components will be needed. Chapter 6 explains the system architecture. Chapter 6 and 7

3 discusses about different approaches of Li-Fi. Chapter 8 is alternative experiments being conducted. chapter 9 and 10 are summary and future work.

4

Chapter 2: Literature Review

Li-Fi is a wireless innovation holds the way to explaining difficulties looked by 4G and 5G technologies. Li-Fi can send data at Gbps speed, is progressively feasible as we can use regular household LEDs, it doesn't require special hardware setups and exceptionally more secure than radio waves, for example, Bluetooth or Wi-Fi. In this chapter, I’ll mention the application related few Li-Fi and Ambient Light Sensor articles and their methodologies.

An IEEE paper "Visible Light Communication" [2] stated that even if we get succeeded to achieve very high data transfer speed through Light, we should have receiver device that is capable enough to process light signals at speed of transmission. Until now, we have used the radio waves or where there is no human, we used signals. Which can be helpful if we want to send the signals throughout the concrete walls. Whereas Li-Fi only works where light can reach. But Li-Fi is more secure than traditional transmission signals.

Another SPIE survey paper "Research on visible light communication system based on white LEDs" [3] gave research analysis on white LED usage for Li-Fi system. This paper mentioned an overlook of LEDs structure proposal, transmitter and receiver channel.

Authors were using the array of LED output pins to gather the data and their results mentioned that issue of distance can be resolved with LED diameter change.

5

Ambient Light Sensor based on IEEE paper 'ALS-P: Light Weight Visible Light

Positioning via Ambient Light Sensor' [4] mentioned that LED frequency rate of modulated

LED is about 1000Hz. But, because of smartphone's processing limitations, Ambient Light

Sensor's sampling rate is low as about 100hz. The researchers evaluated the one light bulb results, duty cycle of one transmitted bit was 50% and transmitted frequencies were around

1000Hz, 1500Hz and 1700Hz. As they increased the distance from 0.5m to 4m, received light intensity were decreased from 2000 lux to almost 50 lux.

6

Chapter 3: Technologies Used

In this chapter, I’ll explain about the technologies that I used throughout of my project’s implementation. I have used ‘Java’ programming language for developing the android application that works as a receiver.

Java:

Java is a programming language which is object-oriented with very low dependencies on systems. Once you compile the Java code and create the class file, it can be run on any system and platform according to security. Java uses Java Virtual Machine which supports the compiled Java bytecode. In my project, I used java to communicate with android smartphone sensors.

Android Studio:

Android Studio is the product of JetBrains’ IntelliJ IDEA platform, which is used to develop the android smartphone application for Google’s operating system. It is widely used by Android developers. This tool made everyone to move from Eclipse platform.

Developers can work on this tool with any operating system like and Windows.

Arduino UNO:

Arduino Uno is the product of Arduino.cc. It is the ATmega382P based single board which works as microcontroller. It works on 5 to 20 volts power supply or USB cable. It is

7 equipped with total 20 digital and analog input and output pins. Arduino developer can program it into PC (Arduino IDE) via USB connection [5].

8

Chapter 4: Overview

4.1 Li-Fi:

Wi-Fi is of significant use for general wireless inclusion within building, while Li-

Fi is perfect for high thickness wireless information inclusion in confined zone. Also, particularly valuable for applications in territories where radio obstruction issues are of concern, so the two innovations can be viewed as contradictory to each other.

Figure 1: Li-Fi Technology [6]

As Shown in Figure 1, Li-Fi gives better performance than Wi-Fi and has as of now accomplished high speeds bigger than 1 Gbps under the research center conditions.

Whereas speed of Wi-Fi is about 150Mbps and speed of Bluetooth is about 5Mbps. By

9 utilizing the ease of configuration and property of LEDs and lighting units, there are heaps of chances to abuse this technology.

Why Li-Fi: -

Different frequency range that is accessible to us in the climate comprises of many wave areas like Infrared, radio, UV light, X-rays, Visible waves, and so on. Any of the above waves can be utilized in the up and coming correspondence innovations, but the explanation for this is the lower health issues and simple availability of light compared to other frequencies. Li-Fi utilizes the obvious light between 400 THz and 800 THz as medium which are for high-control applications and furthermore people can undoubtedly see it and shield themselves from the hurtful impacts though the other waves.

Current issues with traditional wireless technologies like Wi-Fi and Bluetooth (Radio waves) are:

1. Performance: It takes big amount of energy to operate cellular or Wi-Fi base

stations. Whereas, we can use household LED's frequency which is available easily

in offices and halls. That can help us to reduce the energy consumption.

2. Security: Radio frequency can be used over the different rooms. It can be misused

by intercept in transmission. But LED illuminance is only available in specific

structure and it cannot be used outside the operating area.

10

Application areas of Li-Fi: -

1) Underwater communication

2) Cellular connections

3) Communication in sensitive areas like power plants

4) Education system

5) Fast data transfer between earth to space

4.2 Illuminance and Luminance

To get the readings from light or intensity of light through different light sensors like photo registers and ambient light sensors, we must understand the lighting terms that sounds very similar, but they have very different applications. Those two almost similar terms are Luminance and Illuminance as shown in Figure 2.

Illuminance:

We can describe the measurement of illuminance term by the amount of light spreading/illuminating over an object or specific area. Illuminance additionally corresponds with how people see the light intensity of an enlightened zone. Thus, the vast majority utilize the terms illuminance and light intensity reciprocally which prompts misunderstanding, as light intensity can likewise be utilized to portray luminance. To explain the distinction, illuminance alludes to power of light falling onto a , while light intensity alludes to the visual observations and physiological vibes of light. light intensity isn't a term utilized for quantitative purposes by any means.

11

Figure 2: Illuminance and Luminance [7]

Luminance:

Once we illuminate any object or any surface, it reflects some amount of light according to surface color, material property and reflection angle. It likewise shows how a lot of glowing force can be seen by the naked eye. This implies luminance shows the intensity of light generated or reflected off a surface. In the technology of display devices, luminance is utilized to measure the light intensity of display screens.

We can measure the luminance in the SI unit candela/square meter (cd/m2). Where measurement unit for illuminance is lux. In the U.S. people also used the foot-square unit to measure the amount of light per area.

12

4.3 LEDs

Throughout the implementation of my experiments, I have used different kind of LEDs.

Which serves different purposes in terms of light intensity, bandwidth and illuminance range. Following are the list of LEDs which were helpful:

1) 10w Cool White LED:

To blink the LED at very high frequency, we must make sure that LED

won’t catch the heat and reduce the environment noises. Figure 3 shows the light

weight 10w LED which bright with cool white up to 850lm luminous flux and

needs 9-11V power supply and around 300mA current to function.

Figure 3: 10w Cool White LED

13

2) 5mm Cool White LED:

To conduct an experiment on how different LED affects the Ambient Light

Sensor adaptiveness over distance, we used small 5mm cool white LED as shows

in Figure 4. This LED works on 3.0V and 20mA current. This LED works clearly

until +/- 12 degrees angle.

Figure 4: 5mm Cool White LED

3) 10w RGB LED:

To conduct another experiment with different colors and how they affect

the Ambient Light Sensor’s lux values, we used 10w Red, Green and Blue color

LED as shown in Figure 5. This LED bright with RGB up to 850lm luminous flux

and needs 6-7V power supply for Red, 9-11V power supply for Green/Blue and

around 300mA current to function.

14

Figure 5: 10w RGB LED

4.4 Ambient Light Sensor (ALS)

Now a days, an Ambient Light Sensor is available on every smartphone and portable communication devices in the world. This sensor is being used to detect the ambient light intensity from the surrounding environment and using those values, smartphone can adjust its brightness. It helps to increase the battery efficiency. Also, at night it helps to protect the user’s eyes from too much brightness, increase the readability in sunny environment.

For experimental use cases, we can use photodiodes and photodetectors, which gets the value of environment light and passes to the connected display devices.

15

Figure 6: Ambient Light Sensor [8]

Ambient Light Sensor as shown in Figure 6, measures the light intensity in ‘lux’ unit. With 10w cool white LED, we detected the light intensity from 3-4 lux to 50000-

60000 lux. Functionality of this sensor is different than human eye. Human eye will be stretched in case of different wavelength than visible light, which is infrared and ultraviolet lights. Whereas, photodetector detect more light intensity between 350 to 1150 nm wavelength.

16

Chapter 5: System Architecture

5.1 Architecture

In chapter 4, we have discussed the necessary hardware that will require to setup the Li-Fi system. In this chapter, we will discuss the system architecture, how to setup the transmitter, receiver and specification of receiver.

As system architecture shown in Figure 7, it works on bitmap approach to send the message thought the Li-Fi. On transmitter end user will send the message in ASCII characters. Transmitter will convert those each character into 8-bit binary data. Transmitter is designed to convert those binaries to digital wave form to broadcast the message over visible light.

Figure 7: System Architecture

On the receiver end, we have the android smartphone with Ambient Light Sensor.

Smartphone application is designed to detect those digital wave form in form of light signals. Sensor will provide the exact values of light intensity to the calibration and

17 decoding algorithm. Decoding algorithm works on base of light intensity ranges for logic states 0 and 1. As a result, android application will convert the decoded signals into 8-bit binary form and those into ASCII characters.

5.2 Transmitter Setup

To transmit the message in digital wave form, we need a LED setup which we can configure according to modulation algorithm.

We have used following hardware components:

• 1 x 10w cool white LED

• 1 x Tip122

• 1 x 1k Ω resistor

• 1 x breadboard

• 1 x Arduino Uno

• jumper wires

As shown in below Figure 8, we have connected the hardware components as follows:

• Connected the breadboard power and ground rails with Arduino power.

• Connected the 10w cool white LED to the Arduino pin number 9.

• To control the LED illuminance and voltage, we added Tip122 transistor.

• To operate the 10w cool white LED, we need 12V power supply, where one

end of LED is connected, and one end is connected to Tip122 transistor.

18

• Other end of transistor is connected to the ground.

Figure 8: Transmitter Setup

19

5.3 Receiver

To receive the digital signals, we have android smartphone and its specifications are as below:

1. Android operating system version: 8 or above.

2. RAM: 4GB or higher

3. Root Permission

Table 1: Samsung Galaxy S9 Specifications

Network Technology Enhanced 4x4 MIMO/CA, LAA, LTE OS Android 8.0 (Oreo) Platform Chipset 10nm 64-bit Processor 2.8GHz + 1.7GHz CPU Octa-Core Memory Internal 4 GB RAM Features Sensors Ambient Light Sensor Battery 3000mAh

In Table 1, We mentioned the specifications of the Android smartphone which we used for this project which is Samsung Galaxy S9. The sensor we used to collect the experiment data is Ambient Light Sensor (ALS).

20

Chapter 6: Bit Mapping

6.1 LED Modulation

For LED modulation, I used On Off Keying (OOK) modulation. OOK is simply amplitude-shift keying (ASK) modulation that shows digital data transmission high or low carrier frequency. Implementation of OOK modulation is very low cost and less energy consumption due to IDLE condition of zero logical state. It's a simple on and off transmission method to create data bits that can be decoded easily. Using these properties of OOK modulation, we can transmit the logical state of 1 and 0 bit through LED light.

Our first LED modulation algorithm is based on analog to digital binary transmission system. We have configured 10W cool white LED to two different brightness levels that can be noticed easily by human eye or light sensors like photo registers and ambient light sensor. Arduino board was setup to get serial data in ASCII format from the input device (PC). Our modulation algorithm will pull out those ASCII characters from serial queue. Therefore, ASCII characters will be converted from Decimal to 8-bit Binary array formation. Here, we will use those binary array data to fill out the LED blinking.

Using two LED brightness level configuration, we can transmit the 0 logical state with low

LED intensity and 1 logical state with high LED intensity.

To differentiate the LED blinking intensity, we must set the LED brightness for specific amount of time. This time can be utilized to recognize the LED intensity and

21 process the logic state of data. Also, we must insert the delay between two LED blink. So that, we can adapt the LED brightness into lux ranges of 0s and 1s.

6. 2 Demodulation:

As shown in Figure 9, to demodulate the data transfer over LED frequencies, we are proposing the algorithms to calibrate the ambient light sensor over different environment conditions, distance and angle between LED to sensor. Also, we created an algorithm to decode the modulated LED data.

Figure 9: Demodulation Workflow

Calibration over environment conditions:

We have conducted few experiments through the day in different time periods. We observed that ambient light sensor detects the different background intensity. In the following table, observation of environment noise is mentioned.

These noises can majorly affect the LED intensity detection and it can increase the

Bit Error Rate (BER). So, we came up with algorithm that will configure the sensor to adapt minimum and maximum threshold values that can't be interfere in data transmission.

22

At the beginning, sensor will read the environment lights and create an observation array for specific amount of time. Later, application will find what was the minimum and maximum value it observed from an array.

The data showed in Table 2 is used in application, we are analyzing environment light to set the minimum luminance threshold value for sensor to stop reading the data. You can’t avoid this interference. The only way to work is to have LED setup with more stable luminance throughout the broadcasting area.

Table 2: Environment Light Analysis

Timelines Environment Light (lux) Indoor (9-10 AM) ~70-90 Indoor (2-3 PM) ~110-130 Indoor (5-6 PM) ~85-105 Indoor (8-9 PM) <3

23

Calibration over different distance and angle:

Two more things that can affect the LED demodulation are distance and angle.

After environment noise configuration, LED will transmit the 8-bit binary of 0s and then another 8-bit binary of 1s. In parallel, application will ask user to move the smartphone two times for configuration of 0s and 1s. Application will create an observation data from closest distance to far until it can detect the LED blink.

After calibration of distance, LED will transmit the same number of 0's and 1's binary to calibrate the sensor over different angle of LED. Application will ask user to move the smartphone from 45 degree to 135 degree and create the data to process further.

Now, we have the observation data of different distances and angles. Application will run another tread to adopt the minimum and maximum threshold lux values for logical state 0 and 1.

24

Figure 10: Arduino And Smartphone Setup

As shown in Figure 10, we have configuration of smartphone at 10-inch distance with very less environment noise. In the bottom we have transmitter setup with Arduino and 10w cool white LED which is blinking. And on top at a 10-inch distance, we have configured android smartphone.

Decoding algorithm:

After sensor calibration module, now application will have threshold values to determine if light illuminance is 0 or 1. On transmitter end, user will send the ASCII data over Arduino serial input. While on smartphone receiver side, sensor will detect the light intensity throughout two parallel treads.

25

Figure 11: Decoding Algorithm

As shown in Figure 11, on one thread each time when sensor value will reach to range between minimum and maximum lux value, application will convert those values into logic state 0 and 1 bit. After that, those binary array will be transformed into ASCII value strings.

On other thread, application will observe the data until environment threshold. This thread will make sure application won't process the noisy data and decrease the error rate.

26

6.3 Results and Analysis

After configuration of android application, we sent a string a string of ASCII characters like “heyyy how are you” from Arduino IDE to LED. As shown in Figure 12, it started receiving the binary signals, converted those to ASCII message through decoding algorithm and display on the textbox.

Figure 12: Result Snippet from Smartphone

With 10mm LED, we were able to decode the message up to certain distance.

Reason behind this is that as distance increases between LED to smartphone, illuminance

27 range for 0 and 1 started to overlap. As shown in Figure 13, if we use the 10mm LED then brightness range for 0 can work from 120 to 600 lux.

Figure 13: 10mm LED – Brightness Vs Distance for Bit 0

Using 10mm LED, achieved brightness range for 1 is from 630 to 1400 lux as shown in Figure 14. In this case, adaptiveness of application can be achieved up to 10-15- inch distance.

28

Figure 14: 10mm LED – Brightness Vs Distance for Bit 1

We conducted few experiments with 15mm LED to verify if adaptiveness of application increases as we increase the distance more than 15-inch. As shown in Figure

15, if we move the smartphone from 10-inch to 25-inch, brightness range for 0 can work from 690 to 1000 lux.

Figure 15: 15mm LED – Brightness Vs Distance for Bit 0

29

With 15mm LED, we have configured the brightness range for 1 from 1100 to 2500 lux as shown in Figure 16. If we use bigger LED than 10mm, then we can achieve the adaptiveness up to 20-25inch distance.

Figure 16: 15mm LED – Brightness Vs Distance for Bit 1

In the experiment of 10mm LED and 15mm LED with 10 to 35-inch distance, we sent around 700 bits of data from the transmitter. As a result, we have received the different amount of data on smartphone end. From analysis of the received data, we found that Bit Error Rate (BER) is increasing as distance is increasing.

30

Figure 17: Bit Error Rate For 10mm LED

As we can see in Figure 17 and 18, with 10mm LED BER started to increase from

15-inch distance. While BER for 15mm LED is still 0% and it started to get increase at

2% from 20-inch distance.

Figure 18: Bit Error Rate For 15mm LED

31

After 30 to 35-inch distance, both LED cannot be used as BER reached to 100%.

To resolve this issue, we need bigger LED as communication range increases between transmitter and receiver. In this experiment, we almost achieved 0% BER at certain distances. But data transfer speed is very slow compared to ASCII map approach.

Figure 19: Angle Vs Brightness For 10mm LED

During our experiment of keeping smartphone at different distances, we found that as we are changing the angle from the LED to the smartphone, brightness value is changing as shown in Figure 19. This is happening because LED surface is flat and can only transmit the full brightness to 90-degree direction.

We conducted an experiment with different angle of smartphone to 10mm LED flat surface from 90-degree to 30-degree. On the 90-degree angle, we were receiving brightness level 600lux for bit 0 and 1400lux for bit 1. As we move the smartphone to 30-degree angle

32 with same distance to LED, brightness level got decreased drastically. For bit 0, we received 220lux and for bit 1 value was 580lux.

Figure 20: Angle Vs Bit Error Rate For 10mm LED

As we saw in Figure 17 and 18, if brightness value decreases then Bit Error Rate

(BER) increases due to overlap between values. Same results we have seen during the experiment for different angles. As shown in Figure 20, we moved the smartphone position to 30-degree angle, brightness value for bit 0 and bit 1 got decreased and equally proportional BER value got increased,

33

Chapter 7: Ascii Mapping

7.1 LED modulation:

For second experiment, our goal was to achieve a higher data transfer speed over light. For that we need modulation technique which can transmit all ASCII characters instead of just 0 and 1 binary. So, we came up with modulation algorithm using FSK

(Frequency shift Keying) modulation. FSK is modulation technique which transmits the digital data over a different frequency configuration of carrier signals. This modulation can be used in sending urgent messages and radio broadcasting where faster data transfer needed.

An Arduino was set up to convert serial data into light signals, that change according to their value. Our second modulation algorithm is based on hash mapping modulation of LED brightness for each ASCII characters. This algorithm employs a method of different light intensity levels carved up into 255 sections, that represent the

ASCII table. The first ASCII character represented at the lowest level of brightness, and the last ASCII character being the brightest.

34

7.2 Demodulation:

Once we configured the LED with FSK modulation, it will blink according to serial input of Arduino. On the smartphone receiver side, application will register the ambient light sensor. When LED blinks, sensor will sense the values of light intensity and according to range of lux values configured, it will display the associated ASCII characters.

In the beginning we were sending the data without any delays to achieve the data transfer speed. But LED won't be able to change the brightness frequency that faster and corresponding Ambient light sensor will not be detect the intensity with that efficiency due to LED diminishing effect. This was causing the higher Bit Error Rate (BER) and less efficiency. To configure the delays in LED blinking, we are blinking the LED for 50ms and added the delays between each 10 ASCII characters for 200ms. This will reduce the

LED diminishing effect and decrease the Bit Error Rate.

During initial experiments, we configured the LED brightness level from 1 to 255.

So that, we can transfer the data over small span of light intensities. But, when we were receiving the light, sensor will not be able to differentiate the ASCII characters. Because of very low ranges of illuminance values corresponding to each character. So, we conducted few more experiments with different minimum and maximum brightness ranges

(which we can divide into 255 evenly for each characters). But Ambient light sensor will not efficiently work for all 255 characters at specific distance. So, we came up with minimum character of "!" (ASCII value 33) and maximum character of "DEL" (ASCII

35 value 127). According to indoor environment with very low background noise, minimum brightness value is 50, then in increment of 2 for each ASCII value, maximum brightness value is 236 for Arduino to write.

One more variable that is affecting the most is distance between LED and smartphone sensor. When LED blinks with specific illuminance, as we move the smartphone from LED to further away, sensor value was decreasing. So, to configure the illuminance range for each ASCII characters in application, we had to conduct many experiments and gathered the data for various distance according to each character.

After analysis of all the data, we configured the android application with luminance range with following algorithm:

1) If light meter reading = 0.5 then ascii character = “!”

2) Meter reading increases in increments of 5 digits per ascii character number

3) Generate the ASCII characters according to light meter readings

36

7.2 Results and Analysis

After configuration of the LED at fix blink rate according to each ASCII characters, we sent continuous range of 1s and 8s for experiment.

a) Decoded data for 1s b) Decoded data for 8s

Figure 21: Decoded Data

As a result, shown in Figure 21a and 21b, we received the string of ASCII characters, which brightness value range is near the 1 and 8. BER is very uncertain due to

ASCII to lux mapping of each character. As we move the smartphone to +/- 5mm, BER got increased and we can not sanitize the result. In this experiment, there is very high BER compared to Bitmap approach, but data transfer speed is very high.

37

Chapter 8: Alternative Experiments

8.1 Experiment with 5mm LED

Initially, we started with 5mm LED approach to prove the concept of Li-Fi. Here, we will explain the setup of 5mm LED, how it works and results.

System setup:

We have used following hardware components: -

• 1 x 5mm LED

• 1 x 330 Ω resistor

• 1 x breadboard

• 1 x Arduino Uno

• jumper wires

As shown in above Figure 22, we have connected the hardware components as follows: -

• Connected the breadboard power and ground rails with Arduino power.

• Connected the 5mm LED to the Arduino pin number 9.

• To control the LED illuminance and voltage, we added 330Ω register.

• To operate the 5mm LED, we need 5V power supply, where one end of

LED is connected, and one end is connected to 330Ω register.

• Other end of register is connected to the ground.

38

Figure 22: 5mm Cool White LED Setup

Data transmission architecture:

We conducted this experiment to verify the analog to digital transmission over LED blinks. Also, we wanted to check how small LED luminance affects the Li-Fi system throughput and error rate. First, we have configured the LED that will modulate 1 with

Highest brightness and 0 with lowest brightness. LED illuminates at 100 Hz with 10ms delay between each blink. This should be equivalent to transferring 100 bps.

Then we validated the LED illumination range, minimum and maximum threshold values that LED can reach. For this validation, we used ambient light sensor in fully indoor dark environment and with daylight in background. We have observed the light intensity threshold values in lux for each logic state 1 and 0. In the dark environment, we were able to differentiate the light intensity of 1 and 0, but it only worked until 30 cm distance. During day time, we had environment noise in the background of small LED. Ambient light sensor was not able to detect the LED light intensity accurately.

39

These values were far less compared to 10w cool white LED as described in above table. If there is some amount of luminance light in the background, output values of sensor won’t change for 0 and 1 blink. Due to very low bandwidth and efficiency, we cannot use

5 mm LED transmitter setup to broadcast the message except the idle dark environment, which is not applicable in case of Li-Fi.

8.2 Experiment with 10w RGB LED:

As we can see Red, Green and Blue projection in visible light spectrum, each color has different wavelength and intensity. Wavelength of Blue is lowest around 400-450nm,

Green is 500-525nm and Red is highest with 650-700nm. Using these different light intensity properties of RGB LED, we came up with data transfer using this FSK modulation. RGB LED is commonly use where we need Red, Green and Blue LEDs all together. Ambient Light Sensor in idle dark environment showed that readings from each color with same brightness level is vary to each other.

System setup:

We have used following hardware components:

• 1 x RGB LED

• 1 x Arduino Uno

• 1 x Shift register

• 3 x 100Ω resistor

• 1 x Breadboard

40

• Jumper Wires

Figure 23: 10w RGB LED Setup

As shown in above Figure 23, we have connected the hardware components as follows:

• Connected the breadboard power and ground rails with Arduino power.

• Connected the one end of shift register to RGB LED and other end with

100Ω registers.

• Connected the other ends of 100Ω registers to input pins 2,3 and 4.

• At last connected the other end of RBG LED to power rail.

To configure the RGB transmission, we must send the data to shift register using shiftOut() function. This function will configure the clock pins and data pins. Once we

41 shifted the data into shift register, we still must blink the LED accordingly. To blink the

LED, analog Write() function will use the pin and brightness level and send the signal. To control the brightness of each LED, we used PWM signals. On Receiver end, we configured the application that adapts the different color brightness level and demodulates the ASCII characters.

During same experiment without dark environment, we observed that light intensity reading for each time for different color varies according to various amount of environment light interferes. Environment light also consists the RGB light spectrum and it can change the color of modulated LED signals. So, we cannot use RGB LED outside the dark environment for Li-Fi applications.

42

Chapter 9: Conclusion

In this project, we present the application of Ambient Light Sensor for Li-Fi. Our goal is to provide a transfer the high frequency data over the regular household LED lights.

Experiments held for this project include 1) different LED using Arduino such as Modulation of 5mm LED and Modulation of 10W RGB LED, 2) LED brightness mapping with each ASCII characters, 3) System design of data transfer using brightness range of 0 and 1 bit. Learning from these experiments are that none of the many configurations produced repeatable results, including mixed color tests, with the RGB LED except 10W cool white LED for up to 20 inches. For solving the system challenges like increasing the speed of data transfer, we defined the LED luminance mapping algorithm.

But we won't be able to increase the adaptiveness over the different angles and distances.

To solve that issue, we proposed the demodulation algorithm using minimum and maximum LED luminance. But that decreased the data transfer speed.

43

Chapter 10: Future Work

One of the biggest challenges we faced during implementation of this project is the low sampling rate of ambient light sensor. Also, there is potential complication of how the phosphor in cool or warm LED affects the pulses. There is a lagging effect from the diminishing glow that exists in the Phosphor. Currently, researchers are working on phosphor-based white light converter with a modulation bandwidth about 40 times higher than today's LED phosphors. This would brake today's VLC bottleneck when using white

LEDs, poor phosphor modulation capability due to intrinsically "long" phosphorescence lifetimes [9]. Using multiple adjacent LED lights in hallway, we can broadcast message and create indoor localization system as mentioned in an IEEE paper “SparseTag: High- precision backscatter indoor localization with sparse RFID tag arrays”. [10]

The quest to create smart building has intensified the need to develop indoor location systems. We can create a system for retailers, that assists shoppers to locate products they are viewing or standing in front of. It has many other applications as well. It works with LED luminaires that are embedded with Li-Fi technology. Using the light from the luminaires, the system sends a unique code to a , accurately pinpointing the user’s specific location on a map of the store. The user’s device is now location-aware, and the app delivers location-based services. The Indoor positioning system does not require additional installations other than the LED luminaires with VLC. With an iOS and

Android SDK and cloud services, retailers or their app developers can embed the positioning capabilities into their apps, delivering instant location-based services.

44

Information gathered from the indoor positioning system is stored in the cloud. Venue owners can use this data on shopper behavior to further optimize and improve the store layout. Although this system has Li-Fi components, it does not have a high speed, independent Li-Fi signal. It works with a dependency on existing Wi-Fi infrastructure, and only send small slow speed codes via Li-Fi. An IEEE paper “DeepFi: Deep learning for indoor fingerprinting using channel state information” [11] mentioned that we can implement the Deep learning approach to increase the accuracy of Li-Fi and indoor localization.

45

References

1. X. Wang, L. Gao, S. Mao, and S. Pandey, “CSI-based fingerprinting for indoor

localization: A deep learning approach,” IEEE Transactions on Vehicular Technology,

vol. 66, no. 1, pp. 763-776, January 2017.

2. P. P. Salian, S. Prabhu, P. Amin, S. K. Naik and M. K. Parashuram, "Visible Light

Communication," in Proceedings of 2013 India Educators

Conference, pp. 379-383, Bangalore, India, April 2013.

3. J. Zang and Y. Piao, "Research on visible light communication system based on white

LEDs," in Proceedings of 2016 Chinese Society for Optical Engineering Conferences,

pp. 1021-1025, Wuxi, China, November 2016.

4. Z. Wang, Z. Yang, Q. Huang, L. Yang and Q. Zhang, "ALS-P: Light Weight Visible

Light Positioning via Ambient Light Sensor," in Proceedings of 2019 IEEE Conference

on Computer Communications, pp. 1306-1314, Paris, France, May 2019.

5. Arduino, “Arduino Uno,” [Online]. Available:

https://www.arduino.cc/en/Main/ArduinoBoardUno [Accessed: August 2019].

6. Global Li-Fi tech, “LIFI,” [Online]. Available: http://globallifitech.com/lifi/ [Accessed:

September 2019].

7. Pharmaceutical Processing, “Vessel Lighting Measurement,” [Online]. Available:

http://www.dev.pharmpro.com.690elmp01.blackmesh.com/article/2016/08/vessel-

lighting-measurement [Accessed: July 2019].

46

8. Adafruit, “Adafruit TSL2591 High Dynamic Range Digital Light Sensor,” [Online].

Available: https://www.adafruit.com/product/1980 [Accessed: October 2019].

9. EE News Europe, “Proven Crime Reduction Results,” [online]. Available:

https://www.eenewseurope.com/news/faster-led-phosphors-boost-li-fi-data-rates-0

[Accessed: August 2019].

10. C. Yang, X. Wang and S. Mao, “SparseTag: High-Precision Backscatter Indoor

Localization with Sparse RFID Tag Arrays,” in Proceedings of 2019 16th Annual

IEEE International Conference on Sensing, Communication, and Networking, pp. 1-

9, Boston, MA, USA, June 2019.

11. X. Wang, L. Gao, S. Mao and S. Pandey, "DeepFi: Deep learning for indoor

fingerprinting using channel state information," in Proceedings of 2015 IEEE Wireless

Communications and Networking Conference, pp. 1666-1671, Maui, Hawaii, USA,

March 2015.

12. H. Hassanieh, P. Indyk, D. Katabi, and E. Price, “Simple and practical algorithm for

sparse fourier transform,” in Proceedings of the 23rd annual ACM-SIAM symposium

on Discrete Algorithms, Society for Industrial and Applied Mathematics, pp. 1183-

1194, Philadelphia, PA, USA, January 2012.

13. J. McKendry, R. Green, A. Kelly, Z. Gong, B. Guilhabert, D. Massoubre, E. Gu, and

M. Dawson, “High-Speed Visible Light Communications Using Individual Pixels in

a Micro Light-Emitting Diode Array,” IEEE Photonics Technology Letters, vol. 22,

no. 18, pp. 1346-1348, September 2010.

47

14. T. Komine and M. Nakagawa, “Fundamental analysis for visible-light communication

system using led lights,” IEEE transactions on , vol. 50, no. 1,

pp. 100-107, June 2004.

15. A. Shaw, A. Bradley, J. Donegan, and J. Lunney, “GaN resonant cavity light-emitting

diodes for plastic applications,” IEEE Photonics Technology Letters, vol.

16, no. 9, pp. 2006-2008, August 2014.

16. Z. Tian, K. Wright, and X. Zhou, “The darklight rises: Visible light communication

in the dark,” in Proceedings of the 22nd Annual ACM International Conference on

Mobile Computing and Networking, pp. 2-15, New York, NY, USA, October 2016.

17. J. Zhang, X. Zhang, and G. Wu, “Dancing with light: Predictive in-frame rate

selection for visible light networks,” in Proceedings of 2015 IEEE Computer

Communications, pp. 2434-2442, Kowloon, Hong Kong, China, April 2015.

18. S. Schmid, G. Corbellini, S. Mangold, and T. Gross, “An LED-to-LED Visible Light

Communication system with software-based synchronization,” in Proceedings of

2012 IEEE Optical Wireless Communication. Globecom Workshops, pp. 1264-1268,

Anaheim, CA, USA, December 2012.

19. S. Schmid, G. Corbellini, S. Mangold, and T. R. Gross, “Led-to-led visible light

communication networks,” in Proceedings of the 14th ACM international symposium

on Mobile ad hoc networking and computing, pp. 1-10, Bangalore, India, July 2013.