Long range TS/RS does not work

Hi all,

I recently bought this transmitter/receiver http://www.ebay.com/itm/331344982006 .

Up to now no success to see this working (just to flash the led) although I was able to work with the simple case of this guy here http://www.icstation.com/product_info.php?ref=25&products_id=1402&affiliate_banner_id=1 (in this case I just reproduce the example to send a string; no led flashing)

Since the first has 6 pins (transmitter) I tried initially to use only one data PIN
13 --> 11 for arduino
12
11
10
9V --> external battery
GND --> GND

#include <VirtualWire.h>
void setup()
{
   Serial.begin (9600); // Sets the baud rate to 9600 bps  
   vw_setup(2000);	
   vw_set_tx_pin(13); 
   pinMode(12, INPUT);           // I just give instantly with a wire some current from the battery
   digitalWrite(12, HIGH);
}

void loop()
{
   char *msg2;
  if(digitalRead(12) == LOW)//if the button is pressed
  {
    Serial.println("it works");
    char *msg2 = "1";//send 1 to the receiver
    vw_send((uint8_t *)msg2, strlen(msg2));//send the byte to the receiver
    vw_wait_tx(); // Wait until the whole message is gone
  } 
}

For the receiver the PINS are as follows with second column the arduino PINS
GND --> GND
10
11
12
13 --> 12
17
VCC --> 5V arduino
GND

A led is also connected with PIN7 arduino and GND

#include <VirtualWire.h>
int led = 7;
void setup()
{
    Serial.begin(9600);	// Debugging only
    Serial.println("setup");
    vw_setup(2000);	 
    vw_set_rx_pin(12);    //Rx Data pin to Digital  Pin 12
    vw_rx_start();       // Start the receiver PLL running
    pinMode(led, OUTPUT);
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
 
 if (vw_get_message(buf, &buflen)) // Non-blocking
    {
	int i;

	for (i = 0; i < buflen; i++)
	{
	 Serial.print(buf[i]);//print received command
        if(buf[i] == '1')       //if button 1 is pressed.... 
      {
        digitalWrite(led,HIGH);
        Serial.println(" = forward");
       }
      }
      	Serial.println("");
    }   
}

Is there something wrong that I am doing? Could be that the virtualWire library might not work with other transmitters? Any help would be highly welcome

The Transmitter / Receiver you have bought has its own SC2262 / SC 2272 decoder on the board.
You dont need Virtualwire as what you have is not designed for sending serial data.
Its a simple remote control transmitter which allows a 4 bit nibble to be sent to the receiver which will
reproduce the 4 bit nibble.
If you put a logic 1 on any of the transmitter data pins , the corresponding data pin on the receiver will go to logic 1.

Thank you a lot for the answer, i have totally missed that.. Since I am a beginner one more trivial question. The best way then I guess is to connect its of the data pins to arduino pins (i.e. 7,8,9,10) and then with buttons (connect to 3,4,5,6 of arduino) just give HIGH or LOW to the corresponding data pin. Is that right?

Thank you again :smiley:

Yes, that will work fine.
You can combine combinations of data values from 0001 up to 1111.
The SC2262 can send the value 0000 but usually most of the kit transmitters rely on having
at least 1 input as 1 to determine when to turn the transmitter on.