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>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>
<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>
<p>same issue i have faced.Do you have any solution for it</p>
<p><a href="https://www.pjrc.com/teensy/td_libs_VirtualWire.html" rel="nofollow">https://www.pjrc.com/teensy/td_libs_VirtualWire.ht...</a></p><p>dowload this library :) it works for me</p>
<p>Hi spudz.</p><p>I'm using Arudino 1.6.3, and had the same problem that you dit. This is how I fixed it...</p><p>You have to edit some files in VirtualWire library:</p><p>- in VirtualWire.h change:</p><blockquote>#include &lt;wiring.h&gt; to #include &lt;Arduino.h&gt;</blockquote><p>- in VirtualWire.cpp change:</p><blockquote>#include &quot;WProgram.h&quot; to #include &quot;Arduino.h&quot;<br></blockquote><p>After that restart Arduino studio and compile the program again.</p><p>Hope it helps you to.</p>
it helped, thanks!
<p>I am not sure if the missing library in your listing is an html problem or that you do not have it included in yr program, but that could be yr problem</p>
<p>You must install the VirtualWire library before compile the code, you can download it from the article where it says: &quot;<a href="http://www.seeedstudio.com/depot/images/product/VirtualWire.rar" rel="nofollow"><strong>First Download the library from Here .</strong></a>&quot;. Afterwards, uncompress it to your arduino library folder which is in this case: &quot;C:\Program Files (x86)\Arduino\libraries\&quot;<br>After doing this, close all arduino compiler interfaces and you should see a new set of examples. The code is now able to run. Good luck ;) </p><p>.</p>
<p>i install the VirtualWire library but i face a lot of errors.i have paste all the errors below.please give me the solution asap.</p><p>In file included from transmitter.cpp:11:</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:54: error: variable or field 'vw_set_tx_pin' declared void</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:54: error: 'uint8_t' was not declared in this scope</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:58: error: variable or field 'vw_set_rx_pin' declared void</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:58: error: 'uint8_t' was not declared in this scope</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:62: error: variable or field 'vw_set_ptt_pin' declared void</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:62: error: 'uint8_t' was not declared in this scope</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:66: error: variable or field 'vw_set_ptt_inverted' declared void</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:66: error: 'uint8_t' was not declared in this scope</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: variable or field 'vw_setup' declared void</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: 'uint16_t' was not declared in this scope</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:90: error: 'uint8_t' does not name a type</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:96: error: 'uint8_t' does not name a type</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:99: error: 'uint8_t' does not name a type</p><p>C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:104: error: 'uint8_t' does not name a type</p><p>transmitter.cpp: In function 'void setup()':</p><p>transmitter.pde:-1: error: 'vw_set_ptt_inverted' was not declared in this scope</p><p>transmitter.pde:-1: error: 'vw_setup' was not declared in this scope</p><p>transmitter.cpp: In function 'void loop()':</p><p>transmitter.pde:-1: error: 'vw_send' was not declared in this scope</p>
I installed the library but it doesn't matter now cause i fixed it myself by downgrading from 1.5.6. Ide to 1.0.6.ide and it worked
<p>Hi! I've also got this pair of modules and having a strange issue with the transmitter: it seems to turn on faster than off.</p><p>More details:</p><p>I'm feeding it with a 3.3v digital signal quantized by 200 mks intervals. On the receiving side high level signals are always 40 mks longer than low level ones, like that (starting with low):</p><p>166 238 165 238 166 240 1984 240 367 240 367 240 367 240 367 441 165 241</p><p>While it should be more like that:</p><p>200 200 200 200 200 200 2000 200 400 200 400 200 400 200 400 400 200 200</p><p>It's not a firmware or receiver issue, as I'm getting a perfectly clean signal from reading transmitter data line directly and when receiving a signal from a commercial device.</p><p>Did anyone encounter the same problem? Any clues on how to fix it?</p>
<p>hi i have one with 8 pins and i will buy new ne with 4 like in the photo i have ht12e/d is it the same wiring procces??</p>
<p>8 pin device probably has more data lines, so generally no, the process is not the same. You should read markings on each pin and understand their purpose.</p>
<p>Will receiver work at 3.7 V? I want to operate it by Li-ion battery. </p>
<p>I am using FS1000A, it can operate from 2,5V to 12V, only tested at 5V. First time today to work with these RF parts</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>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>
Would it matter that I'm using an Arduino UNO and a dfRobot - duino?<br><br>My receive sketch is hanging: http://forum.arduino.cc/index.php?topic=350312.0
Please explain to me how to reduce the effective range to a few meters say (5m)... I am in a scenario that nearby car-key transmitters may trigger a relay switch I am working on!!
<p>it does not compile</p>
<p>Are you using the latest version of Arduino IDE? That might be the problem, the library files VirtualWire.cpp and VirtualWire.h aren't compatible with later versions of Arduino. The quick fix is get the updated version of the library virtualWire. The longer fix is to add the lines in the VirtualWire.cpp file<br>#if defined(ARDUINO)<br> #if (ARDUINO &lt; 100)</p><p>Before the line<br> #include &quot;WProgram.h&quot;</p><p>and</p><p>Adding the following in the VirtualWire.h file:</p><p>#include &lt;stdlib.h&gt;<br>#if defined(ARDUINO)<br> #if ARDUINO &gt;= 100<br> #include &lt;Arduino.h&gt;<br> #else</p><p>before </p><p>#include &lt;wiring.h&gt;</p>
Yes Im using 1.6.5 the latest version. <br>Possibly that's the problem.<br>Thanks
<p>it does not compile</p>
<p>this code does not work</p>
<p>worked fine for me, what was your error?</p>
<p>Hello Mohanad,</p><p>Great instructable, thanks for sharing with us.</p><p>I wanted to ask is there a way to send raw bits?<br>For example if I wanted to send those bits &quot;0010110&quot; and receive them as is, is there a way to do that other than sending the stream as a string using VirtualWire library?</p>
<p>hello, i need help</p><p>I am designing a distance meter, but for that I will use (read) the signal strength value (the RSSI technique) sent by TX. I will can do with this RX and TX?</p>
<p>hello, i need help</p><p>I am designing a distance meter, but for that I will use (read) the signal strength value (the RSSI technique) sent by TX. I will can do with this RX and TX?</p>
<p>Hi. I am a lighting designer, trying to wirelessly turn on/off LED lights, wirelessly. I have a 4 channel transmitter/receiver (see images). The first channel would be an all on/off, for the other 3 channels, their loads 1amp, each. Does anyone have an idea of how I would complete this task? Thank you SO much, in advance.</p>
<p>I am not sure eaxactly what yr TxRx pair does but if you already have 4 channels then let yr arduino react to those 4 channels with the desired action.<br>Ofcourse you do not need 4 channels as you can just send codes through 1 channel and let your arduino switch the desired outputs for your lights. You can either do that with a relay or a Thyristor or Triac.<br>Without more info on what u exactly want it is hard to tell u more</p>
<p>How do I Make the antenna, and where do I attach?</p>
<p><a href="http://www.instructables.com/id/433-MHz-Coil-loaded-antenna/" rel="nofollow">http://www.instructables.com/id/433-MHz-Coil-loade...</a></p><p>attach to the little hole marked antenna</p>
<p>More on antenna theory, links to calculators for different antennas, and a cool project to try can be found here: <a href="http://www.whatisacnc.com/pages/Antenna-Radio.PHP" rel="nofollow">http://www.whatisacnc.com/pages/Antenna-Radio.PHP </a> </p><p>An index to those calculators here: http://www.whatisacnc.com/pages/antenna </p>

About This Instructable


474 favorites


More by Mohannad Rawashdeh: Motor Driver BTS7960 43A BYJ48 Stepper Motor RF 315/433 MHz Transmitter-receiver Module and Arduino
Add instructable to: