This project involves using two Arduino boards to transmit data using light signals. One Arduino sends binary data to another Arduino via a torch. The receiving Arduino decodes the light signals and reconstructs the original data, which is then converted back into an image using a Python script.
- 2 x Arduino Boards (Uno, Nano, etc.)
- 1 x Torch (LED)
- 1 x Light Dependent Resistor (LDR)
- 1 x Computer with Python 3.x installed
-
Hardware Setup:
- Connect the components as shown in the circuit diagrams provided in the
arduino_sender.ino
andarduino_receiver.ino
files. - Ensure the torch is appropriately connected to the sender Arduino.
- Place the LDR in a location where it can detect the light signals from the torch and connect it to the receiver Arduino.
- Connect the components as shown in the circuit diagrams provided in the
-
Arduino Code:
- Upload the
arduino_sender.ino
code to one Arduino. - Upload the
arduino_receiver.ino
code to the other Arduino.
- Upload the
-
Python Script:
- Install the required Python libraries by running:
pip install pyserial pillow
. - Replace
'COMX'
in thepython_receiver.py
script with the actual COM port where the receiver Arduino is connected. - Run the Python script using
python python_receiver.py
.
- Install the required Python libraries by running:
- Power on both Arduino boards.
- Run the Python script on your computer.
- Press the button on the sender Arduino to start transmitting the base64-encoded image data via light signals.
- The receiver Arduino will detect the light signals and reconstruct the data.
- The Python script will decode the received data and display the image.
https://projecthub.arduino.cc/saadsaif0333/data-transfer-using-led-light-li-fi-ee33a3
Contributions to this project are welcome! If you find any issues or improvements, please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.
Note: This project is designed for educational and experimental purposes. The reliability and performance of the data transmission may vary based on environmental conditions and hardware components. Use this project at your own risk.