0% found this document useful (0 votes)
108 views6 pages

Visible Light Communication OOK

This document describes a technical report on visible light communication using on-off keying (OOK) modulation. It was published in October 2015 and has received over 2,000 reads and 7 citations. The authors developed a method to transfer files between two computers using a LED transmitter and photodiode receiver. Data is transmitted by turning the LED on and off according to a unipolar RZ line coding scheme. This allows both illumination and data transfer. Potential applications of this technology include secure data transfer, alternative to NFC, smart lighting, and replacing WiFi in hospitals.

Uploaded by

Conan Edogawa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views6 pages

Visible Light Communication OOK

This document describes a technical report on visible light communication using on-off keying (OOK) modulation. It was published in October 2015 and has received over 2,000 reads and 7 citations. The authors developed a method to transfer files between two computers using a LED transmitter and photodiode receiver. Data is transmitted by turning the LED on and off according to a unipolar RZ line coding scheme. This allows both illumination and data transfer. Potential applications of this technology include secure data transfer, alternative to NFC, smart lighting, and replacing WiFi in hospitals.

Uploaded by

Conan Edogawa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/303737694

Visible Light Communication Using OOK

Technical Report · October 2015


DOI: 10.13140/RG.2.1.4478.6800

CITATIONS READS
7 2,208

3 authors, including:

Abby P Joby Nakul P C


National Institute of Technology Calicut National Institute of Technology Calicut
10 PUBLICATIONS   8 CITATIONS    1 PUBLICATION   7 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Visible Light Communication Using OOK View project

IC TRAINER KIT USING MSP430-G2553 MICROCONTROLLER View project

All content following this page was uploaded by Abby P Joby on 02 June 2016.

The user has requested enhancement of the downloaded file.


VISIBLE LIGHT COMMUNICATION
Sidharth K Manohar Abby P Joby Nakul P C
B-tech 5th Semester B-tech 5th Semester B-tech 5th Semester
Department Of Electronics Department Of Electronics Department Of Electronics
and communication Engineering and communication Engineering and communication Engineering
NIT Calicut NIT Calicut NIT Calicut
B130150EC B130373EC B130555EC

Abstract—Visible Light Communication is an emerging tech- II. RELEVANCE


nology where light waves of the visible spectrum is used for
communication. The illumination or visibility of Visible Light A. High security data transfer
Communication in addition to data transfer gives a dual advan- Since visible light can be restricted to an area, safe and
tage to this technology. In theory, any source of illumination can secure data transfer can be achieved. As an example ,if we are
be made to work as a potential source of data transmission. In
transmitting data using radio waves, it can be easily decoded
this report, we try to develop a method to transfer files between
two computers by using unipolar RZ line coding scheme (on-off by any other devices which are in range. But if we are using
keying) with the photodiode as a receiver. visible light to transmit data, the range of data decoding can
Index Terms—Visible Light Communication, Unipolar RZ, on- be adjusted accordingly.
off keying, Photodiode, LED
B. Alternative to NFC
I. I NTRODUCTION Near Field Communication allows close proximity detection
of smartphones however data transfer between smartphone’s
The research on visible light communication is motivated
are carried out through bluetooth. VLC can have a huge impact
by an increasing need of indoor communication systems and
in this area where its possible to transfer data between android
the improvements of light emitting diode technologies (LEDs).
smartphone’s using the inbuilt flash light LED and the ambient
High brightness LEDs are already used for several applications
light sensor.
and it is foreseen that they will also replace conventional
lighting sources in the next decade. Furthermore, the band- C. Smart Lighting
width of optical free space communication systems using In the growing world of the Internet Of Things, VLC can
LED technology is high in comparison to radio frequency be a cost and power effective alternative to WiFi or Bluetooth
based solutions. This project mainly aims at sending data which is used to communicate between sensors.
using visible light thus enabling illumination as well as data
transfer simultaneously. Since any illuminating device has two D. Replacing WiFi in hospitals
states ,ON and OFF, it can be used for transmitting any Continuous exposure to radio waves can cause health issues,
binary information. The high switching speed of LEDs are visible light could be used to transmit data in hospitals. We
exploited in transmitting data which enables data transfer at have been exposed to visible light since time immemorial so
rates higher than the existing ones. The applications of visible it’s safe to say that it has absolutely no side effects on living
light communication is not only restricted to high data rate but tissue.
also help in secured data transfer. Since we are using visible
light to transfer information, we can actually see where we E. High data rate
are sending information thus making it highly secure. This is Visible light has 10,000 times the bandwidth of radio waves.
not the case with other wireless technologies like Bluetooth or If properly used could allow extreme data rates, possibly even
WiFi. Also in the future, this technology has the potential to overtake WiFi.
replace NFC (near field communication) completely It is also
possible to use VLC as an alternative for QR codes. Visible III. TRANSMITTER
light occupies the frequency spectrum ranging from 200nm to At the transmitter side, an LED is used to transmit data.
700nm therefore its bandwidth is almost infinite!. But it has It is transmitted using an LED using ON-OFF keying. The
several disadvantages too. Ambient light causes error while characters that we type in the computer (using terminal pro-
receiving data. So the received data need to be processed. The gram called PUTTY) are transfered to the MSP430 through
possibilities of Visible Light Communication are immense. Serial communication (UART at 9600 baud rate). The MSP430
VLC can be applied to achieve data transfer between two transmits the binary equivalent of the character to the LED.
smartphones or this technology could aid the ever growing For example, If we want to transmit the character ’x’ ,we
world of the Internet Of Things. would first type it in Putty, this is transfered to the MSP430
A. Transmit Images
Any image is just a sequence of 0’s and 1’s. Using a python
script, we were able to convert the image to base64 format ie
into a set of ASCII characters. Once this was achieved, It
was just a matter of transmitting the information through the
process described above. Once the characters are received, we
can convert it back to an image.
B. Transmit Any File
Any file as a matter of fact is a sequence of 0’s and 1’s
so we can apply the same python script(used for images) to
convert any file to base64 format and transmit it as mentioned
above.
IV. RECEIVER
At the receiver end, a photo diode is used for detecting the
data transferred. The photo diode is connected in reverse bias
Fig. 1. VLC Transmitter circuit (refer circuit below). When the photo diode detects light, the
current through the resistor increases therefore increasing the
voltage drop across the resistor. Similarly when there is no
via serial communication. The MSP430 makes the LED blink light falling on the photo diode, the voltage drop across the
at a particular rate (refer code) bit corresponding to the binary resistor decreases.
sequence of the character ’a’. We are using asynchronous The voltage across the resistor is fed into a comparator to
communication to transfer the data. The data is transmitted ensure a proper HIGH or LOW state corresponding to the
as groups of 8bits. Each ASCII character can contain 7 bits. whether the LED is ON or OFF. An op-amp LM324 with
We assume that initially the LED is on indicating a HIGH threshold voltage of 1.2V is used as the comparator. The
state the first bit that is transmitted is a 0 (led is off indicating voltage level of 1.2V was chosen by trial and error and it
LOW) it is then followed by the 7bits corresponding to the may vary depending on the ambient lighting conditions.
ASCII character that we wish to transmit. A one corresponds Output from the comparator is connected to the MSP430. The
to turning ON the LED and a 0 corresponds to turning it OFF. receiver also works asynchronously. When the MSP receives
In this setup, we are trying to achieve communication between a HIGH to LOW transition (start bit) in it’s digital pin,
two computers. We are trying to transfer ASCII characters it starts to receive data. The comparator output is sampled
via VLC. Once this is made possible, The software can be at a time instant ’T’ similar to transmission interval. The
extended to allow transfer of any file using the same principle MSP430 receives 8 bits including the start bit and it extracts
(please see Python code). the corresponding ASCII character from the received binary
The setup initially consisted of only one 5mm LED connected sequence.
to the MSP430 to act as transmitter. The program was initially Once the sequence is received, It is transferred to the computer
compiled using Energia and the LED was connected to the Tx via serial communication (UART at baud rate 9600) and
pin of the MSP430. Similarly at the receiver, the photodiode displayed on Putty (terminal screen connected to COM PORT).
was connected to the Rx pin of the MSP430 and the respective
code was flashed onto the microcontroller. This method was a V. PROBLEMS FACED
bit rudimentary as it is essentially just normal serial commu- • While transferring images or files, due to the fact that we
nication and it was observed that there were significant loss of are doing base64 conversion of the image, Even a single
information and the Blinking of the LED was clearly visible, bit error could cause entire data to get falsified.
an unwanted feature. Hence we decided to implement the code • Since the photo diode is used in reverse bias mode,
using Code Compose Studio (CCS). the response time of photo diode caused an issue espe-
CCS uses C language to program the microcontroller. It cially during ONE-ZERO transmission. Due to this phe-
has the additional advantage that we are able to access the nomenon, there was considerable error in the transmitted
core registers of the microcontroller. Our first aim was to data Bit Error Rate (BER) was approximately 0.01. This
increase the speed at which the LED blinks so as to make was resolved by decreasing the series resistance hence
the blinking appear invisible to the naked eye. So we set allowing more current to flow there by sharpening the
the clock frequency of the microcontroller to 8MHz (max = response and a BER of 0.001 was observed.
16MHz) from the default 1MHz to ensure that the blinking is • The maximum possible data transmission with this above
fast enough to make the light appear constant at the same time mentioned setup is about 3.5 Kbps. This limit is due to
slow enough to allow the photodiode to receive the changes the fact that the photo diode cannot respond fast enough
in intensity. to register the LED turning ON and OFF.
• The data rate could be further improved by using different
coloured LED’s thereby allowing parallel data transmis-
sion.
• BER of the transmitted data could be improved manifold
by using some proper error control coding scheme’s like
Hamming(7,4) code or turbo code.
ACKNOWLEDGMENT
The authors would like to thank Dr.Sameer S M, Associate
Professor ,National Institute of Technology, Calicut for the
guidance he has given for the accomplishment of our project.
We also extent our gratitude to Mr. Anandan, Supporting staff,
Embedded system lab, National Institute of Technology, Cali-
cut for providing the necessary requirements for our project.
Finally we would like to thank the Almighty
R EFERENCES
Fig. 2. VLC Receiver circuit
[1] Mostafa Z. Afgani, Harald Haas, Hany Elgala, and Dietmar Knipp,
Visible Light Communication Using OFDM , Testbeds and Research
Infrastructures for the Development of Networks and Communities, 2006.
TRIDENTCOM 2006 2nd International Conference on , vol., no., pp.6
pp.-134, 0-0 0.
[2] MSP430 Microcontroller Basics, John H Davies.
[3] Aleksandar Jovicic, Junyi Li, and Tom Richardson, Qualcomm Research,
Visible Light Communication:Opportunities, Challenges and thePath to
Market, in Communications Magazine, IEEE , vol.51, no.12, pp.26-32,
December 2013

A PPENDIX
A. Transmitter code in CCS

#include <msp430g2553.h>

unsigned int i=0;


Fig. 3. Complete setup with transmitter and receiver void main(void)
{

• One of the major problem faced during the data transfer WDTCTL = WDTHOLD + WDTPW;
was error in the bits received. One immediate solution P1DIR=BIT6;
to reduce the BER was to transmit each character three P1OUT=BIT6;
times and the receiver would select the character which P1SEL=0x06; //BIT2 + BIT3
was repeated twice. Thereby we were able to further P1SEL2=0x06; //BIT2 + BIT3
improver the BER at the cost of transmitting three times
TACTL = TASSEL_2 + MC_3; //Configuring
the information. TIMER A
• Since a single 5mm white LED was used, the range of the TACCR0 = 1000;
transmitter was not too impressive around 20cm. further
increasing the distance resulted in the BER to increase ///// SETTING UP UART /////
considerably. DCOCTL=0;
BCSCTL1=CALBC1_8MHZ;
DCOCTL=CALDCO_8MHZ;
VI. FURTHER IMPROVEMENTS
• The data rate could be further improved by using a UCA0CTL1 = UCSSEL_2;
UCA0BR0=65; // 8MHz 9600
different ambient light sensor instead of the conventional UCA0BR1 = 3;
of the shelf photo diode. OPT3001 is a suitable ambient // UCA0MCTL = UCBRS0;
light sensor manufactured by Texas Instruments. It has a
Frequency response very similar to the human eye (zero UCA0CTL1 &= ˜UCSWRST; //
at Infra-red region). It also has a much faster response Initialize UART
time compared to the normal photo diode. IE2 |= UCA0RXIE; // UART interrupt enable
• The range of transmission could be further improved by
using several high power LED’s as the transmitter. _EINT();
}

B. Receiver code in CCS


#pragma vector = USCIAB0RX_VECTOR
__interrupt void UART(void) #include<msp430g2553.h>
{ /*
* main.c
IE2 &= ˜UCA0RXIE; //UART Interrupt Disabled */
CCTL0= CCIE; //Timer Interrupt Enabled unsigned int store = 0;
UCA0TXBUF = UCA0RXBUF; unsigned int i = 1;
void main(void)
} {
WDTCTL = WDTHOLD + WDTPW;

#pragma vector = TIMER0_A0_VECTOR P1DIR=BIT0;


__interrupt void TIMER(void) P1OUT=BIT0;
{ P1SEL=0x06;
switch(i) P1SEL2=0x06;
{
case 0: TACTL = TASSEL_2 + MC_3; //Configuring
P1OUT &= ˜BIT6; // START BIT TIMER A
break; TACCR0 = 1000;

case 1: ///// SETTING UP UART /////


P1OUT = (UCA0RXBUF&BIT0)? BIT6 : 0; DCOCTL=0;
break; BCSCTL1=CALBC1_8MHZ;
DCOCTL=CALDCO_8MHZ;
case 2: UCA0CTL1 = UCSSEL_2;
P1OUT = (UCA0RXBUF&BIT1)? BIT6: 0; UCA0BR0=65; // 8MHz 9600
break; UCA0BR1 = 3;

case 3: UCA0CTL1 &= ˜UCSWRST; //Initialze UART


P1OUT = (UCA0RXBUF&BIT2)? BIT6: 0;
break; IE2 |= UCA0RXIE; //UART Interrupt
Enable
case 4:
P1OUT = (UCA0RXBUF&BIT3)? BIT6: 0; P1IE = BIT4; //Port 1 interrupt
break; enable on P1.4
P1IES = BIT4; //Falling Edge
case 5: Interrupt
P1OUT = (UCA0RXBUF&BIT4)? BIT6: 0; P1IFG &= ˜BIT4;
break;

case 6: _EINT();
P1OUT = (UCA0RXBUF&BIT5)? BIT6: 0; while(1)
break; {
if(i==8) //After 8 bits are recieved,
case 7: the corresponding byte is sent
P1OUT = (UCA0RXBUF&BIT6)? BIT6: 0; through UART
break; {
i=1;
case 8: CCTL0 &= ˜CCIE;
P1OUT = (UCA0RXBUF&BIT7)? BIT6: 0; while (!(IFG2&UCA0TXIFG)); //
break; USCI_A0 TX buffer ready?this
} ifg will be zero when nothing
i++; received ie when txbuf ready
UCA0TXBUF=store;
if(i==9) store=0;
{ P1IFG&=˜BIT4;
i=0; P1IE=BIT4;
CCTL0 &= ˜CCIE; //TIMER Interrupt Disabled }
P1OUT |=BIT6;
IE2 |= UCA0RXIE; //UART Interrupt Enabled

} }
}
}
for x in range(0, len(stringt)): #sending the
base64 encoded string
#pragma vector = PORT1_VECTOR ser.write(stringt[x])
__interrupt void START_BIT(void) time.sleep(.09)
{ ser.write(’\n’) #end of line character to
P1IE &= ˜BIT4; denote end of transmission
CCTL0 = CCIE; //Turn on timer interrupt ser.close() #close serial port
after start bit is recieved
P1IFG &= ˜BIT4;
} D. Python code to convert base64 format to file
#pragma vector = TIMER0_A0_VECTOR import serial
__interrupt void TIMER(void) import base64
{
switch(i) f = open("/home/sidharth/Documents/rec.png",
{ "wb") #file recieved will be saved as
case 0: rec.png
break;
case 1: ser = serial.Serial(port = "/dev/ttyACM0") #
store += ((P1IN&BIT4)==BIT4)? 1: 0; ttyACM0 is the com port ID
break; ser.baudrate = 9600
case 2:
store += ((P1IN&BIT4)==BIT4)? 2: 0; print "connection made to: " + ser.portstr +
break; "..."
case 3: print "with baud rate: " + str(ser.baudrate)
store += ((P1IN&BIT4)==BIT4)? 4: 0; + "..."
break; print "..."
case 4:
store += ((P1IN&BIT4)==BIT4)? 8: 0; stringr = ""
break;
case 5: while True:
store += ((P1IN&BIT4)==BIT4)? 16: 0; data = ser.read()
break; if(len(data) > 0):
case 6: if(data == ’\n’): #check if transmission
store += ((P1IN&BIT4)==BIT4)? 32: 0; has ended
break; break
case 7: stringr = stringr + data
store += ((P1IN&BIT4)==BIT4)? 64: 0;
break; f.write(base64.b64decode(stringr)) #base64
} decoding and writing to the file
i++; f.close() #close file
} ser.close() #close serial port

C. Python code to convert file to base64 format

import serial
import time
import base64

with open("/home/sidharth/Documents/1.png",
"rb") as f:
stringt = base64.b64encode(f.read())
#encoding the file 1.png into base64

ser = serial.Serial(port = "/dev/ttyACM2") #


ttyACM2 is the serial port ID
ser.baudrate = 9600

print "connection made to" + ser.portstr +


"..."
print "with baud rate" + str(ser.baudrate) +
"..."
print "..."

View publication stats

You might also like