0% found this document useful (0 votes)
230 views

An Example Project Report

This document is the final report for a capstone project on free space optical communication completed by four students. It details the design and construction of an FSO system using laser optics to transmit data between two points 30 meters apart. Both sides were designed as transceivers interfaced to PCs via USB. The system achieved over 1kbps transmission rate using a visible laser and UART serial protocol. The report describes the conceptual solutions, work plan, subsystems design, and integration and evaluation of the electrical/electronics and computer engineering aspects of the project. Evaluation showed successful transmission, authentication, and graphical user interface functionality.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
230 views

An Example Project Report

This document is the final report for a capstone project on free space optical communication completed by four students. It details the design and construction of an FSO system using laser optics to transmit data between two points 30 meters apart. Both sides were designed as transceivers interfaced to PCs via USB. The system achieved over 1kbps transmission rate using a visible laser and UART serial protocol. The report describes the conceptual solutions, work plan, subsystems design, and integration and evaluation of the electrical/electronics and computer engineering aspects of the project. Evaluation showed successful transmission, authentication, and graphical user interface functionality.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 113

T.C.

BAHÇEŞEHİR UNIVERSITY

FACULTY OF ENGINEERING AND NATURAL SCIENCES

CAPSTONE FINAL REPORT

Free Space Optical Communication


Capstone Project 1195

Students:
Barış Başgil EEE
Artun Alpgiray Kopar EEE
Eren Özdemir CMP
Baran Turguter CMP

Advisors:
Prof. Dr. Şeref Kalem EEE
Assist Prof. Ece Gelal Soyak CMP

ISTANBUL, May 2021


i
STUDENT DECLARATION

By submitting this report, as partial fulfilment of the requirements of the Capstone course, the
students promise on penalty of failure of the course that

• they have given credit to and declared (by citation), any work that is not their own (e.g.
parts of the report that is copied/pasted from the Internet, design or construction
performed by another person, etc.);
• they have not received unpermitted aid for the project design, construction, report or
presentation;
• they have not falsely assigned credit for work to another student in the group, and not
take credit for work done by another student in the group.

Abstract

In this project, the team designed and constructed a free-space optical communication
system between two points using laser optics. Both sides of the communication designed as
transceivers and they are interfaced to PCs by a USB port. A visible laser transmitted data
at 30m distance with above 1kbps data transmission rate via UART serial protocol. For the
software design, authentication with a secure key, basic error detection/correction methods,
graphical user interface design and proper message packaging methods are applied.

Key Words

Cost efficient FSO transceiver design; FSO systems OOK implementation; USB to TTL
converter transceiver design; point-to-point FSO network; OWTN; OWHN; Python GUI
design; UART serial in FSO; Peer-to-peer FSO communication; Diffie-Hellman Key
Exchange Authentication; File transfer via FSO.

ii
TABLE OF CONTENTS

TABLE OF CONTENTS .......................................................................................................... iii


LIST OF TABLES ..................................................................................................................... v
LIST OF FIGURES ................................................................................................................... vi
LIST OF ABBREVIATIONS ................................................................................................... ix
1. OVERVIEW........................................................................................................................... 1
1.1. Identification of the need ............................................................................................ 1
1.2. Definition of the problem ........................................................................................... 1
1.3. Standards and Constraints .......................................................................................... 4
1.4. Conceptual Solutions.................................................................................................. 9
1.4.1. EEE Conceptual Solutions ................................................................................ 9
1.4.2. CMP Conceptual Solutions ............................................................................. 15
1.5. Physical architecture ................................................................................................ 18
2. WORK PLAN ...................................................................................................................... 20
2.1. Work Breakdown Structure (WBS) ......................................................................... 20
2.2 Responsibility Matrix (RM) ...................................................................................... 21
2.3. Project Network (PN) ............................................................................................... 21
2.4. Gantt chart ................................................................................................................ 22
2.5. Cost........................................................................................................................... 23
2.6. Risk Analysis............................................................................................................ 28
2.6.1. EEE Sub-system Risk Analysis....................................................................... 28
2.6.2. CMP Sub-system Risk Analysis ..................................................................... 30
3. SUB-SYSTEMS ................................................................................................................... 31
3.1 Electrical and Electronics Engineering. .................................................................... 31
3.1.1. Requirements ................................................................................................... 31
3.1.2.Technologies and methods ............................................................................... 32
3.1.3. Physical architecture ....................................................................................... 35
3.1.4. Materialization ................................................................................................ 55
3.1.5. Evaluation........................................................................................................ 62
3.2. Computer Engineering ............................................................................................. 74
3.2.1. Requirements ................................................................................................... 74
3.2.2. Review of technologies and methods .............................................................. 75
3.2.2.1 Data Transmission ..................................................................................... 75
iii
3.2.2.2 Authentication ........................................................................................... 77
3.2.2.3 Graphical User Interface ............................................................................ 78
3.2.3 Software Architecture ...................................................................................... 78
3.2.4. Implementation................................................................................................ 80
3.2.4.1 Build 1 ....................................................................................................... 80
3.2.4.2 Build 2 ....................................................................................................... 82
3.2.4.3 Buiild 3 ...................................................................................................... 82
3.2.4.4 Build 4 ....................................................................................................... 84
3.2.4.5 Build 5 ....................................................................................................... 84
3.2.4.6 Build 6 ....................................................................................................... 85
3.2.5 Evaluation......................................................................................................... 86
3.2.5.1 Evaluation of Transmission ....................................................................... 86
3.2.5.2 Evaluation of the Graphical User Interface ............................................... 87
3.2.5.3 Evaluation of Authentication ..................................................................... 88
4. INTEGRATION AND EVALUATION .............................................................................. 89
4.1 Integration…………………………………………………………………………89
4.2 Evaluation…………………………………………………………………………92
5. SUMMARY AND CONCLUSION ..................................................................................... 98
ACKNOWLEDGEMENTS ..................................................................................................... 99
REFERENCES ....................................................................................................................... 100
APPENDIX………………………………………………………………………………… 104
Appendix A……………………………………………………………………….…104
Appendix B……………………………………………………………………….…104

iv
LIST OF TABLES

Table 1. Comparison of the concepts ........................................................................... 14


Table 2. Comparison of the concepts ........................................................................... 17
Table 3. Responsibility Matrix for the team. ................................................................ 21
Table 4. Table of costs.................................................................................................. 23
Table 5. Bill of materials. ............................................................................................. 25
Table 6. Risk Matrix ..................................................................................................... 28
Table 7. Risk assessment table ..................................................................................... 29
Table 8. Risk assessment table. .................................................................................... 30
Table 9. Commercially available and common lasers. ................................................. 37
Table 10. Comparing two laser products. ..................................................................... 37
Table 11. Photocurrent measurements. ........................................................................ 63
Table 12. Transmitter circuits’ oscilloscope measurements. ........................................ 65
Table 13. 30m focusable and normal 5mW laser data transmission test results. ......... 69
Table 14. Close range baud rate tests. .......................................................................... 70
Table 15. Power consumption measurements. ............................................................. 71
Table 16. Requirements for actors. ............................................................................... 74
Table 17. Indoor BER/PER Test results ....................................................................... 95
Table 18. Outdoor BER/PER Test results .................................................................... 96

v
LIST OF FIGURES

Figure 1. Path of data from the source computer to the destination computer. .............. 2
Figure 2. TTL Acceptance Voltage Levels ................................................................... 6
Figure 3. null modem configuration .............................................................................. 6
Figure 4. Visible light Spectrum .................................................................................... 8
Figure 5. OOK-RZ and OOK-NRZ Modulation Format................................................ 8
Figure 6. Block diagram of concept 1 ............................................................................ 9
Figure 7. Concept 1 Laser Transceiver circuit schematic ............................................ 10
Figure 8. Block diagram of concept 2. ......................................................................... 11
Figure 9. LD Driver circuit ........................................................................................... 11
Figure 10. Schmitt Trigger circuit ................................................................................ 12
Figure 11. Transimpedance Amplifier circuit .............................................................. 12
Figure 12. Non-Inverting amplifier and comparator circuits ....................................... 12
Figure 13. Block diagram of concept 3 ........................................................................ 13
Figure 14. Physical implementation of concept 3 ........................................................ 13
Figure 15. Circuit Schematic of concept 3. .................................................................. 13
Figure 16. System interface diagram ............................................................................ 18
Figure 17. Physical System representation of FSO Communication Link ................... 19
Figure 18. Project network ........................................................................................... 21
Figure 19. Timeline for the first 8 weeks of the project ............................................... 22
Figure 20. Timeline for the 9th to 13th week of the project ......................................... 22
Figure 21. A basic FSO communication system .......................................................... 32
Figure 22. Optical Intensity Modulation Techniques. .................................................. 33
Figure 23. Block diagram of FSO Communication link .............................................. 34
Figure 24. Modified system interface diagram of FSO transceiver system design with
Usb to TTL converter ................................................................................................... 35
Figure 25. Reception power formula ............................................................................ 36
Figure 26. Circuits of Architecture A ........................................................................... 38
Figure 27. TTL circuit schematic ................................................................................. 39
Figure 28. Led indicator circuits. ................................................................................. 39
Figure 29. Regulator circuit. ......................................................................................... 40
vi
Figure 30. Transmitter circuit of architecture A ........................................................... 41
Figure 31. Current/voltage device characteristic curves of the mosfet ........................ 42
Figure 32. Transmitter circuit simulation ..................................................................... 43
Figure 33. Receiver circuit of architecture A ............................................................... 43
Figure 34. PIN photodiode energy band gap diagram .................................................. 44
Figure 35. PIN photodiode energy band gap diagram .................................................. 45
Figure 36. Transimpedance amplifier current flow. ..................................................... 46
Figure 37. Receiver circuit simulation ......................................................................... 47
Figure 38. Laser (Gaussian) beam propagation ............................................................ 48
Figure 39. Receiver radiant sensitive area .................................................................... 49
Figure 40. Intensity Curves at different distances ........................................................ 49
Figure 41. Definite integral calculation ........................................................................ 50
Figure 42. Circuits of Architecture B ........................................................................... 51
Figure 43. Non-symmetrical schmitt trigger circuit. .................................................... 52
Figure 44. Usage purpose of the schmitt trigger .......................................................... 52
Figure 45. Schmitt trigger threshold voltages calculations .......................................... 53
Figure 46. Extra transmitter circuit configurations ...................................................... 53
Figure 47. Cmos laser driver circuit ............................................................................. 54
Figure 48. First breadboard prototypes ........................................................................ 55
Figure 49. Final circuit schematic ................................................................................ 56
Figure 50. LM311p PCB footprint and schematic representation................................ 57
Figure 51. Finalized circuit schematic in Altium Designer .......................................... 58
Figure 52. Finalized PCB layout. ................................................................................. 59
Figure 53. 3D view of the PCB. ................................................................................... 59
Figure 54. Soldering process and continuity test setup. ............................................... 60
Figure 55. Soldered circuit. .......................................................................................... 60
Figure 56. Finalized products ....................................................................................... 61
Figure 57. USB-TTL converter data transmission test block diagram ......................... 62
Figure 58. USB-TTL converter data transmission test setup between two separate usb
ports. ............................................................................................................................. 62
Figure 59. Observed oscilloscope result for Rx pin at 1200Hz .................................... 66
Figure 60. 30m indoor data transmission test setup. .................................................... 67
Figure 61. 30m outdoor data transmission test setup receiver (top) and transmitter. .. 68

vii
Figure 61. Finalized products’ software compatibility test setup................................. 69
Figure 62. Serial Communication interface.................................................................. 75
Figure 63. Parallel Communication interface. .............................................................. 75
Figure 64. UART communication. ............................................................................... 76
Figure 65. UART Packet. ............................................................................................. 77
Figure 66. File Transmission Diagram ......................................................................... 78
Figure 67. Diffie-Hellman Key Exchange Authentication Diagram ............................ 78
Figure 68. Computer Sub-System Process Chart.. ....................................................... 79
Figure 69. Pseudocode of Sender.py.script.. ................................................................ 80
Figure 70. Pseudocode of Receiver.py script.. ............................................................. 81
Figure 71. All Windows of Graphical User Interface.. ................................................ 82
Figure 72. implementation of transmitter window in gui.py script .............................. 83
Figure 73. implementation of receiver window in gui.py script.. ................................ 83
Figure 74. Diffie-Hellman Key Exchange Authentication [55].. ................................. 85
Figure 75. Implementation of Multi-Threading. .......................................................... 85
Figure 76. Binary Data of a text file. ............................................................................ 86
Figure 77. Transmitted .txt file (left), Received .txt file (right)... ................................ 86
Figure 78. Main window (top-left), Transceiver window (top-right), Settings window
(bottom-middle)... .................................................................................................................... 87
Figure 79. Terminals of running authentication.. ......................................................... 88
Figure 80. Indoor Integration Test setup... ................................................................... 90
Figure 81. transmitted test file (bottom) and received text document (top)... .............. 91
Figure 82. Running softwares’ terminals.. ................................................................... 91
Figure 83. error ratio test results’ graph(indoor).. ........................................................ 95
Figure 84. error ratio test results’ graph (outdoor).. ..................................................... 96

viii
LIST OF ABBREVIATIONS

AC Alternating Current
BER Bit error ratio
BPF Band-pass filter
CMP Computer Engineering
DC Direct Current
EEE Electrical and Electronics Engineering
EM Electromagnetic
FSO Free Space Optical
GSM The Global System for Mobile Communication
LAN Local area Network
LD Laser diode
LOS Line of sight
LPF Low-pass filter
MCU Microcontroller Unit
OOK On-Off Keying
OWHN Optical Wireless Home Network
OWTN Optical Wireless Terrestrial Network
PC Personal Computer
PER Packet error ratio
PnP Plug and play
RF Radio frequency
RZ Return-to-zero
RS232 Recommended standard 232
SIM Subcarrier Intensity Modulation
TIA Transimpedance Amplifier
TL Turkish Lira
TTL Transistor-Transistor logic
UART Universal asynchronous receiver-transmitter
USB Universal serial bus

ix
1. OVERVIEW

1.1. Identification of the need

In today’s world, communication is an important aspect of our lives. We communicate


constantly using our mobile phones and internet. This communication is provided in
multiple ways, like wireless communication, cable communication, broadband
communication etc. There are some instances where using physical connections are
impractical and costly or simply undoable. In those instances, one of the solutions is using
free-space optical communications. Free-space optical communications (FSO) is a
communication technology that uses optics to wirelessly transmit data in free space. This
technology has wide range of uses. It can be used as a simple backup to fiber cables, as a
secure and undetectable high-speed channels for military access or as a way of
communication between two spacecraft or two ships [33].
The aim of the team is to replicate this technology in a low cost but reliable design
solution, while meeting with the expected performance specifications.

1.2. Definition of the problem

In the free-space optical communication project, the team is responsible for designing
and constructing a free-space optical communication between two points using laser optics.
Both sides of the communication must be designed as transceivers that can both receive and
send the data from the source through a visible laser that will transmit the data over the free-
space to the other point. Figure 1 illustrates the basic steps the traveling data takes between
the source computer and the destination computer.

1
Figure 1, Path of data from the source computer to the destination computer.

2
The FSO communication technology is already in use by many corporations that deal
with long distance communication over free-space. In the current developing age of extra-
terrestrial researches, FSO technology is mainly used by NASA and SpaceX on their
respective projects, examples of that being NASA’s Lunar Atmosphere and Dust
Environment Explorer (LADEE) and SpaceX’s popular Starlink satellite [34] [35].

In functionality the end product has to have a two-way communication between the
points which both points can send and receive data. The data has to be readable in the
computers and the transmission of the data has to be secure. The end product has to be able
to detect and correct basic errors, have a communication range of at least 30 metres and data
transmission rate of at least 1000 bits per-second.

The design specifications and performance requirements of the product are:

1. Establish FSO link between two points using a visible laser.


2. Provide a reliable communication range of at least 30 metres.
3. Provide data transmission rate of at least 1000 bits per-second.
4. Provide a two-way communication between the points.
5. Provide a data terminal with a user interface application that provides

digital input/output to electronic circuits.


6. Provide a secure transmission of the data with authentication.
7. Provide a way of changing the user input into binary for transmission.
8. Provide the packaging of data, implementing a communication protocol.
9. Designing an optical transmitter laser modulation circuit.
10. Designing an optical receiver circuit.

3
1.3 Standards and Constraints

In this project, there are some factors which effected the processes and actions. In the
beginning, covid-19 pandemic effected the project as critically as all over the world. Due to the
covid-19 pandemic, increasing cases in Turkey and lockdown restrictions, physical interactions
and meetings could not arrange. Nevertheless, electrical electronics team have met in Beşiktaş
campus and try to materialize the project. In laboratory, circuits and related tests have been
completed before April. There were some remaining tests to do in laboratory. Due to the
lockdown and other governmental restrictions, those remaining tests and verification processes
covered in home environment with limited resources. As mentioned before, beginning of April
materialization processes continue in home environment. Therefore, testing became another
problem due to the environmental limitations. Distance and frequency tests, which is needed
30 meters refer to minimum requirement of the project, have been completed under this
condition. In addition to distance and frequency tests, health issues had to be considered due to
the laser usage. Also, lockdowns and pandemic restrictions negatively affect the coordination
and consistency of sub-sections (electrical electronics and computer). Another factor is
economic factors, teams tried to minimize costs and maximize efficiency. Refer to experience
of the team, materialization of prototype can expensive, but with the mass production costs of
the product could be decreased. As environmental and legal constraint, according to ICAO
(International Civil Aviation Organization) Doc 9815, laser products should not be pointed to
aircrafts for flight safety.

Also, the laser product should be operated by the user by considering personal right to
freedom and security issued by The Constitution of the Republic of Turkey in our country.

Besides of negative factors, there are some solutions which effected the project
positively. Such as, fast meetings became available under favour of lockdowns. Verification of
the codes and other processes completed in short time with the help of digital applications
(Teams, zoom, etc…).

4
Determining the Data Terminal Equipment:

The project group decided to use a data terminal device as a pc or a laptop to achieve
two-way communication which can provide digital i/o from lots of interfaces such as ethernet,
rs232 and usb ports. Also, this selection provides flexibility to the computer engineering team
to write flexible codes in different languages. The project team also considered to use some
other low-cost devices such as a Raspberry pi, however it has some constraints in programming
languages and the end-product may not be universally used for large groups of users in terms
of PnP device concept. This selection also significantly decreases the cost of the project.

Determining The Interface Between Electronic Circuits And PC:

Physical Interface:

To achieve two-way data transfer, a data flow control is needed to achieve reliable
communication. So, the team came up with an idea of using an MCU such as an Arduino nano
as a bridge between pc and transmitter/receiver circuits. However, this may limit the data
transmission rate as a bottleneck and increase the cost of the project. Therefore, in order to
increase the robustness and achieve higher transmission rates, another possible solution is to
connect the transceiver circuits to pc’s serial ports via a serial converter. Some similar FSO pc
to pc communication projects interfaced their transceiver circuits with RS232 to
TTL converters or by using a USB to TTL converters.

It is also important to indicate that since the data links are the only connections between
transmitter and the receiver and there is no clock synchronization between them, a serial
universal asynchronous communication protocol (UART) interface solution is needed.

5
Here are some of suitable communication interfaces explained:

TTL: The Transistor-Transistor logic standard interface is generally used for communicating
host pc’s with mcu’s. A TTL device works with 5V nominal input voltage and it has certain
input and output acceptance voltage threshold levels to consider the voltage signal as high or
low. These threshold values are shown in the figure below.

Figure 2, TTL Acceptance Voltage Levels [15]

Also, this standard is the most suitable one for interfacing transceiver circuits in terms
of logic voltage levels and simplicity.

USB: Usb is a hot pluggable interface and it uses two (d+/d-) data lines to send and receive
voltage signals in the differential pair or push pull mode. Since most of the newer pc’s have
USB ports, this standard has a great advantage over RS232 in terms of usability and simplicity.

RS232: A full duplex asynchronous communication interface which data transmission can be
controlled by physical pins. Mostly used in interfacing pc’s to devices such as printers. This
standard is operating at voltage levels (+/-15V) that are higher than usb/ttl levels and need more
complex circuitry than usb. Also, a null modem configuration can be implemented and depicted
in figure 3 in order to achieve PC-to-PC communication via RS232 serial port [11].

Figure 3, null modem configuration [11]

6
For the project, this configuration is applicable by using some voltage level conversions
and a MAX232 converter IC to convert RS232 to TTL voltage levels. And this configuration
has been implemented by (Jabeena et al., 2012).

After considering all the applicable serial communication standards, the team decided
to use a Prolific PL-2303HX USB-to-TTL-Serial converter. And this converter provides baud
rates up to 1.5Mbps which is suitable for minimum transmission rate requirement. The
converter can also provide 5V, 2.5W (for usb 1.0/2.0) power directly from the usb port to
transceiver circuits. So, no external power supply needed. And it reduces the complexity of data
transfer unlike using a system with a MCU. The converter costs around 13-15TL with taxes and
transportation. So, this converter selection is also a low-cost solution. And it also enables the
end product to be a PnP device. Another advantage of this device is the data transmission flow
control can be achieved by a software defined control method. And this feature enables the
computer engineering team to easily manipulate and control the data packages.

Software Interface and Data Packaging: Since there isn’t any physical clock signal between
two computer systems and a serial communication protocol is necessary to use, the team
decided to use serial UART protocol for data frame packaging. More information is provided
in the Computer Engineering subtopic.

Laser Safety Regulations: For the safety regulations aspect, according to Sabancı University
laser classes and hazards report, a 5mW visible laser (class 3R) or below may be used without
protective eyewear if direct eye exposure is avoided and safe if carefully handled [8]. And for
class 3R (5mW to 500mW output power) products, protective eyewear will be necessary but
none of these classes has fire hazards [8]. And according to Virginia Tech Laser safety hazards,
all the lasers operating in the visible spectrum are hazardous to human eye retina [8]. So, the
choice of wavelength won’t affect any changes in eye safety regulations aspect. One of the most
important parameters of hazardous effects of lasers is determined by its output power. [5] Since
the intended range of communication is not far (30m), a low power LD may be used to achieve
a link between two points. This gives an advantage to use a low cost and low powered LD
which is less hazardous to the human eye since output power is between 5mW-500mW [9]. In
reference [58], an ANSI Z136 standard describes guidelines for implementing a safe laser
program in different areas. Also reference [59] describes another international standard which
is IEC 60825-1 about laser safety. An appropriate laser diode selection will be made by
considering these standards.

7
Determining the wavelength:

In order to use a visible laser beam in this project, a source which emits light in 380nm
to 700nm wavelengths must be used because the human eye mostly detects EM waves in this
range [6]. In the Commercial LD market, there are generally three visible wavelengths. The
most common laser pointers are red (630 nm-670 nm), green (520 nm and 532 nm) and violet
(405 nm and 445 nm) [7].

Figure 4, Visible light Spectrum [10]

Determining the modulation technique:

Modulation is a mandatory step in communication systems in order to transfer the data


bits effectively and safely through space. Radio/GSM communication modulation techniques
use carrier waves to carry out the data signals, but in this project, this carrier will be a visible
laser beam. As some of the different modulation types explained in the previous section, the
electronics team preferred to use Direct OOK-NRZ since the TTL interface also uses NRZ
similar format in this application, therefore it is more suitable and needs fewer complex
circuits.

Figure 5, OOK-RZ and OOK-NRZ Modulation Format [14].

8
Since this modulation is used to transfer data digitally and has simpler circuitries which
can be constructed with fewer components. These features naturally also reduce the cost of the
overall project. OOK-RZ modulation can simply be done by changing the on/off state of the
LD depending on incoming serial data bits. This modulation will be used in the transmitter
circuit. And similarly, in the receiver circuit, a corresponding direct detection and demodulation
step is also necessary to reconstruct sent data bits from laser beam form to digital voltage levels.

Cost Constraints:

It is also important to add that the financial support of the faculty, which is 1000TL for
2 EEE students, should be enough to provide necessary components for the project. And since
most of the engineering design criteria are chosen to be low cost solutions, there is no risk to
exceed the cost limit.

1.4. Conceptual Solutions

In this section, some possible system design solutions will be evaluated.

1.4.1 EEE Conceptual Solutions

Concept 1:

This concept has been implemented in references [19] and [13]. The block diagram of
this concept has shown in figure 6.

Figure 6, Block diagram of concept 1.

9
And the circuit schematic is given in figure 7.

Figure 7, Concept 1 Laser Transceiver circuit schematic [19].

This concept uses RS232 standard to interface electronic components with PCs. And it
uses a Max232A module to convert RS232 to TTL logic signals. It has an external power supply
to provide power for necessary circuit components. Schmitt triggers are used to clean up
incoming signals into sharp square shapes [19]. And a 7405 open-collector hex inverter IC has
been used as an LD driver [19].

Concept 2:

This concept has been implemented in reference [17]. The block diagram of this
concept has shown in figure 8.

10
Figure 8, Block diagram of concept 2 [17].

This concept uses Raspberry pi as a data terminal. Transmitter system can transmit data
at max 700 kHz with 0 BER. The concept uses a USB to TTL converter for the
interface. Schmitt trigger circuitry is used to match necessary voltage levels. The driver circuit
has been designed for a high current rated LD (1.2Amps). A transimpedance amplifier
configuration has been used to convert optical signals into electrical signals. Then a
noninverting amplifier amplifies incoming signal from the transimpedance amplifier output.
The output of non-inverting amplifier is then fed into a comparator circuit. And this circuit
matches input voltage levels (0-5V) into TTL voltage levels (0-3.3V).

Designed circuits are given in the following figures:

Figure 9, LD Driver circuit [17]

11
Figure 10, Schmitt Trigger circuit [17] Figure 11, Transimpedance Amplifier circuit
[17]

Figure 12, Non-Inverting amplifier and comparator circuits [17]

12
Concept 3:

This concept has been implemented in reference [21] with a normal led. But this can
be implemented by a laser diode too. The block diagram of this concept has shown in figure
13.

Figure 13, Block diagram of concept 3.

Figure 14, Physical implementation of concept 3 [21].

Figure 15, Circuit Schematic of concept 3 [21].

13
The main difference of this concept is the transmitter and receiver circuits are connected
to pc by a mcu. And this mcu controls the flow of data between the transmitter, receiver and
host PC. A low powered led has been driven by a npn bit. And in the receiver circuit, a simple
npn phototransistor is used. This concept is used for close range applications. But as a
disadvantage, a mcu can be a bottleneck for high speed data transmission. Also, this solution
would be a more expensive solution compared to concept 2. Also, data should pass through 2
mcu before reaching a target pc, so the packages are harder to control by the computer
engineering team.

Comparison of the Concepts:

Table 1, Comparison of the concepts.

After comparing different categories of the concepts, concept 2 is the best solution
according to the table 2. So, the team decided to develop different designs according to the
specifications of the project by taking the concept 2 as reference.

14
1.4.2 CMP Conceptual Solutions

Authentication:
Concept 1:
One of the earliest primary agreement protocols published in 1976 by Diffie and
Hellman is Diffie-Hellman. The goal of the Diffie-Hellman protocol is to make it possible to
safely share a session key between two parties, which can then be used for Next is symmetric
message encryption. There are two public in this protocol Communicating parties exchange
numbers: a large prime integer q and a large prime integer q. The primitive root is a. The
efficacy of Diffie-Hellman comes from the complexity of to compute discrete logarithms. The
protocol, however, is vulnerable to man-in-the-middle attacks. [36]

Concept 2:
Passwords are the key way to access the Internet today. Because of their intuitivity and
ease of use, in large part. Since A Because In several connections, users need to enter passwords
repeatedly and these passwords tend to be easy to remember and can be used for applications.
Repeatedly entered with a low error probability. They have a tendency to be Low-grade and
not-so-random, brute-susceptible secrets Attacks force guessing.
To fix this, a Password-Authenticated Key Exchange (PAKE) tries Issue by building an
exchange of cryptographic key that does not the password or password-derived data is
transferred as a result. Across a channel that is unsecured. Two sides in the exchange show that
without disclosing it, ownership of the shared password. Such, such, Therefore, exchanges are
immune to offline dictionary brute-force via attacks. [37]

Advantages of Diffie-Hellman: No prior knowledge of each other is required by the


sender and recipient. The communication of data can be achieved via an unreliable channel
until the keys are exchanged. It is secure to share the hidden key. After comparing the concepts,
concept 1 is the best solution for Authentication.

15
Serial Port Communication Library:
Concept 1:
PySerial is a Python library, which provides support for serial connections. It is
supported on Windows, Linux platforms. PySerial library features; [38]

• Access to the port settings through Python properties.


• Support for different byte sizes, stop bits, parity and flow control.
• Working with or without receive timeout.
• Same class based interface on all supported systems.
• The port is set up for binary transmission. No NULL byte stripping etc.
• Compatible with io library of python.

These features of PySerial, makes PySerial preferable library for our project. Support
for different byte sizes, stop bits, parity and flow control is an important need for our UART
communication. Setting the port for binary transmission is also required since our transmission
from data terminal will be in binary form.

Concept 2:
C# language has System.IO.Ports library, which is a library that contains classes for
controlling serial ports. The most important class from this library is the SerialPort class. It
provides a framework for event-driven and synchronous I/O, access to serial driver properties.
It can be used to wrap Stream objects, allowing the serial port to be accessed by classes that
uses streams. [39]
The SerialPort class supports ASCII Encoding ,UTF8 Encoding, UTF32 Encoding and
any also support any alternate encoding, but the programmer must use the Readbyte or Write
method and perform the encoding himself.
Both libraries can work for our intended purposes. Because of that reason, it becomes a
comparison of the programming languages themselves. Both Python and C# are object oriented
languages. Moreover, Python is a dynamically-interpreted language, which makes it faster in
development time against C# statically-typed compiled language. Since C# is supported by
Microsoft, it gives more reliable support than community supported Python. Because of it’s
easy to read syntax Python is the easier to learn and use between the two languages, while also
being the lighter language on hardware.

16
Table 2, Comparison of the concepts

Concept Development Support Simplicity of usage


Speed

Python
(PySerial)
+++ ++ +++

C#
(SerialPort)
++ +++ ++

Because of its faster development speed, simplicity of usage and dynamic development
process and based on the talks we had with our advisor, Python is selected as the implementation
language of the program and PySerial is selected as the associated library for serial
communication.

17
1.5. Physical architecture

A top-level physical architecture for selected conceptual solution has depicted in the
figure below.

Figure 16, System interface diagram

An input can be taken by the user the from computer memory such as a “.txt” format
text document. The user interface here serves an important role as a bridge between the user
and the rest of the system. The user should first enter the true COM port number where the
hardware plugged in with the baud rate information to the settings window from the GUI. Then,
as a second stage of this communication process, the user shall press authentication button. This
button first opens a serial port to the device. And then, authentication algorithm runs. After the
authentication completed successfully for both sides, transceiver features becomes enabled for
the users to start communication. When a file reception start, the software asks the user to select
a path for saving the incoming data file. During the communication, users can change the
transmitting file at any time in the transceiver window. For transmission, the data is written into
the input buffer inside the converter and then the data sent to the transmitter circuit with OOK
modulation format. This modulated signal enters the bjt laser driver. And then, the laser diode
turns on and off accordingly. After the optical signal passes the free space, the receiver circuit
converts the incoming optical signals into electrical signals with the TIA.
And then, amplified signal fed into the USB to TTL converter’s Rx (receiving) pin at the second

18
data terminal. After then, the data read and manipulated by the software via using receiving
algorithms which can understand file start and file end. Finally, sent data is ready to be read at
the second user terminal memory with the corresponding data format. Working principles of
the sub-systems are explained in section 3 more in detail.

Figure 17, Physical System representation of FSO Communication Link (background picture
reference [16]).

19
2. WORK PLAN

2.1. Work Breakdown Structure (WBS)

1. Free Space Optical Communication

1. Electrical and Electronics

1.1.1 Order parts

1.1.2 Construction of the designed circuits

1.1.3 DC voltage/current measurements

1.1.4 AC voltage/current and bandwidth tests

1.1.5 Bandwidth and BER tests using a serial communication software

1.1.6 Soldering approved circuits

1.1.7 Integration tests

1.1.8 Mechanical design and construction of circuit box

2. Digital Communication (Software)

1.2.1 Message Packaging

1.2.1.1 Communications Protocol Implementation

1.2.1.2 Package Configuration

1.2.2 User Interface

1.2.2.1 Designing User Interface

1.2.2.2 User Interface Implementation

1.2.3 Authentication

20
2.2 Responsibility Matrix (RM)

Table 3. Responsibility Matrix for the team.

2.3. Project Network (PN)

Figure 18. Project network

21
2.4. Gantt chart

Figure 19. Timeline for the first 8 weeks of the project

Figure 20. Timeline for the 9th to 13th week of the project

22
2.5 Costs

All ordered testing elements and final product components are listed in the
table below.

Table 4, Table of costs.

Quantity Unit Cost Total


Component Product
10/12/2020 Cost (TL)

Breadboard 2 8.82 TL 17.64


Pertinax 5x10cm 3 2.58 TL 7.74
KY-008 laser 2 6.3 TL 12.6
Soldering iron 1 13.29 Tl 13.29
Led 12 0.15 2.24
High speed rail to rail opamp 4 1.75 TL 7
LM311p

Switch DC125B 2 1.67 TL 3.34


1x40 Male header 1 1.3TL 1.3
Male-male jumper (x40) 2 3.71 TL 3.71
2 W 330Ω resistor 10 0.3 3

1/4 W 10kΩ resistor 1(10 in one 0.46 TL 0,46


pack)

1/4 W 5.6K Ω resistor 1(10 in one 0.46 TL 0.46


pack)

1M Ω potentiometer 2 1.38 TL 2.76

10 nF ceramic capacitor 1(10 in one 1.38 TL 1.38


pack)

23
1 pF ceramic capacitor 1(10 in one 1.38 TL 1,38
pack)
4-pin USB – TTL converter , UART 2 13.81 TL 27.62
PL2303HX
6 0.37 TL 2.22
2N2222 transistor Bjt Npn
6 4.18 TL 25
IRF540 N channel Power Mosfet TO-
220

2 0.28 TL 0.56
6x6 4.3mm Tach Button

Tripod 16 cm 2 12TL 48.5

2 6.96 TL 14
BPW34 Photodiode

3 2.94 8.82
GP CR2032 3V battery
3 1.34 4.02
CR2032 battery holder
3 1.04 3.12
8 Pin DIP IC socket
3 2.33 6.99
Pertinax 5x10cm
50 0.03 1.5
10Mohm resistor
50 0.03 1.5
2.2M Ω resistor
50 0.03 1.5
330k Ω resistor
2 39.6 79.2
AD8005 opamp
1 38 38
50mw Laser
2 4 8
3V 5mw laser
2 16 32
5V 6520nm 5mw RYS1230 laser
focusable

24
4 0.21 0.85
0.5 A Fuse
- - -
Cardboard

Circuit box
- - -
Plastic Receiver telescope tube
- - -
10 uF 25v capacitor

Overall cost with transportation: 468.46 ₺= 56.34$ (17/05/2021)

The finalized product components’ costs and total cost per product information are
listed in the BOM (Bill of materials) table below.

Table 5, Bill of materials.

Component Product Reference Quantity Unit Cost Total Cost (TL)

(For Figure 55, Final circuit schematic) Designator

Pertinax 5x10cm - 2 2.58 5.16

Soldering iron - 1 13.29 13.29

Led D2,D3,D4 3 0.15 0.45

High speed rail to rail opamp


U1 1 1.75 1.75
LM311p

Switch DC125B SW1 1 1.67 1.67

1x40 Male header J1 0.5 1.3 0.65

Male-male jumper (x40) - 1 3.71 3.71

25
2 W 330Ω resistor R2,R3,R6 3 0.3 0.9

1/4 W 10kΩ resistor R5 1 0,046 0,046

1/4 W 5.6K Ω resistor R1,R4 2 0,046 0.092

1M Ω potentiometer RV1 1 1.38 1.38

10 uF 25v capacitor C2 1 - -

1 pF ceramic capacitor C3 1 0.138 0.138

4-pin USB – TTL converter , UART - 1 13.8 13.8


PL2303HX

2N2222 transistor Bjt Npn Q1,Q2 2 0.37 0.74

IRF540 N channel Power Mosfet Q3 1 4.18 4.18


TO-220

Tripod 16 cm - 1 12 12

BPW34 Photodiode D5 1 6.96 6.96

8 Pin DIP IC socket - 1 1.04 1.04

5V 6520nm 5mw RYS1230 laser D1 1 16 16


focusable

1/4 W 1kΩ resistor R_CL2 1 - -

26
0.5 A Fuse FU1 1 0.21 0.21

Cardboard - - - -

Circuit box

Plastic Receiver telescope tube - - - -

Total System cost - 2 84₺ 168₺

26/04/2021 (10.1$) (20.2$)

Cost per product Actual System Cost (*2)

27
2.6 Risk analysis

2.6.1 EEE Sub-system Risk analysis

In our project risk elements are severs by their importance’s. There may be some physical
damages, such as eye injuries or tissue injuries, which is are very crucial and must be prevented
from these risks. Also, there are some technical and environment sourced risks, environment
risks can define as which risks occur due to circumstances beyond our control (such as fog,
moisture etc…). Results of these risks, all safety precautions and technical mitigation plans
must be taken.

The risk assessment topics of the project may be declared as in following subjects:

· Eye contact and physical exposure of laser diode.

· Interruption of laser diode due to mechanical (person, car, etc…) or the


environment condition (such as; fog, moisture, clouds etc…).

· Electrical dangers in the project (such as; electrical fire, electric shock, etc…).

· Electronic faults due to the components or the software.

· Location of transceivers and laser pointing.

Table 6, Risk Matrix.

This event is very low risk and so does not require any plan for
Severity of the event on the project Very
mitigation. In the unlikely event that it does occur there will be only a
success LOW
minor effect on the project.
EL
EV

This event is low risk: a preliminary study on a plan of action to recover


Minor Moderate Major LOW
L
SK

from the event can be performed and noted.


RI

Mechanical Electrical Weather This event presents a significant risk; a plan of action to recover from it
of the event occuring

Unlikely Medium
Interruption Dangers Condition should be made and resources sourced in advance.
Probability

Software Physical Location of This event presents a very significant risk. Consider changing the
Possible HIGH product design/project plan to reduce the risk; else a plan of action for
Error Exposure Transceiver
recovery should be made and resources sourced in advance.
Component Electronic Eye Contact VERY This is an unaccaptable risk. The product design/project plan must be
Likely
Fault Faults With LD HIGH changed to reduce the risk to an acceptable level.

28
Table 7, Risk assessment table.

Failure event Probability Severity Risk level Plan of action


Mechanical Unlikely Minor Design a project in a less crowded place
We can avoid and design
interruption Mechanical Interruption may VERY LOW and consider this problem while
our project considering
of LD occured in public areas. this scenario. implementing.
Unlikely Moderate All the protections and precautions must
Electrical We are not using very high voltage or When working with
LOW be taken. Also, buddy system can be
Dangers current. Therefore, we don't expect to electricity, team must be
see electrical dangers in our project. careful. used for safety.
Minor
Software Possible Errors can be detected
LOW Code editor or de-bugger can be used.
Error Software errors can be occur easily. and corrected in a
minute.

Component Likely Minor


Our circuit elements are not very Faulty parts must be MEDIUM Have spare parts to replace.
Fault
reliable, there will be fault easily. replaced.

Physical Possible Moderate Be careful and wear the protection


LD ca n hurt or i rri tate the s ki n a nd Hurts or health problems MEDIUM
Exposure orga ns . can be occured.
equipment.

Unlikely Major
Weather Fog, moisture and similar Necessary actions must be taken and
In our res ea rches we obs erved
conditions effects the MEDIUM
Condition tha t the, s ome times , wea ther
quality of communication
optics can be used to focus LD.
condi tion effects the FSO s ys tems .
negatively.
Likely Moderate
Electronic From our experience, circuit design and All the circuits must Before implementation use simulation
implementation is crucial and in this HIGH
Faults process there can be occur faults and
simulated before softwares.
error very often. applications.
Major
Location of Possible
Locations must be
Targeting laser to receiver is crucial to HIGH Analyze the locations.
Transceiver sustain communiciation.
identified before start the
FSO.

Eye Contact Likely Major Wear the protective eye glasses or other
Whi l e LD i n on pos i tion, l a s er Protective equipment VERY HIGH
with LD bea m ca n be ha rmful for eyes .
necessary equipments.
is needed.
Likely Moderate Options of the hardwares and softwares
Integration
In integration, all the parts Project maybe HIGH must listed. And optimization must
Error
may don't work mutually. delayed. concluded.

29
2.6.2 CMP Sub-system Risk analysis

Table 8, Risk assessment table.

Failure Event Probability Severity Risk Level Plan of Action

Likely The program itself


will inspect the
Packet loss Losing packages coming packets
during transmission header and in case
during of a packet loss, it
would be the biggest Major High
transmission problem the program will send a message
could encounter back informing the
because of the open sender about the
space nature of the packet loss so that
transmission problem can be fixed
by packet
retransmission

Unlikely

USB Port There is always Minor Low Changing the usb


Failure chance to have port would be
mechanical problems
on computer
enough

30
3. SUB-SYTEMS

3.1 Electrical and Electronics Engineering

Briefly, Electrical and Electronics Engineering team researched and developed physical
layer of the FSO communication system.

3.1.1. Requirements

In developing new world, remote accessibility and wireless communication, data &
information transfer absolutely has a significant role in communication systems. Optical
communication system technologies have been undoubtedly progressed under the effect of
insufficient radio communication techniques such as; security, emergency, fast data transfer,
low power consumption etc. Therefore, using optical spectrum will be mandatory for wireless
communication [1].

The user scope of FSO contains; military and defence area, who need/expect high data
transfer speed and secure connection, aerospace industries, metro-network extensions [2].
Especially FSO communication systems may be used in point to point connections for long and
short ranges such as providing connections between two buildings, two ships, from aircraft to
ground or satellite to ground [2]. Also, this paper uses this point to point connection concept to
achieve full duplex data transfer.

Results of the progression of FSO, advantages affect lots of sectors positively. For
instance, LAN connection of each user on the same establishment [3]. Fast, secure and reliable
data transfer and communication can be provided by FSO systems. Other usage purposes can
be defined in terms of energy efficiency, infrastructure costs, not affected by RF signals, wide
bandwidth, high speed by comparing other communication techniques and secure data transfer.
The FSO technology is used by many locations already, although developments and
progressions will make this technology more usable and reachable in our daily life.

31
The design and performance goals which effects electronics and interface design of
this project are:

1) Establish FSO link between two points.


2) Implementing a transceiver design (two-way communication).
3) Using a visible laser.
4) Must provide reliable communication at 30-meter range.
5) This link should transfer data at least at 1kbps rate.
6) Data source will be a data terminal which runs a user interface application and
provides a digital input/output to electronic circuits.
7) Designing an optical transmitter laser modulation circuit.
8) Designing an optical receiver sensor and circuit.

3.1.2. Technologies and methods

In the basic and common FSO systems:


There are several modulation techniques for modulation. Modulators, transmitters, LD to
transmit the message, receiver as a photodiode or light detector and demodulator elements,
demodulation techniques, can be used in system [5].

Schematic of the basic FSO system can be seen in Figure 21.

Figure 21, A basic FSO communication system [12]

There are many methods and modulation techniques available to establish FSO links. Some of
the modulation methods are; Embedded Electronic Modulation, Optical Choppers, Optical
Shutters, Acousto-Optic Modulation, Electro-Optic Modulations, Subcarrier Intensity
Modulation [4, 5]. Also, according to other resource On-Off Keying and Pulse Position
modulation methods are commonly integrated modulation techniques [5].

32
Figure 22, Optical Intensity Modulation Techniques [5]

For a brief information, some of the modulation techniques are defined below:

1. Embedded Electronic Modulation; this modulation technique needs only a function


generator and it generates the supplied power to the laser diode. According to source, this
method is easiest to implement [4].
2. Optical Choppers; the rotating obstacles are placed in front of the laser diode and these
obstacles can be a disk or other design which is turned and controlled by a DC motor [4].
3. Optical Shutters; main working principle depends on a physical object which is blocking
the laser beam by opening and closing such as a camera shutter [4].
4. Acousto Optic Modulation; the main working principle based on sending instantaneous
signals to the laser diode to oscillate the laser diode, at the end of this process we get the
modulation [4].
5. Electro-optic Modulation; features of the material are changed by electric field that
alters the laser beam’s polarization [4].
6. On-Off Keying; in OOK data transfer is based on binary. Therefore, while the bit is 1,
the laser beam turns on. When the binary bit is 0, there is no data to transfer, the result of that
laser beam turns off [5].
7. Pulse Position Modulation; when the amplitude and the width is not changed, but
position of reference changes refer to sudden sampled value of the signal which carries the
message [5].
8. Subcarrier Intensity Modulation; principles of SIM depends on modulation of
information previously by subcarrier RF signal. Also, that subcarrier can be modulated by using
other modulation techniques (such as; FM, AM, etc…).

33
Figure 23, Block diagram of FSO Communication link [5].

In the figure 23 above, the basic block diagram has been depicted. This diagram shows
which steps a message signal to pass in an FSO system. This path is mostly the same in all
design concepts.

Transmitter: A message signal is provided from a digital or an analog source. Then this
message arrives to the modulator circuit. Modulation is a necessary step to pass the message
from a channel as explained in the previous paragraph. Then this signal arrives at a drive circuit.
The drive circuit drives a laser diode and it provides necessary current (power) to the LD. From
now on the message signal is in forms of optical rays. At the final step, an optional transmit
telescope is used to focus rays to provide narrow and higher signal intensity on the receiver
side.

Atmospheric Channel: Atmospheric channel is the space where lies between transmitter and
receiver. The rays may be affected by different kinds of reasons such as absorption, scattering
and turbulence. Also, there is some space loss which weakens the signal power. And these
things make optical communication harder for long distances. At the receiver side, has some
optical background noise with the signal which changes SNR also the reception quality.

Receiver: Optical waves first arrive at an optical telescope. The optical signals are focused on
a certain area to increase signal quality. Then an optical filter is used to eliminate optical
background noise. And then a photodetector is used to convert optical signals into electrical
signals. After that signal amplification and demodulation steps are used in most of the systems.

34
3.1.3. Physical architecture

After determining the reference concept, some system elements and specifications are
combined into a new system interface diagram in the figure below.

Figure 24, Modified system interface diagram of FSO transceiver system design with Usb to
TTL converter.

The working principle of this system can be explained as following:

1- Digital data generated from the source PC and written to a certain usb port. All the
necessary power for electronic circuits is supplied from source pc.

2- The usb serial data then converted into TTL logic level signals in order to interface with
transmitter and receiver circuits.

3- The converter then feeds data pulse signals from the Tx pin with 3.3v for logic 1 and 0v for
logic 0 levels to the rest of the transmitter circuits as an OOK modulated pulse signal.

4- BJT laser driver turns on and off the LD according to the input signal. By this way, the data
signals create optical pulses on the LD.

35
5- At the receiver side, a receiver telescope used to reduce optical noise on the PD.

6- A photodiode converts incoming optical waves into electrical signals.

7- A transimpedance amplifier amplifies the electrical current signal coming from the
photodiode and converts it to voltage signals.

8- Output of the opamp then fed into the usb-ttl converter Rx pin. And this pin is connected to
a schmitt trigger circuit internally.

9- The received signal pulses are then written into the buffer inside the converter in order to
send the data to the PC.

Determining the LD:

The choice of wavelength in FSO communication systems is a critical design parameter


because it affects the connection performance of the system and detector sensitivity [5].
According to the formula given below, the reception power depends on various variables shown
in figure 25.

Figure 25, Reception power formula [5]

After a commercial market research, a low-cost visible LD can be found in two types
as class 3B or 3R. Shown in table 9 as following:

36
Table 9, Commercially available and common lasers.

Table 10, Comparing two laser products.

As a result of table 10, the electronics team decided to use the KY-008 laser product in
the first place because of the overall advantages compared to the other laser product. However,
since the output power is less than the other laser, the reception power and intensity may not be
sufficient for long distance communication. If it is the case, necessary products and pre-
designed circuits will be switched depending on the performance tests.

Determining the receptor element:

A photodiode, a photoresistor, a photovoltaic cell or a phototransistor can be used to


construct a receiver circuit. According to the experiment made in reference [22], a photodiode
has the best rise and fall time. Also, most of the optical communication systems are made with
photodiodes according to reference [23]. So, it is convenient to use a photodiode in the receiver
circuit. According to reference [28], a PIN type photodiode has the best overall advantages
among other types of photodiodes and its response time decreases as more reverse bias is

37
applied on the photodiode. After a commercial market search, the team decided to use a PIN
silicon photodiode BPW34, BPW34S. According to the datasheet [29], this product can detect
wavelengths in the visible spectrum, it has 100ns of rise and fall times which is applicable for
above 1kHz operation, it has a radiant sensitive area of 7.5 mm2, and it can produce about 50uA
of photocurrent with 1mW/cm² intensity, where wavelength = 950nm and Vreverse = 5v. Also,
this product is affordable, which costs about 7TL. So, this product satisfies the performance
specifications and should operate without any problem when appropriate reception techniques
are used.

Sub Architectures and Circuit Schematics:

Architecture A:

Uses not gates and drives up to 2 Watts LD with USB 2.0 / 50 Watts with external power
supply /10 Watts with regulator.

Figure 26, Circuits of Architecture A. (Drew in Proteus 8 professional)

38
Circuits Explanations:

TTL Male header: Connects the ttl female jumper cables to the circuits. A switch also used
to turn on and off the circuits.

Figure 27, TTL circuit schematic.

Led indicators: May be useful for the user to indicate the power, receiving and transmitting
states by using low power leds. Assuming all are green LEDs. Then the forward voltage of 2V
5V−2V
drops across them. And Id = =10 mA. P = 5V*10 mA =50 mW. All led circuits draws
300Ω

3 *50 mW= 150 mW power when they operate at the same time.

Figure 28 led indicator circuits.

39
Figure 29, regulator circuit.

Regulator: A 12V to 5V regulator circuit can be implemented to draw power from external
sources. The LM7805 provides 5V, 2.2A, 11W power. And another two-way switch can be
useful for high and low power operation power source selection. This circuitry is very useful
if the usb power becomes not sufficient for high power LD operations (P>2.5W).

Transmitter circuit:

Architecture A inverts the transmitted and received voltages because the Tx and Rx
pairs at the TTL interface remain “high” at idle condition. In this way, power consumption can
be improved and the risk of environmental harm of the laser reduces significantly by turning
off the laser diode at idle condition.

The first stage of the circuit is the not gate by using a bjt. And the second stage is the
LD driver. When the tx pin goes high, Q4 turns on and pulls the gate voltage of Q5 to 0v. Then
Q5 turns off, thus the laser turns off while the circuit is in idle condition or while a “1” bit is
being sent. When the tx pin goes low, Q4 turns off and the collector voltage of Q4 becomes 5V
which is also gate voltage of Q5. Then Q5 turns on and thus the laser turns on. A pushbutton is
used in parallel to Q5 for manual Tx-Rx LOS alignment.

40
Figure 30, Transmitter circuit of architecture A.

Theoretical calculations:

Vtx (On)= 3.3V, Vtx(off)=0V Assuming, gain =β=200

When Tx = ON;

3.3V−0.7V
Ibase_q4= = 130uA
20kΩ

Icollector_q4 = Ibase_q4* β = 130uA *200 =26 mA

5V−0V
= 1mA <26mA, Therefore Icollector_q4 is saturated at 1mA.
5kΩ

And Vcollector_q4 = 5V-(5KΩ*1mA) = 0V =Vg (Q5)

When Tx = OFF;

Ibase_q4=0uA, Therefore, Icollector_q4 =0mA,

and Vcollector_q4 = 5V-(5KΩ*0mA) = 5V = Vg(Q5)

41
Driver circuit calculations:

According to the datasheet of the usb-ttl converter, the tx pin can support up to 5mA
current. So, a driver circuit should be implemented since the LD draws 30mA minimum.

From enhancement type mosfet, current and gate voltage equation in reference [25].

Assuming Vt =3V, Vgs=5V, I(on)=30mA.

I(on) A
K=(Vgs−Vt)² =0.0075V²

Thus, general formula for LD current yields;

ILD=k(Vgs-Vt)²= 0.0075(Vgs-3)²

And according to the datasheet of the IRF540NS N-Channel MOSFET, When Vgs=Vds=5v,
the mosfet can provide about 10A of current at room temperature as shown in figure 31.

Figure 31, Current/voltage device characteristic curves of the mosfet [26].

42
Simulation of the Transmitter circuit (Architecture A):

Figure 32, Transmitter circuit simulation.

In the simulation data given above, a 9.6 kHz, 3.3V-0V, square wave signal applied to
the Tx input of the transmitter circuit. As a result, in the digital oscilloscope screen, the input
signal (yellow) is inverted as expected in the collector leg of Q4 which is output of the not gate
(blue). And the drain voltage (pink) swings between 5V (mosfet off)-0V (Mosfet on) as needed
since the LD is driven by current.

Receiver:

Figure 33, Receiver circuit of architecture A.

43
The receiver circuit given in figure 33, consists of a transimpedance amplifier and a not
gate. The transimpedance amplifier has been designed and modified for this application by
considering the circuit given in [27] as reference.

The working principle of the receiver starts with the photodiode. The photodiode
converts optical signals into electrical signals with the help of photoelectric effect. The
maximum absorption wavelength can be calculated by using the formula given below.

For Si, Eg = 1.11 eV. Thus, maximum absorption wavelength is 1.11um = 1110nm.

And photon energy can be calculated by the Planck-Einstein relationship (E=hv).

3∗108
for a red laser with wavelength of 650nm, c = v then f=c/650nm=650∗10−9 = 461 THz

3∗10−19 J 3∗10−19
E=6.62*10−34 *461*1012 =3*10−19J= =1.6∗ 10−19 𝑒𝑉 = 1.9eV
q

Since 1.9eV ≥ 1.11eV, The red laser can be absorbed by the silicon photodiode.

A PIN photodiode under reverse bias has shown in the figure below.

Figure 34, PIN photodiode electron hole pair generation [30].

44
The reverse bias voltage creates strong electric fields around the intrinsic region. When
a photon with energy hv which is higher than the bandgap energy of the material illuminated
on the device, it starts to absorb the light and generate an electron-hole pair in the intrinsic
region. And generated pairs are collected with an electric field. The charge flow creates electric
current in the circuit. This current is known as photocurrent, and this mode of operation is
known as photoconductive mode.

Figure 35, PIN photodiode energy band gap diagram [30].

The energy band diagram of a reverse biased PIN photodiode has shown in figure 36.
Since positive voltage is applied on n-type material, the generated electrons in the intrinsic
region tend to flow to the n-side in the electric field and similarly generated holes flow to the
p-type material since it is connected to the negative terminal.

In the transimpedance amplifier circuit, the photodiode is working in photoconductive


mode too, and the generated photocurrent flows from cathode to anode side as shown in the
figure below.

45
Figure 36, transimpedance amplifier current flow [31].

When the incident light starts to generate current, some current starts to flow across the
photodiode and this current must be equal to the amount of the current passing through the
feedback resistor since the inverting input of the op amp has infinite impedance and thus cannot
allow current to pass inside or outside at that terminal. Hence, in order to equalize currents
passing on Id line, the opamp generates output voltage as Vout=Rf * Id.

In our application, a variable resistor is used to be able to tune the output voltage
according to the generated photocurrent. And for Id= 50uA, Vout=5V for Rf=100k

C4 capacitor is used to eliminate noises produced in the circuit. Acts as a low pass
filter with the feedback resistor Rf.

The formula for calculating the high cut off frequency is Fc= 1/(2*pi*R*C)

For Rf= 1MΩ: Fc=1/2pi*1MΩ*0.1pF=1.591Mhz

For Rf= 500kΩ: Fc= 3.18Mhz

Also, it is convenient to operate the photodiode in reverse biased condition since a PIN
type photodiode response time decreases as more reverse bias is applied on it according to
reference [28] because higher reverse bias increases the depletion width, thus reducing the
junction capacitance. However, most of the transimpedance amplifier designs use the
photodiode without applying a reverse bias voltage. If such a voltage is necessary, later it can
be supplied by 1.5V or 9V batteries externally.

46
At the second stage of the receiver circuit, another not gate with bit implementation is
used to invert the voltages for ideally interfacing with the ttl input. The not gate working
principle is the same as the transmitter circuit.

For further improvement, it is important to note that additional high pass and low pass
RC filters may be simply added next to the transimpedance amplifier depending on the
introduced circuit noise while taking measurements on the circuit in the evaluation part.

Simulation of the Receiver circuit (Architecture A):

Figure 37, receiver circuit simulation.

In the simulation figure given above, a 9.6kHz with 0A/ -50uA pulsed, 100ns rise and
fall time current source signal has been used to act as a photodiode producing a photocurrent
signal. On the digital oscilloscope, it is clearly showing the transimpedance amplifier
transforming and amplifying the received current signal to 0-5V square wave voltage signals.
And again, at the not gate output, the voltage signals are inverted as expected.

47
Transmitter and Receiver pair optical coupling, intensity and power calculations:

Assuming the laser beam is a Gaussian Beam.


Related beam parameters:
Pout=5mW, 𝜆 = 650𝑛𝑚 (𝑅𝑒𝑑) , Waist radius = W0 (measured) = 1.5mm

Figure 38, laser (Gaussian) beam propagation.


W02 ∗𝜋
Rayleigh Range = Z0 = = 11.16m
𝜆

Waist radius equation at a certain range Z is given by:


(Communication distance = 30m = Z )

W(Z) = W0 ∗ √1 + ( Z0Z )²

30m 2
W(30m)= 1.5mm ∗ √1 + ( ) = 4.3𝑚𝑚
11.16m

Spot size at 30m = 2 W(30m) = 8.6mm


According to the datasheet of the photodiode [29], the radiant sensitive area is
7.5mm². And The radiant sensitive shape dimensions are given as 3mm*3mm.
The Intensity equation for a gaussian beam is given by:
𝑝²
W0 −2
I(p,z) = I0( )²*𝑒 𝑤(𝑧)²
W(z)

Where p = √𝑥 2 + 𝑦²

48
2𝑝
I0 = = 141mW/cm²
W02 ∗𝜋

intensity on beam axis: I(0,30)= 17.15 mW/cm²

Figure 39, Receiver radiant sensitive area.

p_max = √1.5𝑚𝑚2 + 1.5𝑚𝑚² = 2.12mm


Minimum intensity on the radiant surface occurs when p= 2.12mm:
I(p_max,z) = I(2.12mm,30m)=10.55 mW/cm²

Figure 40, Intensity Curves at different distances (graphed in matlab).

49
Total Optical Power on the Radiant Sensitive Surface:
(inside the circle with radius p=1.5mm)
Power equation is given as:
𝑃𝑢𝑝𝑝𝑒𝑟_𝐵𝑜𝑢𝑛𝑑

∫ 𝐼(𝑝, 𝑧) ∗ 2 𝜋 ∗ 𝑝 ∗ 𝑑𝑝
0

1.5𝑚𝑚 1.5𝑚𝑚
𝑝²
−2
∫ 𝐼(𝑝, 30) ∗ 2 𝜋 ∗ 𝑝 ∗ 𝑑𝑝 = 1081 ∗ ∫ 𝑒 4.3𝑚𝑚² ∗ 𝑝 ∗ 𝑑𝑝
0 0

Figure 41, Definite integral calculation [32]


1081 ∗ 9.98 ∗ 10−7 = 0.001𝑊 = 1𝑚𝑊 power drops on the radiant sensitive area of
the PIN photodiode.
𝑝2
𝑖𝑛𝑓 −2
Also, Pout= 1081 ∗ ∫0 𝑒 4.3𝑚𝑚2 ∗ 𝑝 ∗ 𝑑𝑝 = 5𝑚𝑊, which is correct.
According to the datasheet of the photodiode [29], The device produces 50uA of current
when a 950nm (with relative spectral sensitivity of 1), 5V reverse voltage and Intensity of
1mW/cm² beam used. When we compare with the theoretical results, the minimum Intensity
dropping on the surface is much larger than the given intensity value in the datasheet.
10.55 mW/cm²>>1 mW/cm²
And the power dropping on the surface according to datasheet information is:
P=Intensity*Area = 1mW/cm² * 7.5mm² =0.075mW
And the relative spectral sensitivity for 650nm is about 0.6 given by device datasheet.
Absorbed power assume to be 0.6*1mW=0.6mW.
Therefore the absorbed power also larger than the datasheet results
0.6mW>0.075mW.
So we may conclude that the device should provide the necessary current for the
amplifier circuit to sense the light signal at 30m distance. A focusing lens also can be inserted
in front of the photodiode or the LD to operate at longer distances.

50
Architecture B:

Figure 42, Circuits of Architecture B. (Drew in Proteus 8 professional)


As you can see, another type of transmitter and receiver circuits is in the figure 42, but
team decided to implement circuits in Architecture A.

Additional circuits:

Schmitt Trigger: If some voltage level conversions are needed, or the internal schmitt trigger
of the converter cannot operate as needed, the following circuit may be implemented between
the transimpedance amplifier and the TTL interface Rx pin to obtain sharper signals at the Rx
input. The circuit taken from reference [24].

51
Figure 43, non-symmetrical schmitt trigger circuit.

Figure 44, usage purpose of the schmitt trigger [24].

When the opamp is used in comparator mode to generate digital pulse signals, a small
amount of noise signal may cause the output voltage to change with a single threshold as shown
in the figure 44 (left). Schmitt trigger configuration enables the output to change according to
two different thresholds as upper and lower thresholds.

52
And the necessary calculations are given below to calculate the threshold voltages.

Figure 45, schmitt trigger threshold voltages calculations [24].

It is also important to note that when the input signal passes the upper threshold, the
output voltage becomes 0V. And when the input voltage drops lower than the lower threshold,
output voltage becomes 5V which is the inverted version of the figure 45 (right).

Extra transmitter circuit configurations:

Figure 46, extra transmitter circuit configurations.

The modulation and LD driving processes can also be simply achieved by implementing
any of the above circuits. Only difference from previously designed circuits is the voltage
inversion is not implemented. So, the LD always remains “on” in idle condition. And can be
used with the same transimpedance amplifier without “not gate” at the receiver side as a pair.

53
Figure 47, Cmos laser driver circuit.

The mosfet in figure 47, provides high currents to the LD load by using Tx voltage at
the gate input. A current limiter resistor (R4) may be inserted if necessary. And this circuit
works as a not gate at the same time since the conduction channel of the mosfet formed when
Tx is “low” and deformed when Tx is “high”.

54
3.1.4 Materialization
In this section, historical build process of the physical system is described. Also
encountered failures, implemented solutions and further design improvements are discussed.
After ordered parts arrived, architecture A circuits are constructed as one transmitter
and one receiver circuitry as a couple. Each one connected to a USB-TTL converter. All the
testing power drawn from a laptop from separate USB ports. Then, dc voltage and current
measurements are done with a multimeter. And all the results are matched correctly with the
simulation results as expected. The first prototypes and the test setup has shown in the picture
below.

Figure 48, First breadboard prototypes.

After Dc tests done on the first prototypes, the prototypes are tested for data
transmission. For testing the bandwidth of the circuits, PuTTY software is used to send
messages with UART protocol from one usb port and monitor incoming data from another port.

As a result, the message signals are obtained correctly for low baud rates and the data is
corrupted at above certain baud rates because of the transmitter circuit mosfet gate signal is not
correctly applied. Also usage of the not gates resulted in higher rise and fall times according to
the oscilloscope test results which is shown in table 12.

55
Circuit Schematic Modifications:

In order to improve the bandwidth, some predesigned transmitter circuits are tested and
the resulting performances are compared with each other. As a result, BJT Laser driver gave
the best performance. Then, the architecture A transmitter circuit changed with BJT transmitter
circuit. Also the not gates are removed from the design, since they are limiting the bandwidth
performance. Final circuit schematic with the corresponding changes has shown in the figure
below.

Figure 49, Final circuit schematic.

Another improvement in this renewed schematic is the fuse. And it is used for
short circuit protection. Also, a 1kΩ feedback current limiter resistor in TIA is added in series
with the potentiometer. And additionally the transmitter led indicator circuit is modified to give
better visual effects. This led lights up only when the data is sending. And the receiver led starts
to blink whenever data transmission occur.

56
A parallel C2 capacitor is used for charge accumulation, which lights up the led for
brighter and longer below certain frequencies. This is an analog way of solution for better user
experience. It may not good as a digitally controlled system, however, it has an advantage over
a MCU controlled system in the product cost and simplicity.

Since cheap 5mW ky-008 type laser has bad focusing characteristics at long distances,
it provides less current signal in the receiver circuit which greatly reduces the SNR and the
operating bandwidth according to the results given in table 11 and 13. Therefore, a 5mW
focusable laser product is used in the design as final modification in the design.

PCB Design:

Designing a PCB is an essential stage in hardware development for creating a


professional product and making the design ready for mass production. In this project, the
purpose of PCB design is to layout the components and signal/power tracks on a board in a
more organized manner.
The design done in Altium Designer 2020 software. The design process started first with
creating the component schematic libraries. After then, all the components’ PCB footprints are
drew from scratch. The footprint shows some parameters that how the component dimensions
fit on the board such as components’ leg apertures, mechanical layer, soldering paste layer, leg
hole dimensions etc. While creating the footprints, the component datasheets are used. And for
some components, the component dimensions are measured by using a calliper. Also 3D models
are added to the footprints for showing the 3D dimensions.
In the figure below, LM311p PCB footprint (left) and schematic representation (right)
can be observed as one of the created component.

Figure 50, LM311p PCB footprint and schematic representation.

57
After finishing the component libraries, finalized project schematic drew again in the
Altium designer software to define the electrical connections between the components. This
schematic is shown in the figure below.

Figure 51, Finalized circuit schematic in Altium Designer.

58
After the schematic connections are done and all the design errors solved, the electrical
connections and component footprints are transported into PCB designing window. Then the
necessary component layout done first. Next, the power and signal connections are established
by trying to use one side of the board to reduce the product cost. The finalized PCB layout has
shown in the figure below.

Figure 52, Finalized PCB layout.


Also, 3D view of the PCB created consequently. And it is also provided in the figure below.

Figure 53, 3D view of the PCB.


The board dimensions (x-y) chose as 100mm-50mm, same with the pertinax board sizes.
This can be reduced for mass production. Additionally, SMD components may utilized for
further size and cost efficiency.

59
Also polygon pour for power terminals can be used for a better design.
Subsequently, as the PCB layout done, soldering process started on a pertinax board and
the setup shown in the figure below.

Figure 54, Soldering process and continuity test setup.


After the soldering done for all tracks, short circuit and continuity tests done for
ensuring the connections are true by using a multimeter. Soldered circuit has given in the
figure below.

Figure 55, Soldered circuit.

60
Afterwards, by using a glue gun, the soldered circuit mounted on a tripod, and the laser
head stuck to a bendable metal for enabling separately pointing it from the body. Also, the
receiver telescope glued on the board. Finally, the USB to TTL converter’s female pins are
electrically connected to the board’s male pins. After performance tests successfully passed for
the first product. Second one produced by using the same steps to work as a pair. And the
finalized products are shown in the figure below.

Figure 56, Finalized products.


For further reducing the project cost, no circuit boxes are used. Some unused cables
used in the product for establishing electrical connections in some locations. For the receiver
telescope, a trash cylindrical pill box used and it had painted to black before glued on the board.

61
3.1.5. Evaluation

During the design phase, the USB-TTL converters are tested with some software such
as PuTTY and Serial Port Monitor in order to verify that these devices can deliver data signals
between two terminals when they are physically connected by copper wires. This is achieved
by the connection made in the figure below. And testing phase has shown in figure 50.

Figure 57, USB-TTL converter data transmission test block diagram.

Figure 58, USB-TTL converter data transmission test setup between two separate usb ports.

As a result, it is observed that the converter can transmit data signals between two
computer ports or terminals without any error at different baud rates in a range of 75bps to
1.2Mbps.

During the first prototype tests, the most important part is to calibrate the TIA
amplification by tuning the feedback resistor. For this purpose, a 1MΩ potentiometer is used.
Also in longer distance tests, 2.2MΩ and 10MΩ resistors are used to sense the signal
sufficiently. The receiver LED indicator plays an important role in tuning the feedback resistor.

62
For this purpose, a red LED used since it has a forward voltage drop between 1.7v-2v in general.
And this voltage threshold has a good level for making the output voltage compatible with the
TTL input hysteresis. When the resistor value increased, the receiver led brightness also
increase linearly after this threshold. And when the brightness does not increase more, the
resistor value at that condition will be the most optimal value for operation at that distance
according to the tests and observations. Also, it is important to add that when the feedback
resistor increased, the operating bandwidth decreases since the opamps has a fixed GBP (gain
bandwidth product). Therefore, it is important to keep the resistor value minimum, in order to
operate at higher baud rates. And all the following tests are done by using this method. Some
feedback resistor values for adequate level of sensing has given in table 11. In the table below,
BPW34 photodiodes photocurrent measurements are shown for different distances and
conditions.

Table 11, Photocurrent measurements.


Setup 5mw 5mw 5mw 5mw 5mw Indoor Indoor Outdoor Outdoor Outdoor
focusable focusable focusable laser laser lights lights sunny sunny cloudy
Laser laser laser z=10cm z=30m on off weather weather weather
Z=10cm z=10m z=30m (laser (laser (laser off) (laser off) (laser off)
off) off) with with
telescope telescope
Photocurrent 270uA- 250uA- 1uA – 7uA- 100nA- 1.5uA- 0uA - 350- 9.5uA- 0.1uA-
Min-max
350uA 265uA 8uA 10uA 250nA 2.5uA 0.5uA 400uA 400uA 40uA
Required Rf 4kΩ- 8kΩ- 250kΩ- 200kΩ- 10MΩ-
range
11kΩ 12kΩ 2MΩ 430kΩ 20MΩ - - - - -
2V/Ipd

These results are very useful for interpreting the SNR by comparing environmental
measurements with laser measurements. And especially useful for calculating the feedback
resistance. The feedback resistor can be calculated by dividing the target Vout_max by the
amount of produced photocurrent since Vo=Ipd*Rf. And the calculated resistor results are
coherent with the practical test results.

63
After the dc and bandwidth tests done on architecture A prototypes, since the results are
not good as intended, the circuit behaviours are examined with an oscilloscope. And to solve
this problem, different circuit setups are tested too. A signal generator adjusted at different
frequencies and set to 0-3.3V square wave mode with 50% duty cycle. This signal is connected
to Tx input in the transmitter circuits. And it is used to act as a TTL signal source. For feeding
power to the circuits, a DC power supply used and set to +5V DC. Output results for different
transmitter circuit configurations are shown in table 12.

It is important to note that the oscilloscope voltage measurement probe took the
measurements from a laser driver mosfet drain or from a bjt collector leg. This method is not
totally useful for measuring the bandwidth of the transmitter circuit as a whole since the laser
produces the light when current passes through it. However, since there isn’t any oscilloscope
current measurement probe in the lab, only the voltage measurements are done. Output voltages
for most of the cells in the below table are Vmin=0V and Vmax= 5V as expected for low
frequencies. And this range reduces as the frequency increase. This creates an unreliable system
for data reception. But, since the TTL converter Rx pin has an input hysteresis (maximum 0.8V
is necessary to accept as “0” state and minimum 3V is needed for accepting incoming bit as
“1”), certain voltage fluctuations are acceptable for the operation.

In the table below, Tr= rise time, Tf = fall time and +duty (positive duty cycle)
parameters are logged in order to interpret the circuit behaviours at different frequencies. It is
interpreted that as a circuit configurations result close to the input signal duty cycle (50%), then
it has better response characteristic. Also the colouring in the table below shows good (green)
and bad (red) characteristics.

64
Table 12, Transmitter circuits’ oscilloscope measurements.
Circuit\freq 75 Hz 1200 Hz 9600 Hz 56 kHz 161280 614400 1 MHz
Mosfet driver Trise:30ns Trise:34.8ns Trise:34.4ns Trise:34.4ns Trise:34ns Trise:36ns Trise:36.5ns
(0-5v Tx Tfall:30ns Tfall:33ns Tfall:36ns Tfall:37.5ns Tfall:39ns Tfall:39.6ns Tfall:38ns
signal applied) +Duty:50.3% +Duty:50.2% +Duty:50% +Duty:50.3% +Duty: +Duty:49.8% +Duty:49%
51.6%
Bf494BJT 50ns Tr 50ns Tr 50ns Tr 50ns Tr 50ns Tr 50ns Tr 44ns Tr
resistror:5.6kΩ 30ns Tf 32ns Tf 33ns Tf 32ns Tf 30ns Tf 30ns Tf 36ns Tf
+ Duty: 50% + Duty: 50% + Duty: +Duty: 50.3% + Duty: 50% + Duty: + Duty: 49%
50.2% 49.7%
BJT2n222 168ns Tr 168ns Tr 168ns Tr 168ns Tr 168ns Tr 168ns Tr 168ns Tr
resistror:6.39Ω 168ns Tf 168ns Tf 168ns Tf 168ns Tf 168ns Tf 168ns Tf 168ns Tf
+ Duty: 50% + Duty: 50% + Duty: 50% + Duty: 50% + Duty: 50% + Duty: 50% + Duty: 50%
Mosfet driver Trise:40ns Trise:33ns Trise:82ns Trise:94ns - - -
+ Tfall:4.1us Tfall:4.3us Tfall:4.04us Tfall:4.2us
2n222 not gate +Duty:49.3% +Duty:51% +Duty:54.8% +Duty:77.5%
BJT bf494 95ns Tr 100ns Tr 108ns Tr 108ns Tr 110ns Tr - -
laser driver + 310ns Tf 340 Tf 300ns Tf 290ns Tf+
2n222 not gate + Duty: + Duty: 50% + Duty: Duty: 58.4% + Duty:
20kΩ input 49.3% 51.5% 74.4%
resistor
Mosfet driver Trise:36ns Trise:36ns Trise:36.4ns Trise:41.6ns Trise:40.5ns Trise:42.1ns Trise:41.5ns
Tx+LED Tfall:34ns Tfall:32.8ns Tfall:37ns Tfall:41.6ns Tfall:42.4ns Tfall:44.4ns Tfall:41.6ns
indicator +Duty:50% +Duty:50.5% +Duty:50% +Duty:50.6% +Duty:50% +Duty:50% +Duty:50%
(0-5v Tx
signal applied)
BJT + 44ns Tr 46ns Tr 44ns Tr 40ns Tr 44ns Tr 44ns Tr 46ns Tr
Tx LED 30ns Tf 30ns Tf 30ns Tf 30ns Tf 32ns Tf 28ns Tf 33ns Tf
indicator + Duty: 50% + Duty: 50% + Duty: 50% + Duty: 50% + Duty: + Duty: 49% + Duty:
50.3% 49.6%

65
According to the table above, configurations with not gate implementations has bad
output characteristics above certain frequencies. Therefore, they are removed from the
schematic design in the following tests. And the BF494 BJT laser driver transmitter circuit gave
the best result among other configurations. And also 2n222 laser driver transmitter circuit has
similar results. Because of that, 2n222 bjt is used as new transmitter circuit in the new
schematic. Additionally, it can be concluded that the LED circuits do not affect transmitter
circuit bandwidth up to 1Mhz and therefore, they can be used without any problem.

Following figure shows the oscilloscope result of 2n222 bjt transmitter circuit coupled
with receiver circuit at 50cm distance (inside electronics laboratory), at 1200 Hz with 50% duty
cycle, 0V-3.3V Tx input and the probe measured the Rx terminal from the TIA output pin.

Figure 59, Observed oscilloscope result for Rx pin at 1200Hz (redrew from matlab Simulink).

According to the oscilloscope measurement results, the wave shape perfectly matches
with the simulation results and the output voltage swings between acceptable voltage levels
0v-4.15v.

66
The improved architecture with bjt transmitter circuit is tested in both long and close
ranges at different baud rates and at different environments. Following figures 60 and 61
shows 30m indoor and outdoor test setups.

Figure 60, 30m indoor data transmission test setup.

The indoor test done by using final circuit schematic shown in figure 57. And in this
test, a normal 5mW laser is used. The results are shown in table 13. The resulting data
transmission achieved maximum at 4800bps. And since the received signal is so weak, the
corresponding amplification needs to be increased by 15*10^6 in average. And this greatly
reduces the operating bandwidth. To solve this issue, incoming signal quality needs to be
increased. Because of that, a focusable 5mW laser bought to increase the optical intensity at the
receiver photodiode.

67
And in the test results of focusable laser, it produces up to 34 times more photocurrent
at the receiver side. As a result, it needs less amplification and therefore the maximum operating
bandwidth also increased. Also, a 50mW laser bought for comparing the performances,
however, the product showed poor switching characteristics above kHz ranges probably
because of the inner driver circuits. Therefore, it is not mentioned in the test results.

Figure 61, 30m outdoor data transmission test setup receiver (top) and transmitter (bottom).

68
Table 13, 30m focusable and normal 5mW laser data transmission test results.
Quantity \ Test Conditions 5mw focusable laser 5mw laser
Outdoor Indoor (dark)
(cloudy weather)
with receiver telescope
Produced photocurrent 1uA –8uA 100nA-250nA
Max operated Baud rate at 30m 9600bps 4800bps
Feedback resistor value to sense at 30m 320 kΩ -500kΩ 10 MΩ -20MΩ
Max operated Baud rate at 10cm (both 201600bps 161280bps
indoor)
Feedback resistor value to sense at 1.7kΩ 218kΩ
10cm

Above results shows that the maximum operating bandwidth has increased slightly by
only using a focusable laser product. Also, by looking at these results, we can verify that the
system satisfies to the performance specifications for operating at 30m and above 1000bps.
As shown in the figure down below, finalized products’ transceiver software
compatibility tests are done and verified by using the Putty software at 1200bps for close
range.

Figure 61, Finalized products’ software compatibility test setup.

69
Following table shows the data transmission tests’ results for different circuit conditions
at close distances (< 1 meter) and feedback resistor values at different baud rates.

Table 14, Close range baud rate tests.


Circuit\Baud rate 75 1200 4800 9600 56 115200 161 201 0.5
Hz Hz Hz Hz kHz kHz kHz kHz MHz
Transimpedance amplifier + + + + + - - - x
Rf=5-10k +
Focusable laser

Transimpedance amplifier + + + + + + - x x
Rf=5-10k+
Voltage amplifier cascaded
Transimpedance amplifier + + + + + + - x x
Rf=10k-300k+
Voltage amplifier cascaded
Transimpedance amplifier + + + + + + - x x
Rf=330kOhm
Transimpedance amplifier + + + + + x x x x
Rf=1MOhm
Transimpedance amplifier + + + x x x x x x
Rf=2.150Mohm

Transimpedance amplifier + + + x x x x x x
Rf=10MOhm

Green(+): Works well


Yellow(-): Sometimes works without error if perfectly aligned.
Red(x): Not working

70
Power Consumption And DC Voltage/Current Measurements:
Table 15, power consumption measurements.
Circuits\Quantities Voltage Current Power
Transmitter circuits with the 4.9V 25.44mA 124mW
laser and led indicator (Max)
Focusable Laser (5mW optic 4.15V 16.87mA 70mW
output)
Receiver circuits (Max) 4.54V 11.7mA 53mW
TTL converter 5.5V(max) 15mA (max) 82.5mW
(Datasheet values)
TTL converter Typical 5V 10mA 50mW
(Datasheet values)
Total Drawn Power 4.6V 17.06mA 78.5mW
from all circuits
(Minimum)
Total Drawn Power from all 4.93V 36.14mA 178mW
circuits
(Maximum)
Maximum Drawn power with - - =82.5mW+178mW
TTL converter =260mW
(Maximum) =0.26W
Drawn power with TTL - - =50mW +78.5mW
converter =128.5mW
(Minimum) =0.12W
USB 2.0 limits 5v 500mA 2.5W

Typical power consumption of the designed product operates in a range of 128.5mW-


260mW. As a result, usb power limit has not exceeded. Therefore, the products power
consumption verified to operate safely.

71
Major Performance Limiting Factors and Encountered Difficulties According To The
Observations:

Laser power: Although a 5mw laser is enough to satisfy the performance specifications, it
greatly reduces the bandwidth and SNR at the receiver side. As the received optical power
decrease, the signal amplification needs to be increased accordingly. So, it reduces the
bandwidth since the TIA’s opamp has a fixed GBP.

Laser focus: Some cheap laser products are bad at focusing. And not all the same products
perform in the same way. So this creates an unreliable system.

TIA Opamp: In this project, LM311P opamp is used. It is cheap and easy to find on the
market. But since it is not designed for TIA applications and it has a limited bandwidth
capability, it is limited the overall system bandwidth as a bottleneck. However, this device
satisfied the minimum performance specifications. Because of that, it is used in the design.
An AD8005 opamp has bought for bandwidth improvements as a high GBP device.
However, the tests resulted in failure since the device is not produced for TIA applications.

LOS Alignment: It was hard to manually align the tx-rx pairs in the implementation
especially for long distances. Also a slight change in receiver angle significantly affected
the receiver performance. However, this method may useful for fixed and low cost
infrastructures mainly.

The USB-TTL Converter: Used USB to TTL converter in this project is an old and cheap
version for cost reduction. However, since it is old, it does not work compatibly with newer
operating systems and has some driver issues. Because of that new converter models are
recommended if needed for any application.

72
Further Improvements:

Physical layer protocol: The usb-ttl converter only can serve up to 12Mbps. To operate at
higher speeds, according to reference [46] Ethernet protocol can be utilized in FSO systems.

Another Conceptual Solution: Another conceptual solution can be applied as given in


references with circuit schematics in [56 and 57], a Reasonable Optical Near Joint Access
(ROJNA) system is an FSO communication system which operates at full duplex 10Mbps
speed as an Ethernet point-to-point link [56].

Receiver Topologies: Different receiver topologies can be applied for increasing the
bandwidth performance. According to reference [48], bootstrapping techniques may applied
for applications that needs high amplification and wide bandwidth. Also reference [49]
mentioned that cascade TIA and multistage amplification methods may utilized for
obtaining improved bandwidth results.

TIA Opamp: It was hard to find an appropriate opamp for TIA application from local
suppliers. However, in global supplier sites, it is easy to find appropriate opamps such as
OPA354 [47], OPA320[47] and AD8030[17].

Reverse biasing the PD: The reverse bias voltage may necessary for high speed
applications since the junction capacitance decreases as the reverse biasing voltage increase.

Noise filtering: Some filter circuits or colour filters may utilized to boost the SNR.

Conclusion:
Evaluation tests are successfully done by making lots of trials and setups. As a result,
all the performance requirements are met and verified for the Electrical & Electronics
Engineering sub-system.

73
3.2. Computer Engineering

The CMP sub-team consists of Bahçeşehir University senior students Baran Turguter
and Eren Özdemir. The aim of the CMP team is to develop the software that will be used with
EEE teams hardware for FSO communication system.

3.2.1. Requirements

The responsibility of the computer team is to design and implement the digital
communications program, which will be used to send a file as a readable serial data to optical
transmitter and at the other side receive the serial data from optical receiver and convert it back
to file format. In order to accomplish this, the computer program is required to have both
transmitter and receiver functionality. For easy use the program should have a user friendly
interface which can be used to select the file that user wants to send, configure the settings for
the transmission and give the selection of being the transmitter or receiver to the user. The
computer program is also required to have authentication with a secure key, which will happen
before the actual transmission of data take place, in order to maintain security and safety of the
data that will be transmitted.
In order to meet performance goals, the program is required to support at least 1000 bps
transmission baud rate and the value of the baud rate should be configurable from the user
interface. The program is required to have authentication and basic error detection/correction
in order to accomplish a secure and safe transmission of the data.

Table 16, Requirements for Actors.

Actors Transmitter Receiver


Requirements
Transmit file as serial data The transmitter side of the Because of the transceiver
program should be able to nature of the product,
convert the selected file into receiver side of the program
binary data for serial should be able act as a
transmission and send it to transmitter.
USB-to-TLL converter.
Receive serial data and Because of the transceiver The receiver side of the
convert it back to file nature of the product, program should be able to
transmitter side of the receive serial data from
program should be able to act USB-to-TLL converter and
as a receiver. convert it back to readable
file format.
Authentication with secure Both sides required to have Both sides required to have
key authentication in order to authentication in order to
establish a secure establish a secure
communication. communication.
User interface for easy use User interface is required for User interface is required for
easy use of the program. easy use of the program.
Configure settings for the Settings of the transmission Settings of the transmission
transmission should be configurable from should be configurable from
both sides of the program. both sides of the program.

74
3.2.2. Review of technologies and methods

Our scope for this project is first creating a communication program that will be sending
and reading data using USB ports. The data must be in binary form to transfer using optical
communications, so our program will also do the conversion between text to binary and vice-
versa. The second part is implementing a way of authentication with a secure key between the
transceiver and receiver. Our program also must have a basic GUI.

3.2.2.1. Data Transmission


The system interface bridges the gap between the transmitter/receiver circuitry and
computers that send/process the data. Due to its wide-spread adoption and availability, USB
interface is chosen as the computer side interface. For the circuit-level interface, TLL serial is
chosen because of its single transmit and receive lines and high compatibility with USB using
low-cost USB to TLL converters.
Because of the chosen interfaces, serial communication is also chosen instead of parallel
communication. In serial communication, the data is sent one bit at a time sequentially over the
communication channel. In parallel communication several bits are sent in the same time, using
several parallel channels. Parallel communication provide faster data transmission and higher
performance but serial communication uses less data pins, cheaper and easier to setup.
In order to achieve serial communication, the sub-team used a third party Python
library, PySerial. PySerial is used for opening and configuring the settings of the serial ports
and handling the data flow to these serial ports. Because the data must be in binary format
during transmission, the sub-team used in built functionality of Python to convert data to binary.

Figure 62, Serial Communication interface [43]

75
Figure 63, Parallel Communication interface [43]

Universal Asynchronous Receiver/Transmitter (UART) is the chosen serial


communication protocol because of its asynchronous nature. Since there is no physical clock
signal between the computers, the communication protocol must be asynchronous. In UART
communication, the transmitting UART receives the data from the CPU in parallel form. After
the transmitting UART gets the parallel data, it adds a start bit, a stop bit and a parity bit, thus
creating the data packet. The data packet is sent serially bit by bit at the Tx pin. The receiving
UART reads the data packet bit by bit at its Rx pin and then converts data back into parallel
form, removing the added start, stop, parity bits in processes. Finally the receiving UART
transfers the data packet to the CPU on the receiving end [44].

Figure 64, UART communication [44]

76
Figure 65, UART Packet [44]

There are some disadvantages of using UART communication protocol [44];


• Data frame size is limited to a maximum of 9 bits.
• It does not support multiple slave or master systems.
• The baud rates, which is the rate at which information is transferred in a
communication channel, of each UART must be within 10% of each
other.
Despite its disadvantages UART fits the need of our product because;
• Only uses two wires.
• No clock signal is needed.
• Has parity bit that allows error checking.
• The structure of the data packet is highly changeable as long as it is
defined by both sides.

3.2.2.2. Authentication
For authentication, an authenticated variant of the Diffie-Hellman key exchange
used by the team. The program generates its unique secure key in opening using Python’s
“secret” library. When the authentication begins, using the secure key and built-in prime and
base numbers the program generates a public key and exchanges this public key with the other
side. After the exchange of this public keys are complete, the program computes a new key,
using its own secure key, the public key it got from the other-side and the built-in prime and
base numbers and encrypts it using “hashlib” library of Python. The authentication ends with
both sides exchanging this encrypted key and checking if the keys are the same. [54]

77
3.2.2.3. Graphical User Interface
Python library “tkinter” is used in the creation of the graphical user interface.
Tkinter’s “filedialog” module is used to in the graphical user interface to enable user to use
windows file dialog to select the file easily for transmission and save the file that is received
from the transmission. Tkinter’s “messagebox” module is also used in order to give information
about errors and processes happening during different phases of the program to the user.
Multi-threading is used in the transceiver part of the graphical user-interface to
implement a transceiver design which can send files while also listening them.

3.2.3. Software Architecture

Figure 66, File Transmission Diagram.

Figure 67, Diffie-Hellman Key Exchange Authentication Diagram.

78
Figure 68, Computer Sub-System Process Chart.

79
3.2.4. Implementation

3.2.4.1 Build 1:
The build process of the program began with implementing sender and receiver scripts
that have the functions for transmitter and receiver sides respectively. As discussed in our
project proposal, the team used python as the programming language of choice. The third party
library for Python, PySerial is used to open the serial port and handle the data flow between the
computer and USB-to-TLL converter. Pre-signal and post-signal messages are implemented to
establish as a test of connection between sides in order to detect basic errors before the
transmission of the data. The team needed to communicate with the EEE team in order to
establish the default setting for serial port. During this communication it is decided that the
settings for the port should be changeable from the program, in order to accomplish that global
variables are added. Implementation was done successfully without any critical errors.

Figure 69, Pseudocode of Sender.py script.

80
Figure 70, Pseudocode of Receiver.py script.

81
3.2.4.2 Build 2:
The build process of the program continued with the design and implementation of the
graphical user interface. In order to build the graphical user interface built-in python library
tkinter is used. The team aimed for a design that is minimalistic and easy to understand while
implementing a darker colour pallet in order to follow the current darker interface trend. As
discussed a settings window is implemented during the build in order to enable easy
configuration of the settings of the port and transmission. Instruction button is built as a disabled
button because the instructions window itself is not built yet, but it is aimed to be built in later
releases.

Figure 71, All Windows of Graphical User Interface.

3.2.4.3 Build 3:
In Build 3, the program is at its minimal working state. During this build processes the
team connected the functions with the graphical user interface. Separate windows from the main
window created in order to implement both transmitter and receiver sides of the program in the
same user interface. The team planned to implement open and close events for the transmitter
and receiver windows, which will close the main window on open and open the main window
once again on close but the attempts failed and it is shelved for this build. Because of the health
problems during this build, implementation of the authentication is postponed to further builds
in order balance the workload of the team and have a minimal working build of the program as
soon as possible.

82
Figure 72, implementation of transmitter window in gui.py script.

83
Figure 73, implementation of receiver window in gui.py script.
3.2.4.4 Build 4:
After the integration tests made with the help of EEE team, it has been seen that the
program has some major bugs and further optimization should be done. In this build the CMP
team aimed to fix many of the integration issues while optimizing the program and laying the
groundwork for further functionalities that will be added in later builds, like authentication and
multi-threading. Major fixes and changes applied during this build includes;

• File save functionality, now the receiver asks user for file save location.
• Receiver literal read error fixes.
• Graphical user interface modified for authentication and receiver and transmitter
windows are combined together as one window.
• Problem of missing first letters in messages is fixed.
• Error messageboxes and status messageboxes are implemented to give user
information about the errors and status of the program.
• Threads are implemented and made, for multi-threading.

This bug fixes and changes are implemented and tested with the help of EEE team.

3.2.4.5 Build 5:
The build process continued with the implementation of the authentication. “auth.py”
script has been made to handle authentication part of the program and, since the GUI is already
modified for authentication in the last build, it is implemented quickly to the graphical user
interface. Authentication is implemented using authenticated variant of Diffie-Hellman Key
Exchange, where sides agree on a shared prime and base integers and generate public keys
using those shared prime and base with their private key. After the exchange of this public keys,
using the other sides key with their own private key they generate a shared key between them.
Bug fixes and optimization are also continued. Fixed one the major bugs of missing last letter
of the message during this build. During the build the team, started to use a software to simulate
the serial port connection and started testing fixes and improvements themselves which
improved the build process drastically.

84
Figure 74, Diffie-Hellman Key Exchange Authentication [55].

3.2.4.6 Build 6 (Current Build):


Latest build of the program began with implementing of some quality of life
improvements to the graphical user interface, but the most important improvement of the
current build was implementing multi-threading in order to accomplish transceiver design and
functionality. Using Python’s “Thread” library the team thread the receiver function to start
after the transceiver windows is opened, if the authentication is complete. The team had some
problems while trying to implement multi-threading because none of the members of the team
used multi-threading before so they had to learn it while implementing it. During this build the
team faced with health issues again because of the global pandemic. Overall much more could
have been done during this build if not for the aforementioned health issues. However with this
build the minimum requirements of functionality is complete.

Figure 75, Implementation of Multi-Threading.

85
3.2.5. Evaluation

3.2.5.1 Evaluation of Transmission:

As discussed in the evaluation planning section of our project proposal report, the team
tested the program functions until the start of the transmission using debugging tools found in
visual studio code. Results of this tests verify that the program can turn the selected file into
binary data in order to send it to serial port. The team tested the file transmission by sending a
.txt file using Eltima Software’s Virtual Serial Port Emulator to emulate the hardware part of
the FSO communication. The verification of file transmission is successful.

Figure 76, Binary Data of a text file.

Figure 77, Transmitted .txt file (left), Received .txt file (right).

86
3.2.5.2 Evaluation of the Graphical User Interface:

Graphical user interface is tested and debugged in order to ensure it works as intended.
Configuration of the settings is especially tested since it changes the settings of the port. Both
with debugging tools and using a message box in the graphical user interface itself it is verified
that the saved settings change across the program as intended.

Figure 78, Main window (top-left), Transceiver window (top-right), Settings window
(bottom-middle).

87
3.2.5.3 Evaluation of Authentication:

The Diffie-Hellman Key Exchange authentication is tested by using the python


terminal to check the generated public keys and shared key between the two instances of the
program. Both instances generate public keys using their private key and agreed prime and base
numbers and then exchange them with each other. This exchange is tested by using the same
Visual Port Emulator software. After the exchange is complete, sides generate a shared key
using the received public key of the other side and their private key. After the generation of this
shared key, the sides exchange this shared key and check whether both sides have the same
shared key. The authentication function is verified successfully by the team.

Figure 79, Terminals of running authentication.

Overall the evaluation process is success, the team verified all the functionality of the
software is working correctly. During the evaluation process using Serial Port emulator to
emulate hardware of the communication helped with the process.

88
4. INTEGRATION AND EVALUATION

4.1 Integration

As the sub-systems are ready, integration stage of the project started. At the first
integration test, after some minor software error fixes, the systems are worked compatibly.
However, in this first experience of combining two sub-systems, some software related errors
had encountered and also some concept related software deficiencies also existed at the
beginning.
Therefore, to fix related issues, this integration process divided into 3 phases of parallel
working for convenience as following the plan below. So, continuous integration and
continuous delivery (CI/CD) practices used in this section.
Phase 1:
• CMP: Improve file saving system for “.txt” format.
• Integration Responsible: File transfer verification tests with the hardware
(Simplex).
Phase 2:
• CMP: Activate authentication feature, implement multithreading and convert
the GUI into transceiver application, fix encountered errors.
• Integration Responsible: Test and verify related improvements with the
hardware (Full-duplex).
Phase 3:
• CMP: Optimization and file transfer improvements for the GUI.
• Integration Responsible: Test and verify GUI improvements with the
hardware.
During the integration process, common version system for the software is used. In each
version, some new errors are discovered, and necessary solutions are discussed between team
members by scheduling regular meetings.
Although all the team members lived in different locations with Coronavirus
restrictions, the integration went smooth since the integration only required to send the software
from CMP team to the integration responsible by internet. Additionally, CMP team tested and
fixed the code by using a virtual serial port software without the hardware. Also, EEE team
tested the hardware with several software before the integration. All these works had
contribution for an easy integration.

89
In this system, the end user first plugs in the transceiver device into their computer’s
USB port. Then the user should know which port it plugged from device manager menu for
Windows operating system. Then, from the GUI, corresponding port number entered to the
settings window with the target baud rate. Afterwards, user should press the authentication
button and wait for a response from the second terminal. After the authentication is complete,
the user can now access features of the transceiver window. When a file reception start, the
software first asks the user to select a path for saving the incoming data file. Then, at any time,
the user can also send any .txt format data by selecting its path via pressing the select file button
and using the send file button.
In the figure below, finalized working system can be observed for software version 4.
(Distance: 1 meter, Baud Rate: 9.6kbps, Location: indoor, modulation: OOK)

Figure 80, Indoor Integration Test setup.


For simplicity and because of some limited resources, one laptop’s two separate USB
ports are used as in the previous hardware tests. In the laptop screen, the authentication for both
sides are finished and the related notification windows are appeared as shown in the figure
above. Then, from the transceiver window, a short sample .txt file sent to both sides.

90
In the figure below, transmitted and received text documents are shown. And as a result,
the text file sent correctly at 9.6kbps without any error for a small sized sample text.

Figure 81, transmitted test file (bottom) and received text document (top).

Both transceivers sent the test file to the other side and both of them received the
whole data correctly as the document given at top figure. Therefore, data transmission at the
target rate has verified for the integrated system.

Figure 82, Running software’s terminals.


Besides, in the software terminals given above, related key information are shown. And
since the generated keys are same, the authentication has completed with the integrated system
too. Also, two devices’ connected ports are shown in these terminals as COM5 and COM6.

91
4.2 Evaluation

BER/PER Tests & Statistical Analysis:


BER is an important parameter to define the optical link quality. In order to achieve this
information, every single bits should be examined. However, it is easier to interpret the BER
from PER since all the data sent through packets. Every single byte packet represent a character
in a text document. Because of that, these parameters can be obtained by comparing transmitted
and received “.txt” documents by using a file comparator software such as Microsoft Word.
Then, just finding number of unmatched characters should give the packet error rate. Then by
dividing this value to number of sent packets results as packet error ratio.
According to reference [50], BER can be extracted by measuring the PER effectively.
And the relation given as:
PER =1− (1− BER)n [50]
In this equation given above, n defines the number of bits sent in a single packet. For
this project, a data packet has 1 start bit, 8 data bits, 1 parity bit used for error detection and 1
stop bit. Therefore, total number of bits in a packet (n) =11 bits for this system.
So, the corresponding equation for calculating BER for this system becomes as the
following:
1
BER = 1 − (1 − PER)𝑛 , Where n=11
1
∴ BER = 1 − (1 − PER)11
For small BER probabilities, above equation can be written as following:
BER = n*PER = 11*PER [51]
Definition for Packet error rate [50]: Number of received error packets after forward
error correction (FEC).
And FEC is the parity check for this system.
As a mathematical definition [51]:
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑤𝑟𝑜𝑛𝑔 𝑟𝑒𝑐𝑒𝑖𝑣𝑒𝑑 𝑝𝑎𝑐𝑘𝑒𝑡𝑠 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑤𝑟𝑜𝑛𝑔 𝑟𝑒𝑐𝑒𝑖𝑣𝑒𝑑 𝑏𝑖𝑡𝑠
PER= And BER=
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑠𝑒𝑛𝑡 𝑝𝑎𝑐𝑘𝑒𝑡𝑠 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑠𝑒𝑛𝑡 𝑏𝑖𝑡𝑠

According to reference [51], BER should be smaller than 10−9 . And reference [50]
mentions that the BER shouldn’t be bigger than 10−6 for satisfactory performance. Of course,
these performance parameters may change according to the target application. In this project,
there were not any performance specification for BER parameter.
In real applications, for example SONET systems operates with BER of 10−10 and in
ethernet protocol requires BER of less than 10−12 [52]. As the size of test data increase, the

92
evaluation of BER becomes more reliable according to reference [52]. So, if the testing data
approaches to infinity, BER turns into its ideal (true) value [52].
However, testing with infinite amount of data is impossible to conduct. Therefore,
another statistical parameter used besides BER tests which is the confidence level [52].
CL = PROB [BERT < R] given E (detected errors) and N (transmitted bits) [52]
Where;
CL: Confidence level (0%-100%), PROB[]: Probability that, BERT: The true BER, R:
Specified Ratio [52].
The required minimum number of bits to use in the tests (N) depends on the confidence
level. And the relation described as the equation given below.
1 (𝑁∗𝐵𝐸𝑅)𝑘
𝑁 = 𝐵𝐸𝑅 [−𝑙𝑛(1 − 𝐶𝐿) + ln (∑𝐸𝑘=0 )] [52]
𝑘!

This equation obtained by some statistical methods including the Poisson theorem and
the binomial distribution function [52].
If an error free system considered for a 86,5% CL that true BER is < 10−6 for simplicity,
E parameter becomes zero, thus second term in the above equation becomes redundant. Then
the above equation becomes as following:
N = 1/BER x [-ln(1-0.86.5)] ≈ 2/BER = 2 x106 = 2Mb [52]
This means that transmitting twice of the one over BER number of bits gives 86,5% CL
that the communication system satisfies the BER condition [52]. This method introduces
simplicity for calculating the necessary file size to be tested as a rule of thumb [52]. As another
example, if we need a 99% CL, N = 4.6/BER needed [52].
Therefore, 2Mb data transmission made in the following tests with a 86,5% confidence
level.
In order to achieve total 2Mb data flow in the medium (ignoring presign and postsign
data in the file detection algorithm), the number of characters in a text document can be
calculated as the equation given below.
(#of bits in a packet) x (# of chars in the file)= 2Mb
= 11 x (# of chars in the file)= 2Mb
# of chars in the file= File size in bytes= 181818 byte ≈ 182KB
Since higher file sizes with better CLs would take hours of testing, this 2Mb size is
chosen with a CL of 86,5% as a medium value to reduce the testing time. Corresponding
182KB, “.txt” format test file prepared to achieve 2Mb data flow for conduction of these
following tests.

93
The test file sent to the other transceiver device at 1 meter, at different locations and at
different baud rates. Indoor test results are given in table 17 and as a graph in figure 83. Also,
outdoor test results are given in table 18 and as a graph in figure 84. The text comparisons done
by an online software program from this reference [53].

Normally, it is more convenient to use SNR/dB in x axis and make the tests at 30m. Due
to the limited resources in the electronics laboratory in addition to the coronavirus restrictions,
some parameters and some planned long range test results are missing.

When the weather is too sunny, it is impossible to overcome the environmental noise
and receive any data. Thus, the outdoor tests made in a cloudy weather condition.

94
Table 17, Indoor BER/PER Test results.
Test 28 6.94 3.47 1.73 1.1 35.7 17.36 9.92
Duration Minute Minute Minute Minute Minute Second Second Second

Baud Rate 1200bps 4.8Kbps 9.6 Kbps 19.2Kbps 28.8Kbps 56 Kbps 115.2 Kbps 201.6 Kbps
1 Meter PER: PER: PER: PER: PER: PER: PER: PER:
PER, BER 0.0230 0.0410 0.0739 0.0950 0.1480 1.0000 1.0000 1.0000
BER: BER: BER: BER: BER: BER: BER: BER:
0.0021 0.0038 0.0070 0.0090 0.0145 1.0000 1.0000 1.0000
# of error
packages 4256 7493 13502 17347 27049 Authenticat Authenticatio Authenticatio
/# of send 182511 182511 182511 182511 182511 ion Failed n Failed n Failed
packages
BER % error 0.21% 0.38% 0.7% 0.9% 1.45% 100% 100% 100%
PER % error 2.3% 4.1% 7.3% 9.5% 14.8% 100% 100% 100%

Figure 83, error ratio test results’ graph (indoor).

95
Table 18, Outdoor BER/PER Test results.
Test 28 6.94 3.47 1.73 1.1 35.7 17.36 9.92
Duration Minute Minute Minute Minute Minute Second Second Second

Baud Rate 1200bps 4.8Kbps 9.6 Kbps 19.2Kbps 28.8Kbps 56 Kbps 115.2 Kbps 201.6 Kbps

1 Meter PER: PER: PER: PER: PER: PER: PER: PER:


PER, BER 0.023 0.032 0.056 0.158 1.0000 1.0000 1.0000 1.0000
BER: BER: BER: BER: BER: BER: BER: BER:
0.0021 0.0030 0.0052 0.0155 1.0000 1.0000 1.0000 1.0000
# of error
packages 4282 5922 10331 28862 Authenticat Authenticat Authenticatio Authenticatio
/# of send 182511 182511 182511 182511 ion Failed ion Failed n Failed n Failed
packages
BER % error 0.21% 0.30% 0.52% 1.55% 100% 100% 100% 100%
PER % error 2.34% 3.24% 5.66% 15.81% 100% 100% 100% 100%

Figure 84, error ratio test results’ graph (outdoor).

96
BER/PER graphs’ Matlab codes can be found in the appendix section.

The test results can be satisfactory for some applications. However, it is important to
note that, the error ratios are too high for a communication system if compared. As mentioned
before, in this project, there were not any performance specification for BER parameter.
Therefore, this situation does not affect the success of the project.
It is useful to remind that the confidence level calculation is given as an example to
illustrate how can be the error ratio test efficiently done in less amount of time. But, the results
for this system shows that the measured error ratio is way higher than the true bit error ratio
condition.

Conclusion For Integration And Evaluation:


Integration successfully completed and verified according to the explained test results
given above. The software written by CMP team and EEE team’s produced hardware together
sent and received data at target rates and distances correctly with full functionality after
applying several software optimizations. BER/PER tests’ results provided via applying
statistical analysis methods. Other sub-system specifications also verified and explained in
section 3 more detailly.

97
5. SUMMARY AND CONCLUSION

The EEE team made a broad literature search, learned about related technologies and
methods, and found conceptual solutions. Then selected the most appropriate one for this
application. And different architectural circuit designs with additional circuit configurations are
made while performance specifications are met. The team came up with creative and practical
solutions by using the theoretical knowledges learned during the undergraduate courses.
Theoretical calculations and simulations are made for the designed electrical circuits and for
the optical system in order to verify the solutions in theory. The conceptual and architectural
design selections are made with minimum amount of risk by considering the cost,
environmental health, legal and ethical concepts.

The CMP team researched about FSO communication and authentication techniques to
achieve a secure communication. Also researched about the data packaging solutions between
the systems. And planned for the implementation part.

Both teams made detailed plan for the evaluation and verification parts together by
creating work packages such as code implementations, electrical and software tests, circuit
constructions, integration tests etc. And ordered them in a timeline for the second semester at
Gantt chart. This work planning made detailly to achieve success of the project on time as
mentioned in section 2 Work planning. Also, risk assessment tables are provided and related
risk levels are calculated for the selected sub-system designs.

In the second semester, two sub-teams implemented their designed sub-architectures.


Teams modified the hardware and optimized the software to achieve the best performance. The
team arranged regular meetings to follow up the Gantt chart. After the sub-systems done and
verified for most of the specifications, integration phase started. And then, necessary
verification tests successfully done for the integrated system.

As a result, the software written by CMP team and EEE team’s produced hardware
worked together while satisfying all the performance specifications.

98
ACKNOWLEDGEMENT

We wish to thank our advisers Prof. Dr. Şeref Kalem and Dr. Ece Gelal Soyak for their
encouragement and guidance during the research and development stages of this project.

99
REFERENCES

[1] Optical wireless communication, retrieved on November 14, 2020 from


https://royalsocietypublishing.org/doi/10.1098/rsta.2020.0051

[2] Free Space Optics: Current Applications and Future Challenges, retrieved on November
14, 2020 from https://www.hindawi.com/journals/ijo/2015/945483/

[3] H. A. Willebrand and B. S. Ghuman, “Fiber optics without fiber,” IEEE Spectrum, vol. 38,
no. 8, pp. 40–45, 2001.

[4] Modulating lasers, retrieved on November 14, 2020 from


https://www.laserglow.com/content/Modulating-Lasers#electronic

[5] H. Kaushal, V. K Jain and S. Kar, “Free Space Optical Communication”, 2017.

[6] Wavelengths of visible light, retrieved on November 14, 2020 from


https://science.nasa.gov/ems/09_visiblelight

[7] Visible wavelength handheld laser pointers, retrieved on November 14, 2020 from
https://usaphc.amedd.army.mil/PHC%20Resource%20Library/Laser%20Pointer%20F
S_24-031-0617.pdf

[8] Laser Safety Hazards, retrieved on November 14, 2020 from


https://www.ehss.vt.edu/programs/LAS_hazards.php#:~:text=Visible%20and%20Near
%2DInfared%20Radiation,spectrum%20may%20damage%20the%20retina.&text=For%20thi
s%20reason%2C%20wavelengths%20in,termed%20the%20ocular%20hazard%20region.

[9] Laser Classes and Hazards, retrieved on November 14, 2020 from
https://fens.sabanciuniv.edu/en/laser-classes-and-hazards
[10] Electromagnetic Spectrum, retrieved on November 14, 2020 from
https://sites.google.com/a/coe.edu/principles-of-structural-chemistry/relationship-
between-light-and-matter/electromagnetic-spectrum

[11] Varun Jindal, PC-to-PC communication via RS-232 serial port using C, 2006.

[12] A. G. Alkholidi and K. S. Altowij, Free Space Optical Communications Theory and
Practices, 2014.

[13] Jabeena et al., Laser based optical transceiver for data transfer of free space optical
Communication, 2012.

[14] Arora et al., A review of optical communication link design using EDFA, 2017.

[15] Voltage tolerance of TTL gate inputs, retrieved on November 14, 2020 from
https://www.allaboutcircuits.com/textbook/digital/chpt-3/logic-signal-voltage-levels/

[16] Laser Transceiver, retrieved on November 17, 2020 from


https://www.instructables.com/Laser-Transceiver/

100
[17] Cavorley et al., Vision Based Free Space Optical Communication, 2014

[18] Visible Light Communication (LIFI) based PC to PC Communication, retrieved


on November 18, 2020 from
https://www.youtube.com/watch?v=DIxFPyrarq0&list=LL&index=293&ab_channel=Researc
hDesignLab

[19] RS-232 Laser Transceiver, retrieved on November 18, 2020 from


https://www.qsl.net/n9zia/wireless/laser/laser.htm

[20] Visible light communication (Li-fi), retrieved on November 18, 2020 from
https://www.youtube.com/watch?v=sHAvJImYw3w&list=LL&index=288&ab_channel=satiz
Kmr

[21] Lifi Communication Arduino UNO, retrieved on November 18, 2020 from
https://www.youtube.com/watch?v=c4gC8dbaiZg&ab_channel=Tishitu

[22] Photodiode vs Phototransistor vs Photoresistor, retrieved on December 2, 2020 from


https://www.youtube.com/watch?v=DNAgJrnj4EM&ab_channel=BackyardAmusement

[23] Photodiodes, typical applications, retrieved on December 2, 2020 from


https://www.perkinelmer.com/CMSResources/Images/44-
3449APP_PhotodiodeTypicalApplications.pdf

[24] What is Schmitt trigger, retrieved on December 3, 2020 from


https://howtomechatronics.com/how-it-works/electrical-engineering/schmitt-trigger/

[25] R. L. Boylestad and L. Nashelsky, Electronic Devices and Circuit Theory 11th edition,
2014.

[26] Datasheet of irf540ns N-Channel MOSFET, retrieved on December 10, 2020 from
https://pdf.direnc.net/upload/irf540nspbf-datasheet.pdf

[27] Photodiode/Transimpedance Amplifier Design, retrieved on December 10, 2020 from


https://www.youtube.com/watch?v=FtdJ4e973bk&ab_channel=devttys0

[28] Photodiode basics, retrieved on December 10, 2020 from


https://www.teamwavelength.com/photodiode-
basics/#:~:text=Current%20passing%20through%20the%20photodiode,without%20incident%
20light%20creating%20photocurrent.

[29] Datasheet of the photodiode, retrieved on December 10, 2020 from


https://pdf1.alldatasheet.com/datasheet-pdf/view/26251/VISHAY/BPW34.html

[30] Energy band diagram of PIN photodiode, retrieved on December 10, 2020 from
https://www.slideshare.net/dhruvupadhaya/optical-detector-pin-photodiode

[31] Optimizing Precision Photodiode Sensor Circuit Design, retrieved on December 10, 2020
from https://www.analog.com/en/technical-articles/optimizing-precision-photodiode-sensor-
circuit-design.html#

101
[32]Integral calculations, retrieved on December 16, 2020 from
www.wolframalpha.com.
[33] Why do you need FSO, retrieved on December 16, 2020 from
http://www.moctkom.ru/why-do-you-need-fso/

[34] About LLCD, retrieved on December 27, 2020 from


https://web.archive.org/web/20130903035535/http://esc.gsfc.nasa.gov/267/271/335.html

[35] Space Exploration Holding, retrieved on December 27, 2020 from


http://licensing.fcc.gov/myibfs/download.do?attachment_key=1158350

[36] A Study on Diffie-Hellman key Exchange protocols, Manoj Ranjan Mishra, Jayaprakash
Kar 2017.

[37] Requirements for Password-Authenticated Key Agreement (PAKE) Schemes, retrieved on


December 16, 2020 from
https://tools.ietf.org/html/rfc8125

[38] PySerial Overview, retrieved on January 7, 2021 from


https://pythonhosted.org/pyserial/pyserial.html#overview

[39] Serial Port Class, retrieved on January 7, 2021 from


https://docs.microsoft.com/en-us/dotnet/api/system.io.ports.serialport?view=dotnet-plat-ext-
5.0

[40] Understanding the different types of USB cables and ports, retrieved on January 7, 2021
from
https://www.houkconsulting.com/2018/11/understanding-usb-cables-ports/

[41] USB 101 an Introduction to Universal Serial Bus 2.0, Robert Murphy, 2014.

[42] USB Port Types and Speeds Compared, retrieved on January 7, 2021 from
https://www.tripplite.com/products/usb-connectivity-types-standards

[43] Serial vs Parallel, retrieved on December 27, 2020 from


https://focuslcds.com/serial-vs-parallel/

[44] Basics of UART Communication, retrieved on December 27, 2020 from


https://cs140e.sergio.bz/notes/lec4/uart-basics.pdf

[45] Risk assessment for Laser, retrieved on December 27, 2020 from
https://iopscience.iop.org/book/978-0-7503-1692-7/chapter/bk978-0-7503-1692-7ch5

[46] Cebrail Taşkın, Ağ Teknolojileri ve Telekomünikasyon, 2018.

[47] John Caldwell, 1 MHz, Single-Supply, Photodiode Amplifier Reference


Design, Texas Instruments, 2014.

[48] Hoyle, C. & Peyton, A.J.., Bootstrapping techniques to improve the bandwidth of
transimpedance amplifiers, 1998.

102
[49] Das et al., Development of enhanced bandwidth of front-end receiver amplifier for high
speed communication system, 2018.

[50] Hanatani et al., BER estimation through Packet Error Rate Measurement, 2014.

[51] Pawan Kumar Tiwari, Bit Error Rate, retrieved on May 19, 2021 from
https://www.slideshare.net/amit_k1993/bit-error-rate-67048735.

[52] Physical Layer Performance: Testing the Bit Error Ratio (BER), retrieved on May 19,
2021 from https://pdfserv.maximintegrated.com/en/an/3419.pdf

[53] Compare Text Online, retrieved on May 19, 2021 from


https://countwordsfree.com/comparetexts

[54] Authenticated Diffie Hellman Key Exchange, retrieved on May 18, 2021 from
https://security.stackexchange.com/questions/73114/authenticated-diffie-hellman-key-
exchange

[55] Diffie-Hellman Key Exchange for Authentication, retrieved on May 19, 2021 from
https://www.researchgate.net/figure/Diffie-Hellman-key-exchange-for-
authentication_fig1_329141054

[56] RONJA, retrieved on May 24, 2021 from


https://en.wikipedia.org/wiki/RONJA

[57] RONJA Project Schematics, retrieved on May 24, 2021 from


http://ronja.twibright.com/schematics/

[58] AMERICAN NATIONAL STANDARDS INSTITUTE - Z136, retrieved on May 24,


2021 from
https://www.lia.org/resources/laser-safety-information/laser-safety-standards/ansi-z136-
standards

[59] LED & LASER CLASSIFICATION, retrieved on May 24, 2021 from
https://www.lasermet.com/resources/an-overview-of-the-led-and-laser-classification-system-
in-en-60825-1-and-iec-60825-1/

103
APPENDIX

Appendix A

BER/PER graphs’ Matlab codes:


https://drive.google.com/file/d/1ZOpHibZ8x_YFqF71EJF1bsv7HjxCjiu6/view?usp=sharing

Altium Designer PCB documents:


https://drive.google.com/drive/folders/1BDj3HXwDSvRFWCF2JG8EwYsd6Xz51pwi?usp=s
haring

Appendix B

Program Codes: https://github.com/theGrayson/FSO-Communication

104

You might also like