For the last few days I have been trying to get a simple RF network working between two Arduinos (both NG Rev C with ATMEGA168).
I have a simple transmit program
/* Simple xmit code */
byte counter;
int val=0;
void setup() {
Serial.begin(1200);
digitalWrite(13, HIGH);
delay(2000);
digitalWrite(13, LOW);
counter=10;
}
void loop() {
// send output to xmit
digitalWrite(13, HIGH);
delay(200);
digitalWrite(13, LOW);
Serial.print(counter);
delay(5000);
}
and a simple receiver code
/* Simple Recv */
int incomingByte = 0;
void setup() {
Serial.begin(1200);
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW);
}
void loop() {
if (Serial.available() > 0) {
incomingByte = Serial.read();
digitalWrite(13,HIGH);
delay(50);
digitalWrite(13,LOW);
delay(50);
digitalWrite(13,HIGH);
delay(50);
digitalWrite(13,LOW);
}
}
When I connect the Arduinos to USB ports on different computers and a wire between the gnd on each and a wire from the tx (pin 1) on the sender to the rx (pin 0) the programs work perfectly.
When I then replace the wired connections with a transmitter http://jaycar.com.au/productView.asp?ID=ZW3100 and reciever http://jaycar.com.au/productView.asp?ID=ZW3102 I have had no luck getting them to work.
These are standard 434Mzh xmit and recv pairs much like http://www.sparkfun.com/commerce/product_info.php?products_id=7815
I have followed the example http://www.sparkfun.com/datasheets/RF/KLP_Walkthrough.pdf for the Sparkfun items which look identical based on the datasheets.
On the transmitter I have connected 5v to the vcc, gnd to gnd and the tx (pin 1) to the data pin on the 434 xmit. I have a led on Pin 13.
On the receiver I have connected the various gnds to gnd, vcc to vcc and the rx (pin 0) to the data pin on the 434 recv. I have a LED on Pin 13
The sender Arduino flashes every two secs as it moves through the transmit code and when I plug the xmit wire in I am blocking my garage door remote from working so it seems like the xmiter is working.
The receiver blinks once on startup of the code but nothing more after that. I have also stuck a small piezo buzzer between the data out of the recv and ground and clicked my garage remote and hear a tiny chirp each time which tends to show that the receiver is working.
For good measure I bought a new set of xmit/recv yesterday and it made no difference.
Finally, I have also tried using the SoftwareSerial library and have again had no luck (it would work when wired but not wireless).
Any help or pointers would be much appreciated as this seems to be a topic not many people have covered.