Hi all,
I recently bought a few pairs of these:
Before I even connected the Transmitter, I wired up the receiver. When I connect the receiver module to my Arduino, I get a bunch of random garbage. I connect the data line to my oscilloscope, and there is a bunch of random data on the line, sometimes not even anything that looks like real data.
Oddly enough, when I touch my finger on the corner of the receiver board, the noise goes away and the data line sits nicely at 5V. I touch the surface mount components right above the coil that sits in the lower corner of the board.
I have tried 2 different receivers and see the same activity.
Anyone have any ideas?
#include <SoftwareSerial.h>
//Compiler Macros
const char compile_date[] = __DATE__ ;
const char compile_time[] = __TIME__;
const char filename[] = __FILE__;
SoftwareSerial mySerial(2, 3); // RX, TX
const int pinLED = 7;
byte a[10];
int numBytes = 0;
int i = 0;
unsigned long t1,t2,t3;
//////////////////////////////////////////////////////////////////////////////////
void setup()
{
pinMode(pinLED,OUTPUT);
digitalWrite(pinLED,HIGH);
Serial.begin(9600);
mySerial.begin(4800);
setupStream();
t1 = millis();
t2 = t1;
t3 = t1;
}
/////////////////////////////////////////////////////////////////////////////////////////
void loop()
{
t1 = millis();
if((t1-t2) > 10000)
{
t2 = t1;
}
numBytes = 0;
if(mySerial.available()>0)
{
delay(50);
numBytes = mySerial.available();
for(i=0;i<numBytes;i++)
{
a[i] = mySerial.read();
delay(5);
digitalWrite(pinLED,LOW);
delay(100);
digitalWrite(pinLED,HIGH);
}
Serial.print("Message received at: ");
Serial.println(t1/1000);
for(i=0;i<numBytes;i++)
{
Serial.print(i);
Serial.print(": ");
Serial.println(a[i]);
}
Serial.println();
Serial.println();
}
}