Connecting RF transmitter and receiver pair to arduino

I got this RF tx and rx pair: http://www.bitsbox.co.uk/sensors.html (scroll to the bottom)

here is the datasheet for the transmitter: http://www.bitsbox.co.uk/data/AMRT4_433.pdf

here is the datasheet for the receiver: http://www.bitsbox.co.uk/data/AM-HRR433.pdf

Can someone please guide me as to how i cant connect them to the arduinos and a simple example code maybe?

Thanks in advance.

What do you want to do with them?

I want to control 4 relays. ill have 2 arduinos, one on the tx side one on the rx side.

Hi,

Those are OOK (On-Off Keying) modules, I believe. This is like old time Morse code.. There is noise in between on-off signals.

There is an Arduino library that is often used: http://www.open.com.au/mikem/arduino/VirtualWire.pdf The library: http://www.open.com.au/mikem/arduino/VirtualWire-1.9.zip

OOK (Sometime called ASK (Amplitude Shift Keying) ) requires the receiver to be synchronized with the transmitter for each burst of data.

Power/Relay stuff (One the RF works!) is here: http://arduino-info.wikispaces.com/ArduinoPower

You can use normal serial protocols with those units, but only up to about 2400 bits per second, and slower is better.

For resilience, you could try something like R/C PPM, where you would send the state of all the relays say 20 times a second encoded as a pulse width, and only change the state of the relay if you saw the same state in consecutive packets. Pulses would be, say 1 or 2 ms separated by a 1ms gap, with a much longer gap between packets.

I want to control 4 relays. ill have 2 arduinos, one on the tx side one on the rx side.

I think you can do this more easily with a pair of XBees and you might not even need your Arduinos.

Don

Thnaks everyone for your help.

You can use normal serial protocols with those units, but only up to about 2400 bits per second, and slower is better.

For resilience, you could try something like R/C PPM, where you would send the state of all the relays say 20 times a second encoded as a pulse width, and only change the state of the relay if you saw the same state in consecutive packets. Pulses would be, say 1 or 2 ms separated by a 1ms gap, with a much longer gap between packets.

That seems so difficult :/. anyway i have connected them to 2 arduinos and they are working! i have used a very easy approach. i send a word as an array and on the receiver side i just compare it in an if statement. it works perfectly. Are there any disadvantage of using this method?

Are there any disadvantage of using this method?

Noise from number 47's wireless doorbell? I don't know, I can't see your code.

#include <VirtualWire.h>
int check2 = 1;
char buttn1[8] = {"relay 1"} ;

void setup()
{
    Serial.begin(9600);	
    Serial.println("setup");

  
    vw_set_ptt_inverted(true); 
    vw_setup(2000);	
    vw_rx_start();      

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) 
    {
	int i;

      
	Serial.print(check2);
	
	for (i = 0; i < buflen; i++)
	{
	    Serial.print(buf[i]);
	   
	}
	Serial.println("");
       
    }
if (buttn1[6] == buf [6] && check2 == 1){
  digitalWrite(13,HIGH);
check2 = 0;

}
 if ( buttn1[6] != buf [6] && check2 ==  0 ) {

check2 = 2;

}
 if ( buttn1[6] == buf [6] && check2 ==  2 ) {
  digitalWrite(13,LOW);
check2 = 3;
}
 if ( buttn1[6] != buf [6] && check2 ==  3 ) {

check2 = 1;
}
}

I know its pretty bad, but it works fine. i just compare the integer “1” . The check var is just to get a special button press action.

I know its pretty bad, but it works fine.

Bad?
It cannot even compile.
Closing brace for setup?

Just wanted to drop in my 2 cents. I am using RF Transmitter/Receiver pairs much like those, but from SparkFun.com

SparkFun Search Results: http://www.sparkfun.com/search/results?term=RF+link&what=products

I am using the 315MHz versions.

I am using them at my motel to relay signals when a door sensor is tripped (a potential guest or other person opens up one of the two office doors). Once any of the sensors are tripped, the Arduino Mega transmits a specific message via the RF Link Transmitter. While the SparkFun page states 5V supply, it can handle 1.5V - 12V. I am feeding the transmitter 9V directly from the VIN port of the arduino. More power = more range and signal strength.

The receivers are connected to remote boxes along side a Radio Shack 75dB chime and piezo buzzer. The chime is for when the office/lobby doors are opened, and the piezo is for other status messages. If the door(s) are open for 3 minutes (guest didn't shut it all the way), it makes an alternating higher pitched buzz. I have other status messages as well, but as of yet haven't fully implemented them for regular use.

I have only run into one or two instances where one of the remote chimes rang on its own without the door opening, so it could have been that I simply didn't have the transmitted control code/message long enough and some random noise just happened to match the overall message. I have since increased the size of the control code/message and have not run into an issue since.

The VirtualWire PDF mentioned above helped out greatly.

Hey, you did that programation, i need to know how two connect two arduinos too, i want to control 10 servos by 10 potentiometres via bluethoot, i have the master bluetooth and the slave