LIFI VISIBLE LIGHT COMMUNICATON

HELOO GUYS

ITS MOHIT ACTUALLY I AM DOING A PROJECT BASED ON LIFI. I AM FACING SOME PROBLEMS REGARDING IT. PLEASE HELP ME I HAVE STUCK FROM ABOUT 2 WEEKS AND NOT GETTING ANY SUCCESS.
I HAVE DONE CODING AND ALSO MADE A CIRCUITORY AND ITS WORKING FINE TILL I BLOCKS THE TTRANSMISSION (KEEPING SOME OBJECT BETWEEN INFRARED AND PHOTODIODE ) AFTER REMOVING THE OBJECT I START GETTING SOME GARBAGE VALUE ON TERMINAL . PLZ HELP I AM NOT GETTING ANY HINT WHAT IS THE PROBLEM

Transmitter Code

#include <SoftwareSerial.h>

#define rxPin 3  
#define txPin 4  

SoftwareSerial XSERIAL =  SoftwareSerial(rxPin, txPin);

void setup()  
{
     XSERIAL.begin(9600);
}

void loop() 
{ 
    XSERIAL.println("HELLO");
    delay(1000);  
}

Reciever Code

#include <SoftwareSerial.h>

#define rxPin 2
#define txPin 3

SoftwareSerial XSERIAL =  SoftwareSerial(rxPin, txPin, false);

void setup()  
{
   XSERIAL.begin(9600);

   Serial.begin(9600);

   Serial.println("Start Listening...");
}

void loop() 
{
  if (XSERIAL.available())
  {
      Serial.print((char)XSERIAL.read());
  }
}

transmitter.ino (242 Bytes)

receiver.ino (331 Bytes)

Stop SHOUTING.
Provide details.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

We need your code and can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

PLEASE, do not type all your post in UPPER CASE..

Thanks.. Tom... :slight_smile:

sorry sir
i am a newbie . Now i have posted the code as well as the circuit diagram
now help me with my project.

What errors does the software UART give for framing/ false start bit errors?

Actually i do not get what are you trying to say as i said there is no error its working fine but when i put some obstacle in between and remove it i recieve anonymous values on terminal and when i do the process of removing and inserting the obstacle repeatedly (still getting garbage value but similar everytime ) in between the path of transmission and suddenly it starts giving right result and sometime wrong maybe i think there is problem of synchronization as i interrupt it my receiver not able to sync with transmitter .
This is the problem .
as in code i am sending "Hello" so recieving corresponding hex values and then type casted to char so if transmission interrupted i get some garbage string instead of hello repeatedly untill the transmission is stopped.

You have no error correction - what do you expect to happen?

i am asking why i am recieveing wrong data if transmitted is objected and started again

AWOL:
You have no error correction - what do you expect to happen?

I just want if transmission is blocked and started again ii must recieve the same string i was recieving earlier not any garbage string. and i wanna reason what is it that causing this problem ? just simple
please help me to resolve it whether it is in harware or i should add any more condition in my code .

You have no error correction

AWOL:
You have no error correction

then what is it that causing problem?

Let's try a different approach.

Do you understand how asynchronous serial communications work?
Do you understand start and stop bits?

One suggestion would be to modify your receiver code to look for that 1 second delay between transmissions and not check available until the receiver has "seen" that one second of mark or space. That should help resynch transmit and receive after an interruption.

How is it that you refer to this project as "visible light communication" but are using IR LED and Receiver?

actually i am not good much at the coding will you give me a hint how i can calculate that 1sec delay at recievr side where should i put this 1sec delay code in receiver code and one more thing does i need to calculate this 1sec delay everytime or only when transmission is interrupted ? @Due_unto

Read the tutorial "Blink Without Delay"

i read it and i do not know how does it help me ?

It won’t help you because it doesn’t address your fundamental problem - the channel that you are using to send information through is not perfect. As you place obstacles in the path, the errors increase because the receiver can’t distinguish between noise and valid information.

You have to encode the information in some way such that the receiver can tell whether it is valid or not.

sir one thing i want to highlight is that as i said after interruption i get another string instead of "Hello"(which i am transmiting) the other string is always same whenever i interrupted or whenever i reset the arduino and start the running agian if interruption takes place everytime same string i recieve and it have pattern just like "hello" in hello there is 2 "L" so same hex value is given twice in same way the other string have too this property it comes with same hex value twice .

You're not making a lot of sense - you're not printing hex values.

You still haven't answered my earlier questions.

Sending the same text to people as a personal message won’t help either, especially when their signature specifically tells you not to.

You are not getting what i am saying data goes in bits 1 or 0 and then combined being a number and that will be hex so that i have typecasted to char datatype so that i can view Hello on reciever end not some numeric values . Its just the way of telling that some thing is repeating in my garbage string(as garbage string consist of some symbols not something meaningfull string) which i am recieving after the interruption and yes i know about the asynchronus serial communication
How it sends data it sends data in packets and size of the packets can vary in between 5-9 but we usually program it for 8bit size of data packets and data packet is followed by start bit (transition from high to low) and there is parity bit at the end of data packet it is optional it helps us to check whether the data recieved is corrupted or not at receiver end and at last there is stop bit (transition from low to high ) so anything more you want me to learn about serial communication or is this enough ?