Sending a file or any data using Visible Light and Arduino

I want to implement a simple VLC based communication system using two Arduinos and send messages/data/files between two PCs. For that I have a simple transmitter circuit with an LED on Tx side and a photo-transistor on the receiver side. The codes im using for transmission and reception are attached below, also the circuit image is attached below, but im unable to bring about any communication between the two PCs, the transmitter side works fine as the LED flickers indicating data is being transferred, but its not being received by the photo transistor. I don't know what im doing wrong. Any help would be appreciated, I am doing this as a part of my academics.

receiver.ino (311 Bytes)

transmitter.ino (639 Bytes)

Welcome to the forum!

You will likely get more help if you include the code in your post (use the code tags </>) rather than as attachments.

receiver.ino appears to be trying to transmit. transmitter.ino doesnt appear to transmit or receive although it sets 2 pins as output and none as input. Suggest you work through the basic I/O examples included in the arduino IDE before you attempt to fix this code.

Haven,t looked at your code, as it clearly needs work but you also need to think about hardware practicality.

LIght based transmitters that work through sir over short distances are very common but ....

They almost always use infra red light because there is much less of it about to confuse things.
They almost exclusivly send data pulses using a modulated signal. This is because the signal can be distinguished from the background light, even it the actual change in the level recieved is very small.

There are chips for the purpose but if you wanted to muck about to learn you might considder using PWM to generate a carrier and then gate it, turn it on and off, by setting the pin direction.

To receive your new modulated pulses you will need a detector circuit.
Again devices available but if you want to build you should be looking at a photo diode or transistor that is sensitive to a small range of freequencies, light freequencies, that match yoiur transmitter diode and then coupling that to a band pass filter.
Google is yiour friend here but the circuit is, well can be, fairly simple.

The output of your filter is a very small signal that is also a freequency and you will probably want an opamp to detect that and give provide a DC pulse that the Arduino can read easily.

Dont be discorraged, it is an interesting topic, relativly easy and cheap to play with and will lead you to learn many many basic circuit configurations and coding principles.

There are some great opamp and filter tutorials at allacoutcircuits.com

Good luck,
Al