linking rf transmission & receiver with arduino

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.

receiverSoft.pde (705 Bytes)

transmitterSoft.pde (267 Bytes)

receivervw.pde (918 Bytes)

transmittervw.pde (469 Bytes)

"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.

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

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.