Pages: [1]   Go Down
Author Topic: Help with 434mhz xmit and recv  (Read 1981 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
/* 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
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.
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi


the Jaycar TX module you linked to requires a 3V power supply, not a 5V supply. If you have been using it on a 5V supply it is probably destroyed.
The Rx module also says 3V power on the Jaycar web page, but then it says 5V  on its data sheet.

D
« Last Edit: April 28, 2007, 04:47:44 am by Daniel » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes. The datasheet and the site are inconsistent. There has been a few articles in the Silicon Chip magazine here in Australia that say the 5v is correct and that the fact it says 3v is not helpful ;-)
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

To test them you could just run 1Khz into the TX unit and put a scope on the RX to see if the signal is coming through.

D
« Last Edit: April 28, 2007, 05:33:25 am by Daniel » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm planning to do that next time I get to my father in laws in a couple of weeks.

That said, are there any other ideas? Could this version of the Arduino be any different to the ones used in the walk throughs etc.
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you could actually just hook up a pushbutton (with resitor) to key  the transmitter to see if it works! Write some code to make the RX Arduino blink an LED when the RX line is high.

From what you have said, and from the price, quality of documentation, the TX oscillator technique (SAW) and the el-cheapo modulation technique (ASK) used by the modules, I would have to say it is more than likely the radio modules that are causing the problem. And when you put all that up against the ultra-high quality of Arduino...  smiley

D  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Daniel,

Thanks heaps for your suggestions.

I created a simple xmit using a simple digital write and get what seems like a strong signal out.

I have tried a range of RX code with no luck...from a digital read on Pin 6, an analog read on p6 and a serial RX on P0. No matter what I code it seems like there is nothing being understood by the MCU.

Interestingly, attaching a piezo from the RX data out to the gnd makes a very strong squeek normally and when data is xmit'd it goes quiet which seems to show the TX/RX modules are fine.

The price, doco and structure of these modules is the same as all the other various forms of 433/434 modules that sparkfun and others have used.

I'd greatly appreciate anymore ideas from anyone.
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi

yes sounds like you are on the right track... beware that price, look and shape doesn't mean the Jaycar modules are  electrically equivalent to the Sparkfun ones. Manufacturers make different production runs of the same package with different guts for different clients.  Think of how many different IC's there are, for example, all in the same small black packages smiley

D
« Last Edit: April 28, 2007, 08:18:00 pm by Daniel » Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi

one more thought: have you disconnected the FTDI chip? IF the FTDI chip's output goes low, then the Atmega RX input will forever be held in alow state.

D

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do I disconnect it?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey hey hey!!!!  smiley-grin You are a champ!!!

I have put the power to ext and plugged in a 9v battery.

This provided no joy as the program would not start.

I added the 10k resister from the RX to the GND and the process started. HOWEVER....there was still no data being received.

I then removed the 10k resister once the program was running and it started receiving.

Sooooo.... I have to plug in external power, add the resister, wait till the program starts then remove it?

Is there a "Smarter" way to do this???
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi

this just means that the Atmega 168 was being 'hung' up by the state of  the RX pin.. perhaps it will need the 10K fix, but perhaps something else as you have 'loaded' it with the impedance of  the receiver. Anyway, sounds like you are minute away from having it fixed !

D
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well after another day of playing around I am no closer to a solution.

The last thing I can think of is using a PNP based switch with the resistor such that once the program starts running I set a pin high which is connected to the base of the transistor effectively taking the resistor out of the circuit.

Only other weird thing is that when I do get it working in the strange way of removing the resistor it only works if I have a piezo buzzer connected between the rx and gnd...weird!!

 smiley-sad
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi

just to simplify things with an eye towards finding the problem, can you get the TX/RX combination going without them connected to the Arduino? How about a pushbutton ont he TX and an LED on the RX?

D
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for the delay in getting back to this....I;ve been focused (unsuccessfully) on getting an LM3914 LED Driver to work with PWM....

Anyway, today I set up a circuit with the xmit data connected to a button then +ve and measured the voltage from the receiver data.

It all worked...press the button and the voltage changes on the receiver. Only thing was that when the button was pressed down (closed)...the receiver data line went low.....would this be as expected for the serial coding??

I'm thinking that if this is fine....maybe I just build a pulse based sort of morse code like on off tied to a set of pin instead of the serial port which seems to be giving me hassles. Any thoughts.
Logged

Pages: [1]   Go Up
Jump to: