Hi every body , I searched on Instructables about a simple RF Transmitter-receiver module , Which is used in Remote control for cars , or to control simple tasks , like control relay on/off unfortunately I didn't find What I need   , So i decided to write a simple artical about this transceiver and How we can connect it with arduino  and program it .


at first let's take a look for what we need :

1)  2 Arduino Board "I used Uno" 

2) RF 315MHz or 433MHz transmitter-receiver module .

3) jumper wire .

4) BreadBoard .

5)External Power supply (9V Battery *2) "Optional" .

Step 1: Module Specification

This module has a specification for :

Transmitter : 

Working voltage: 3V - 12V  fo max. power use 12V
Working current: max  Less than 40mA max , and min 9mA
Resonance mode: (SAW)
Modulation mode: ASK
Working frequency: Eve 315MHz  Or  433MHz 
Transmission power: 25mW (315MHz at 12V)
Frequency error: +150kHz (max)
Velocity :  less than 10Kbps

So this module will transmit up to 90m in open area .

Receiver :

Working voltage: 5.0VDC +0.5V
Working current:≤5.5mA max
Working method: OOK/ASK
Working frequency: 315MHz-433.92MHz
Bandwidth: 2MHz
Sensitivity: excel –100dBm (50Ω)
Transmitting velocity: <9.6Kbps (at 315MHz and -95dBm)

 the use of an optional antenna will increase the effectiveness of your wireless communication. A simple wire will do the trick.

<p>hi,can voice transmission be done with these?</p>
<p>Hi I`m a Engineering Student fro Philippines <br>i`m looking for a shop where i can buy this 433Mhz Transmitter and receiver<br>:) <br>hope you can give me some<br><br>thank you in advance</p>
<p>Hi,</p><p>I can connect to a signal amplifier?</p><p>What kind of amplifier?</p>
hi,<br><br>can this be use for 1-2km range?
<p>use Xbee module.... It can give more range...upto 50Kms if used highest power module.</p>
<p>I need to use the RF module to control 4wheel drive motor control with L293D IC. Where can i get the code? Please give a link...! </p>
<p>write it yourself... this is instructables, meaning that someone has probably done a 'how to code' page</p>
<p>Can the transmitter be configured to transmit exactly at 433.68 MHZ?</p>
It's a good question. I also would like to change the frequency of the modules.
<p>I want to use this modules to monitor some sensor, but I want to make each one a transmitter, and do one arduino MEGA as a central unit which receives the data of many of these modules.</p><p>How many signals can a receiver have before it stops working?</p>
<p>It works! Thank you...This really helps with my project. Now I have to implement a photosensor and PIR into these programs. </p>
<p>Why using a another library instead of the SoftwareSerial library?</p>
<p>Those modules works pretty well with this easy to use domotic system: <a href="https://github.com/roccomuso/iot-433mhz" rel="nofollow">https://github.com/roccomuso/iot-433mhz</a></p><p>Totally open source and easy customizable :)</p>
<p>download this file for the code to work completely. once downloaded extract and put it in this location </p><p>C:\Program Files (x86)\Arduino\libraries</p><p>The link..</p><p><a href="https://www.pjrc.com/teensy/arduino_libraries/VirtualWire.zip" rel="nofollow">https://www.pjrc.com/teensy/arduino_libraries/Virt...</a></p>
<p>This helped me to get rid of wiring.h was missing.</p><p>Thanks</p>
<p>still have wiring.h missing </p><p>can not compile the sketch</p>
<p>thank you SuryaK8.</p><p>This .zip file works perfectly.</p><p>I added the .zip file directly from the IDE.</p><p>Can you suggest me a method to send a PWM signal over rf 433Mhz Transmitter Receiver Module? I am trying to run a ESC via the receiver of the RF combo.</p>
<p>Had a small problem with library but downloaded</p><p> <a href="https://www.pjrc.com/teensy/arduino_libraries/VirtualWire.zip" rel="nofollow">https://www.pjrc.com/teensy/arduino_libraries/Virt...</a></p><p>And all works ok.</p>
<p>Thanks for sharing this solution</p>
<p>cheers mate had the same problem</p>
I was wondering if this can be programmed for length and i wanted to know how
<p>Keeps saying some functions are not defined in scope. what does this mean? how do i fix this???</p>
<p>Hi, I need transmit 1 KM, what should I change to get more gain? Thank you!</p>
<p>Thanks for this. After a long time after searching the internet I've actually got my RF module to working.</p><p><strong>Question</strong>: How do I access the string that it receives, what's the variable called? I want to <em>serial.println</em> to my computer but don't know what to have as the argument of the function.</p>
<p>I think it's stored in buf[0]. However, the values received in the serial monitor are 48 and 49 - these are decimal for ascii 0 and 1 respectively. See my question I posted here: <a href="http://www.instructables.com/answers/Arduino-How-do-I-convert-a-decimal-to-ASCII/" rel="nofollow">Arduino: How do I convert a decimal to ASCII?</a></p>
<p>It is stored in buf[0]. However, if you want to serial.print(buf[0]);, you'll get 48 &amp; 49 in your serial monitor. This is decimal for 0 and 1 in ASCII. To solve this, you need to say Serial.println( buf[0]-'0' ). Thanks to <a href="http://www.instructables.com/member/steveastrouk/" rel="nofollow">steveastrouk</a> for pointing this out.</p>
so can i use the receiver to recieve radio stations if i hook up power and speaker.?
<p>Can I control servo using MPU6050 wirelessly using this?</p>
<p>Thanks for this!</p><p>I just have a question, I am trying to implement certain code when no signal is received. For example, when my receiver is out of range. Does anyone have any ideas for checking the status and determining when there is no message?</p>
If I put else statement to do another work when signal is not receiving it doesnt work..what should I do..I m using arduino uno..
<p>here is my code</p><p>#include &lt;VirtualWire.h&gt;</p><p> int leftmotorforward =11;</p><p> int leftmotor2forward=3;</p><p> int rightmotorforward=6;</p><p> int rightmotor2forward=5;</p><p>void setup()</p><p>{</p><p> Serial.begin(9600); // Debugging only</p><p> Serial.println(&quot;setup&quot;);</p><p> pinMode(13,OUTPUT);</p><p> pinMode(leftmotorforward,OUTPUT);</p><p> pinMode(leftmotor2forward,OUTPUT);</p><p> pinMode(rightmotorforward,OUTPUT);</p><p> pinMode(rightmotor2forward,OUTPUT); </p><p> vw_set_rx_pin(8);</p><p> // Initialise the IO and ISR</p><p> vw_setup(2000); // Bits per sec</p><p> vw_rx_start(); // Start the receiver PLL running</p><p>}</p><p>void loop()</p><p>{</p><p> uint8_t buf[VW_MAX_MESSAGE_LEN];</p><p> uint8_t buflen = VW_MAX_MESSAGE_LEN;</p><p> if (vw_get_message(buf, &amp;buflen)) // Non-blocking</p><p> {</p><p> int i;</p><p> digitalWrite(13, true); // Flash a light to show received good message</p><p> // Message with a good checksum received, dump it.</p><p> Serial.print(&quot;Got: &quot;);</p><p> for (i = 0; i &lt; buflen; i++)</p><p> {</p><p> Serial.print(buf[i]);</p><p> Serial.print(&quot; &quot;);</p><p> if (buf[i]=='1'){</p><p> speedcontrol();}</p><p> if( buf[i]=='2'){</p><p> off();}</p><p> }</p><p> Serial.println(&quot;&quot;);</p><p> digitalWrite(13, false);</p><p> }</p><p> else {</p><p> driveforward();}</p><p>}</p><p> void speedcontrol()</p><p>{</p><p> analogWrite(leftmotorforward,100);</p><p> analogWrite(leftmotor2forward,100);</p><p> analogWrite(rightmotorforward,100);</p><p> analogWrite(rightmotor2forward,100);</p><p> delay(2000);</p><p> analogWrite(leftmotorforward,0);</p><p> analogWrite(leftmotor2forward,0);</p><p> analogWrite(rightmotorforward,0);</p><p> analogWrite(rightmotor2forward,0);</p><p>}</p><p>void driveforward()</p><p>{ </p><p> analogWrite(leftmotorforward,200);</p><p> analogWrite(leftmotor2forward,200);</p><p> analogWrite(rightmotorforward,200);</p><p> analogWrite(rightmotor2forward,200);</p><p> delay(50);</p><p> analogWrite(leftmotorforward,0);</p><p> analogWrite(leftmotor2forward,0);</p><p> analogWrite(rightmotorforward,0);</p><p> analogWrite(rightmotor2forward,0);</p><p>}</p><p>void off()</p><p>{ </p><p> digitalWrite(leftmotorforward,LOW);</p><p> digitalWrite(leftmotor2forward,LOW);</p><p> digitalWrite(rightmotorforward,LOW);</p><p> digitalWrite(rightmotor2forward,LOW);</p><p>}</p>
<p>Never mind, I figured it out. If anyone else needs to do the same thing, I used the vw_wait_rx_max(time) function and set the time in milliseconds. This function from the library allows for the Arduino to wait for a character and if nothing is received within the set amount of time it will return false, if a character was receive, it will return true.</p>
<p>how to connect the rf with just one arduino board? or must be two?</p>
<p>It may be possible to write a rx_tx code that will transmit and receive to the same board but it would be extremely unusual and would serve no real purpose. I would just buy another clone arduino for $5 so you can have one running the TX code and one receiving it</p>
<p>How do I increase the transmission range? I got regular breadboard wire as antennas about 20cm long. I tried powering the transmitter with a 9v battery. Also, I tried to lower the bps rate to 1000. It didn't increase the range at all and worse it wasn't able to transmit. </p>
<p>You'll probably need to design your own signal amplifier. I don't think you can increase the range just provide a better stable signal. which can lead to a higher range eventually, but negligible in my eyes (at least with a wire). </p>
<p>those are 2 separate and unrelated issues, first make sure its working, then worry about increasing range</p>
<p>If i put the RF receiver into a completely sealed box, will the receiver still be able to receive data? or should i put an antenna outside the box connecting the rf reciever inside? </p>
<p>completely sealed? Then No, but i doubt your are going to have it sealed against such small waves as 315 mhz. Yes antenna outside of box for a good range</p>
<p>Have to respond to this, sealed != shielded. If it is completely sealed the relative &quot;low&quot; frequency of 315Mhz can still penetrate a systems casing. If it is completely shielded (metal) casing than you'll need an external antenna.</p>
<p>Hi <br>I want to control many Relay by using RF , Point to multi Point</p><p>So , What i mush do to config RF module , how does it know Address or ID each Recever module ?</p>
<p>Buy something like these <a href="http://www.rfsolutions.co.uk/acatalog/DS800-4.pdf" rel="nofollow">http://www.rfsolutions.co.uk/acatalog/DS800-4.pdf</a> if you want to control relays. You will need to use 5v relays not 12v and connect the encoder/decoders of whatever brand you choose to the rf Tx/Rx and then connect receiver/decoder to the relays and connect each Tx/Encoder to as many switches as you need for relays. It is pretty simple after you first get it, message me if you want more help. Good luck</p>
<p>can I make a 2 way radio with another transmitter-receiver Module?</p><p>and if possible, how can I do it?</p>
<p>hi, it worked for me but i need documentation report. if anybody have the documentation please share it.</p>
<p>hi, i want to communicate the rf each other but i have only one arduino board. or the rf must have one arduino for each at receiver and transmitter?</p>
<p>Arduino: 1.5.7 (Windows 8), Board: &quot;Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)&quot;</p><p>In file included from transmitter.pde:6:0: <br>C:\Program Files (x86)\Arduino\libraries\VirtualWire/VirtualWire.h:14:20: fatal error: wiring.h: No such file or directory <br> #include <br> ^ <br>compilation terminated.</p><p> This report would have more information with <br> &quot;Show verbose output during compilation&quot; <br> enabled in File &gt; Preferences.</p><p>i was trying to compile trasmitter example aaaaand this error appeared</p>
<p>worked for me. Thanks a bunch</p>