RF Communication

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 ?

No, the antenna pin (pin 4) is connected to only the antenna, nothing else. You don't need anything connected to pin 2 on the Arduino for the transmitter. The transmitter is a serial device, so the only connections to the Arduino are the common GND, VCC, and the data pin. That's it.

Jon
Practical Arduino: www.practicalarduino.com

Thanx for reply :slight_smile:

right, didn't realise you were using unidirectional devices.

I couldn't read the PDF, so I'm going to assume he has the cheap 434mhz or 315mhz RX/TX pair, ASK modulation.

Here's a Sparkfun example:

And here's an example just using the SoftwareSerial... which can also be done with the hardware version by changing it all to Serial.print instead of rfSerial.print (and connecting to right pins of course):
http://dma.ucla.edu/senselab/node/389

If you have enough sketch space, Virtual Wire really helps eliminating the chance of noise.. but it also limits the amount of data being able to be sent per second. So you win some and you lose some. :stuck_out_tongue_winking_eye:

@Natman

Serial.print(6)

dont forget the ;
Like so Serial.print(6);

@000
What are you trying to connect, forget the radio's for now, just get the 2 devices connected serially first then worry about the radio's after,learn to walk before running

@ captainObvious
Yup. that's the transmitter/receiver I was talking about. Thanx for the link will try it out today. :slight_smile:

[edit]
In the link (http://dma.ucla.edu/senselab/node/389) Arduino #1 is connected only to transmitter right?

Please refer to the following figure.


[/edit]

Can someone help on this? :-/

Can someone help on this?

We're trying. But, at this point, you need to be much more specific about what you need help with.

what more information do you need? :slight_smile: I cant get the answer to the question asked in the figure. :frowning:

000,

For Software Serial you need to initialize both the TX and RX pins, even if you're not using them both. You can set it to a pin you're not using and just don't connect anything to it.

I'm not sure what more we can offer you, those tutorial/walk-throughs are pretty clear. :stuck_out_tongue:

The VALUE for the pin number doesn't even have to be realistic. 255 works as well as any value from 0 to 13.

The advantage of using virtualwire over serial (hard or soft) is that it attempts to balance out the 1's & 0's in the data stream so the primitive AGC on the ASK receivers achieves some kind of balance. Serial doesn't do this (it doesn't need to under usual circumstances) and big lumps of certain values going through can cause the AGC to become unbalanced and miss data. On the downside virtualwire is far harder to understand than serial........

Thanx u guys now i understood :smiley:
One thing though

The VALUE for the pin number doesn't even have to be realistic. 255 works as well as any value from 0 to 13.

Are u saying it need not be any pin no.? say a pin no. 2(as Tx) and a pin no. 255(as Rx) on the transmitter side Arduino? because I really dont want to waste a pin which i don't use as Tx/Rx in case of SoftwareSerial.
From my understanding both rx and tx are defined merely for calling the function in SoftwareSerial and you basically don't use rx pin in case of Transmitter Arduino? :slight_smile:

@pluggy
Thanx for the accurate reply. That was what I was looking for :wink:

As long as you aren't transmitting, you don't need to connect a pin to TX. If you aren't receiving, you don't need to connect a pin to RX. In which case, you would just use 255 for the "pin" that TX (or RX) is connected to, and SoftwareSerial will be happy.

Cool. Thats just the thing I needed. Thanx for the replies :slight_smile: