Visible Light Communication System
by darthrappers in Circuits > LEDs
479 Views, 9 Favorites, 0 Comments
Visible Light Communication System
Our goal is to revolutionize underwater exploration by developing a high-speed communication system that uses light to transmit data, enabling real-time access to sensor data. This innovative solution allows researchers to capture and transmit underwater images, such as those of coral reefs, with unprecedented speed and efficiency. By relying exclusively on light for data transmission, our system ensures rapid, reliable communication in underwater environments.
We hope this instructable provides clear instructions for anyone to build a visible light based communication device. There are many comments in the code, which will help you change any parameters to suit your needs.
Supplies
- Teensy 4.1 - Qty 1
- Arduino Uno R3 - Qty 1
- Green LED - Qty 1
- 220 Ohm Resistor - Qty 1
- OPT101 Photodiode - Qty 1
- 3x Magnification Fresnel Lens - Qty 1
- Breadboards - As needed
- Dupont wires - As needed
- PCs/laptops - Qty 2
Downloads
Build Transmitter
- Bend the LED leads at 90 degrees and mount to a bread board.
- Connect Arduino GND to the negative (shorter) lead of the Green LED
- Connect a 220ohm resistor to the positive (longer) lead of the Green LED
- Connect the other end of the resistor to Digital Pin 9 of Arduino
- Mount the Fresnel lens at about 6.5cm from the LED. You may have to move the Fresnel lens closer or farther until the LED forms a clear spotlight on the receiver.
Build Receiver
- Mount the OPT101 photodiode on the breadboard.
- Mount the Teensy on the breadboard.
- OPT101 connections
- Connect Pin 1 to Teensy 3.3V
- Connect Pin 3 and Pin 8 to ground
- Connect Pin 4 to Pin 5
- Connect Pin 5 to A0 on Teensy
Software Environment Setup
- Install Arduino IDE on both laptops.
- Install the Teensduino software add-on using these instructions.
Transmission Software
This Arduino code enables an LED to transmit data using visible light communication using simple ON-OFF keying method. It stores a preloaded binary message in program memory and transmits it bit by bit by toggling the LED on and off at precise intervals. The transmission timing is controlled by a configurable bit duration, ensuring accurate encoding of the message. Prior to transmitting the message a long 1 (3 seconds) followed by a 0 (1 second) is sent.
Downloads
Receiving Software
This Arduino code facilitates the reception of visible light communication signals using an analog sensor. It samples input from a photodiode connected to an analog pin at precise intervals, storing the time and signal values in memory arrays for further processing. The sampling parameters, such as interval and additional metadata like timestamps, can be configured. The data collected is saved to an SD card for later analysis, making this setup ideal for decoding signals transmitted using light.
Downloads
Decoding Software
This Python script processes CSV data containing photodiode signal measurements to decode a transmitted binary message. It calculates a threshold to distinguish between high and low signal values and generates a sequence of bits based on this threshold. The script analyzes transitions in the bitstream, rounds their durations to a specified multiple, and reconstructs the message. It then compares the decoded bit sequence against predefined 64-bit binary constants to verify accuracy.
Downloads
Testing
To test the visible light transmission system you need two users to operate the two different laptops connected to the transmitter and the receiver. Synchronization between the transmitter and receiver is currently manual. The user operating the receiver needs to look for the long 3 second LED ON from the transmitter and as soon as it goes OFF (for 1 second) they need to press R to start collecting data. For accurate decoding the photodiode should be sampled at least 5 times for every LED bit duration. Using this system we can currently send data at about 20 kbps.