Loading...
Pages: [1]   Go Down
Author Topic: linking rf transmission & receiver with arduino  (Read 276 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got a pair of 434mhz rf link transmitter and receiver and I have gone through several examples but I am not getting it to communicate. I was wondering if you could guide me if I am doing something wrong.

As per my circuit:
I have receiver pin 1 connect to Ground, pin 2 to digital pin 2 (for data in) of arduino, and pin 4 to power (5v). And I have an led connected to pin 11 for debugging purposes.

For the transmitter:
I have pin1 connected to Ground, pin2 to digital pin 4, and pin 3 to power(5v).

As per my code I have tried using Virtual wire library but I have not been getting any response on the receiver side.

So I just tried using NewSoftSerial library but that too has not worked.

Basically the transmitter is simply sending a sentence as char type to receiver and I have a if() statement on the receiver end which will turn on the LED if there is data on serial port. But instead LED comes on anyways.

At first glance, it seems like a programming error, but if I take out the rf receiver, the LED goes off and upon plugging receiver back the LED comes on. But if I take out the transmitter the LED still stays on.

Also the rx light on the receiver end should come on when receiving data but it isn't. Neither is the tx light on the transmitter end.

I have attached my receiver & transmitter codes in  here, if someone would like to take a look.
In the attached files: receiveSoft & transmitSoft use NewSoftSerial library and receivevw & transmitvw use Virtual wire library.

To me it seems like the transmitter is not functioning,

I appreciate any help.
« Last Edit: January 04, 2012, 02:35:19 am by robogeek » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 242
Posts: 16504
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"As per my code I have tried using Virtual wire library but I have not been getting any response on the receiver "
I believe that is because you are not actually transmitting.

Did  you try the virtual wire basic examples as written, with the parts on default pins 11 & 12?
You can use other pins, but you have to use a virtual wire command to reassign them, and you didn't.

Be sure to take these out: vw_set_ptt_inverted(true);
Unless your part has a Push to Talk pin (and most don't)

Try the basic examples first, they do work, then start messing with it.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you CrossRoad for your help. I did not realize that pins 11 & 12 were default pins.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 242
Posts: 16504
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep - need to read the documentation:

4.1 vw_set_tx_pin

extern void vw_set_tx_pin(uint8_t pin);

Set the digital IO pin to use for transmit data. Defaults to 12.

4.2 vw_set_rx_pin

extern void vw_set_rx_pin(uint8_t pin);

Set the digital IO pin to use for receive data. Defaults to 11.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Pages: [1]   Go Up
Print
 
Jump to: