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

Materials: 

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>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`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>http://www.ebay.com/itm/351552385074?_trksid=p2057872.m2749.l2649&amp;ssPageName=STRK%3AMEBIDX%3AIT</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>
<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>
<p>thanks!</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>

About This Instructable

742,893 views

568 favorites

License:

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