VLC with Inferred Help needed Asap!!!!!!!!!!!!!!!!!!!!!!!!!!

Can anyone help me with this problem. I have an inferred led diode and a receiver, using them both on arduino atmega 328 chip clones. the message on the monitor should show hello world as being transmitted but the receiver monitor only shows garbled up messages.....can anyone explain to me what I am doing wrong? I have tried a simple digital write to tx pin, and a digital read rx pin, and the message still comes back in incorrect characters. the baud rate is the same and the polarity is the same, but something isnt correct. can someone help me write a code that will allow me to send string messages transmitted through led IR diode and receive them to show on the receiving monitor using an IR reciever?

Do you think it might help if you posted your code ?
Why have you posted the same question in 2 topics ?

http://forum.arduino.cc/index.php?topic=392586.msg2702752#msg2702752

can anyone explain to me what I am doing wrong?

You're not helping us to help you.

Where's your code?
Where's your schematic?
What's wrong with your ! key?

sp. "infra-red"

In your previous post you said:-

can anyone tell me if there is any code I can write to allow my arduino monitor to show transmitted text or message transmitted using an inferred diod to a inferred receiver? the baud rate is at 38400, and the arduinos are in sync, but the monitor shows simple "hello world" as a bunch of garbled up characters etc. does it need to be converted into hex or binary to be printed or what??? im lost trying to get it to work....

Now you say :-

the baud rate is the same

The baud rate of an IR transmission is not 38400. That is the modulation frequency of the IR beam. IR does not transmit ASCII so you should not expect to be able to send a message like "hello world" over an IR link. But without posting your code that you are trying to make work you are just pissing everyone off.

Please read this:-
How to use this forum
to learn how to use this forum.

Sorry everyone, i was busy with finals...im just doing a simple "serial print", using SoftwareSerial...
Transmit code:

/*
IR_Transmitter

Board: Arduino Uno

Purpose: This demonstration program uses PWM to
output a 38 kHz carrier on pin 11 and serial data on
pin 2. The 38 kHz output is used to modulate the
serial output from pin 2 so that it can be detected
by an IR receiver.
*/

#include <SoftwareSerial.h>

const int rxPin = 3;
const int txPin = 2;

const int STX = 2;
const int ETX = 3;

const long IR_CLOCK_RATE = 38000L;

#define pwmPin 11 // IR Carrier

SoftwareSerial displayPort(rxPin, txPin); // Rx, Tx

void setup() {
// set the data rate for the Serial port
displayPort.begin(2400);

// toggle on compare, clk/1
TCCR2A = _BV(WGM21) | _BV(COM2A0);
TCCR2B = _BV(CS20);
// 38kHz carrier/timer
OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1);
pinMode(pwmPin, OUTPUT);
}

/*
sendMessagePacket: this function sends a text message over a serial link.
The message is in the format
*/
void sendMessagePacket(char message[])
{
int index = 0;
byte checksum = 0;

displayPort.print((char)STX);
while (message[index] != NULL)
{
displayPort.print(message[index]);
checksum = checksum + (byte)message[index];
index++;
}
displayPort.print((char)ETX);
displayPort.print((char)checksum);
}

void loop ()
{
char msg[] = "Hello";
sendMessagePacket(msg);
delay(1000);
}

Receiver code:

*/

#include <SoftwareSerial.h>

const int STX = 2;
const int ETX = 3;
const int INTERCHAR_TIMEOUT = 50;

const int rxPin = 2;
const int txPin = 255;

// set up a new serial port
SoftwareSerial displayPort = SoftwareSerial(rxPin, txPin, true);

/*
Function name: readChar

Input:
timeout: time in milliseconds to wait for a character on the
serial port

Output:
inChar: character read from the serial port

Returns:
true if a character was read, otherwise false
*/
boolean readChar(unsigned int timeout, byte *inChar)
{
unsigned long currentMillis = millis();
unsigned long previousMillis = currentMillis;

while (currentMillis - previousMillis < timeout)
{
if (displayPort.available())
{
(*inChar) = (byte)displayPort.read();
return true;
}
currentMillis = millis();
} // while
return false;
}

/*
Function name: readMessage

Input:
timeout: time in milliseconds to wait for a message
message: pointer to message buffer
maxMessageSize: size of message buffer

Output:
inChar: character read from the serial port

Returns:
true if a message was received, otherwise false
*/
boolean readMessage(char *message, int maxMessageSize, unsigned int timeout)
{
byte inChar;
int index = 0;
boolean completeMsg = false;
byte checksum = 0;

unsigned long currentMillis = millis();
unsigned long previousMillis = currentMillis;

while (currentMillis - previousMillis < timeout)
{
if (displayPort.available())
{
inChar = (byte)displayPort.read();

if (inChar == STX) // start of message?
{
while (readChar(INTERCHAR_TIMEOUT, &inChar))
{
if (inChar != ETX)
{
message[index] = inChar;
index++;
if (index == maxMessageSize) //buffer full
break;
checksum = checksum + inChar;
}
else // got ETX, next character is the checksum
{
if (readChar(INTERCHAR_TIMEOUT, &inChar))
{
if (checksum == inChar)
{
message[index] = NULL; // good checksum, null terminate message
completeMsg = true;
break;
}
else // bad checksum
{
completeMsg = false;
break;
}
} // read checksum
} // next character is the checksum
} // while read until ETX or timeout
} // inChar == STX
} // displayPort.available()
if (completeMsg)
break;
currentMillis = millis();
} // while
return completeMsg;
}

void setup() {
// set the data rate for the SoftwareSerial port
displayPort.begin(2400);
Serial.begin(9600);
Serial.println("\nStarting to listen...\n");
delay(200);
}

void loop()
{
const int MSG_BUF_SIZE = 255;
char msg[MSG_BUF_SIZE];

if (readMessage(msg, MSG_BUF_SIZE, 5000))
{
Serial.println(msg);
}
else
Serial.println("No message");
}

Please read this:-
How to use this forum
Because your post is breaking the rules about posting code.

It will also tell you what information to post as well.

Now what is your hardware setup. How are you driving the LED? What are you doing to receive the IR in terms of the hardware? Without answering these questions we are all grubbing down in the dark.

the receiver is a Flying-Fish MH-Sensor-Series with an IR Filter Coated Diode(black), the IR transmitter is a Simple IR diode both on Arduino UNO Clones running Arduino Software IDE 1.6.8.

Duinoduino17:
Here is the receiver

Where?

Picture was too large to post...im using my Iphone to attempt to upload pics

the receiver is a Flying-Fish MH-Sensor-Series with an IR Filter Coated Diode(black),

One of these?
https://defendtheplanet.net/2016/01/01/5v-light-detector-analog-digital-flying-fish-mh-sensor-series/

Duinoduino17:
Picture was too large to post...im using my Iphone to attempt to upload pics

Then you should make it smaller whether you are using a phone or a PC. 640x480 is probably big enough.

This IR Thread may be of interest.

...R

Thats the pcboard and components, but the IR filter diode is not the same as that photo sensor...

But it says on that page:-

it servs the amount of light from 0 (very bright) to 1024 (very dark) using the analog pin.

That is not consistent with 38KHz modulation nor is it suitable for sending serial data into the Arduino.

What would you reccomend?

I would recommend editing that post so the code is displayed correctly.