RF Communication

Hi,
I have two Arduino Boards with me. I need to do some kind of wireless communication between them. I have a TWS-434/RWS-434 RF module. I need to transmit a matrix (containing values 0 , 1 , 2). I have heard abt SoftwareSerial.h and Virtualwire.h libraries(but has never really worked with either of them :-[ ). I need to correctly transmit this matrix only once. So speed isnt a criteria. Can someone please guide me in which path I must choose to go about? ie) SoftwareSerial.h or Virtualwire.h. which will be better? Or is there a better option? Btw wat is the difference between the two? :-/ I would like to keep program size as low as possible.

Hoping for a fast reply.
Thanx in advance. :slight_smile:

Data sheet for those modules?

Personaly i prefer the range of nrf24l01 radios, for ease of use, how does your radio communicate, rs232 or spi?

Datasheets.
http://www.mediafire.com/file/kh2nxyel07lxrdf/rf.pdf

@P18F4550
I only have the tws-434/rws434 Modules.
:slight_smile:

Well, they transmit and receive serial data. So, transmitting the matrix is a matter of sending the bytes in the matrix to the serial port, in whatever order you like (row major or column major or random).

Re-assembling the matrix is a matter of reading in the bytes, hoping none got lost, and putting them in the 2D array on the receiver in the correct place.

Whether to use SoftwareSerial, NewSoftSerial, or VirtualWire depends on how you have the RF modules attached to the Arduinos. Each method results in one byte at a time being broadcast or received.

So no clear winner regarding which to use? ease of programming wise?

They appear to use AM, so I'd start by simply turning the input to the Tx on, and checking the output of the Rx to see if the signal is received. If that works, try sending some data. A scope would be useful.

its ASK modulated. My problem is what sort off progrmmin like SoftwareSerial.h or Virtualwire.h to use to send out the data through Arduino.

Just pick one of them and try it! Try that test of mine first, it might save you some time.

why are you doing it in software? the hardware serial port is far more efficient.

The reason i dont like the 433mhz and such AM modules is that most dont have auto mute, so the RX is always recieveing and you have to either send a header or decide from the output what is valid data and what is random static, this is why i like the 2.4gig modules their not too expencive

http://letsmakerobots.com/node/12336

Just a basic tutorial on how to use the RF kits with VirtualWire.

They're cheap.. so, well you get what you pay for. Slow speed, lots of coding, not a very good distance... but I've used it for simple projects without any complaints, but just purchased some a few XBees with shields.

@Ultramagnus
I didnt get u...
@CaptainObvious
Yup i have seen that tutorial befre. That got me thinking about VirtualWire. bit of googling made me find out abt SoftwareSerial. Still undecided. Thanx anyways.
@ Leon Heller
I guess I will folloe ur technique. Randmly pick one and see how it goes.

Thanx for all the replies guys. :slight_smile:
It would be gr if someone can tell me the difference between the two. Else its kinda ok. I will get to know it in a couple of days time after trying it out. :wink:

@Ultramagnus
I didnt get u...

the arduino has a serial port used by the normal serial library Serial - Arduino Reference . unless you have a reason not to use it you should use it.

Are you saying I can transmit data via digital pin 1 using Serial function? I thought serial was just used for communication between PC(Arduino IDE) and the board.
If its possible to transmit serially via digital pin 1 can plz tell me how i do it? for example say if i want to transmit a number say 6 via digitalpin 1. how do I write it?

connect digital pin one (tx) to your transmitter's RX pin, and digital pin 0 (rx) to your transmitter's TX pin, the rest is explained in the link I gave you.

Serial.print(6)
Its the same as communicating over the computer

connect digital pin one (tx) to your transmitter's RX pin, and digital pin 0 (rx) to your transmitter's TX pin, the rest is explained in the link I gave you.

I am not getting what u mean by transmitter's TX pin. Transmitter has only 4 pins right?
Please refer Datasheet http://www.mediafire.com/file/kh2nxyel07lxrdf/rf.pdf
Am I correct in this?

Pin 1 GND (to GND)
Pin 2 Transmitter input (connected to digital pin 1 of Arduino)
Pin 3 Vcc (to 9V)
Pn 4 RF output (connected to antenna )

So what do I connect to digital pin 2? :-/

Serial.print(6)
Its the same as communicating over the computer

So if i give serial.print(0) it prints 0 on the serial monitor and it transmits value 0 through digital pin 1? :slight_smile:

Pin 2 is the Tx data pin.

So Pin 4 of transmitter module must be connected to digital pin 2 of Arduino and to the antenna ?