top of page
Image by Tengyart

Decoding Intensity of Polarized Light using Python Programming




Contents :


1. Abstract


2. Working


3. Computer Programme


4. Result


5. Conclusion



Abstract This project is designed based on the principle of polarization. This project shows how a polarized light passed through the polarizing sheet can be decoded into binary codes by a computer based on their intensity. The project includes a light source (laser), angle verifier, polarizer, light-detecting sensor, optic-electrical transcoder, computer program, and a computer. Through this project, we can determine the intensity of light and its difference within every angle just by using a program that may reduce a lot of mathematical work that should be done by humans.



Working Theory


This project includes the following steps to output the final results :


1. Connect the sensor to a computer. Depending on the type of sensor, we may need an interface such as a USB or serial connection to read the data from the sensor.


2. Read the sensor data in our program. We can use libraries or functions specific to our sensor and programming language to access the data. For example, if we are using a USB-connected sensor, we may use a library like PySerial in Python to read the data from the sensor.


3. Convert the sensor data into a binary sequence. We can do this by thresholding the data at some value, such as half of the maximum, and encoding the data as 0s and 1s.


4. Decode the binary sequence to determine the plane of polarization of the light that struck the sensor. We can do this using the binary sequence to determine the analyzer angle that resulted in maximum light transmission.


5. Repeat the above steps as needed to continuously monitor the sensor data and decode the polarized light results.



Code Overview


In this code, the PySerial library is used to open a serial connection to a device at the specified port (COM3) and baud rate (9600). The while loop continually reads data from the device using ser. readline() and stores it in the data variable. The strip() method is used to remove any whitespace characters from the end of the data.


The data is then converted into binary using the int.from_bytes() and bin() functions. Finally, the binary data is printed to the console. We'll need to replace "COM3" with the appropriate port for our device and modify the baud rate and other parameters as necessary.


The sample source code for the project is given below.



import serial


ser = serial.Serial("COM3", baudrate=9600, timeout=1)

whileTrue:

data = ser.readline().strip()

if data:

# Decode the data into binary format

binary_data = bin(int.from_bytes(data, 'big'))

print("Binary Data:", binary_data)

ser.close()



Result


The intensity of polarized light is calculated and decoded into a binary form. From this, we can get the maximum and minimum intensity of light falling into a sensor through a polarizer.


Conclusion In conclusion, this scientific project aimed to study the intensity of polarized light through a computer program. Through the conduct of polarization, the results showed the program has decoded the maximum light intensity as binary code 1 and the minimum light intensity as 0. The findings of this project have important implications for. For example, 1. Optics and Photonics: Polarization plays a crucial role in many optical systems, including lenses, mirrors, and filters. Detecting polarized light is essential in understanding how these optical elements interact with light and how they can be optimized for specific applications. 2. Meteorology: Polarization is used to detect the orientation of ice crystals in the atmosphere. This information can be used to improve weather forecasting and understand cloud formation mechanisms. 3. Medical Diagnostics: Polarized light can be used to non-invasively detect changes in biological tissues, such as the alignment of collagen fibers in skin and other tissues. This method of detecting polarized light can be useful in the diagnosis and monitoring of diseases such as skin cancer. 4. Remote Sensing: Polarization can be used in remote sensing applications to detect and identify different types of materials and surfaces, such as water, vegetation, and soil. The information obtained from this project can be used for a variety of purposes, including environmental monitoring, agriculture, and resource management.. However, it is important to note that there are limitations to this study. Such as ; 1. Result of the intensity of polarizing light may not be accurate in binary codes as the program rounds off to the nearest value. Further research is necessary to address these limitations and to expand upon the results of this project. Overall, this project has contributed to our understanding of the detection of polarized light intensity. It has provided new insights into the automation of physical experiments and has opened up new avenues for future research in this field.




Project and Concept

Yuee-Chi Pata Magar, St, Xaviers College, Maitighar Kathmandu

Subash Bhandari , St.Xaviers College , Maitighar Kathmandu




Copyright ©: 2023, All Rights Reserved

2 views0 comments
bottom of page