RF 315/433 MHz Transmitter-receiver Module and Arduino

Picture of RF 315/433 MHz Transmitter-receiver Module and Arduino
RF Module 017.JPG
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" .

Remove these adsRemove these ads by Signing Up

Step 1: Module Specification

Picture of Module Specification
315-MS-3_zpsdd9bdc2a (1).jpg
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.

Step 2: Schematics

Picture of schematics
the connection for this module is very easy .

for Transmitter :

Vcc >>>>5V
ATAD>>>D12"You can change it as you like from Software" .
Gnd >>> Gnd

Receiver :

1-40 of 158Next »
spudziuvelis7 months ago

Arduino: 1.5.7 (Windows 8), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from transmitter.pde:6:0:
C:\Program Files (x86)\Arduino\libraries\VirtualWire/VirtualWire.h:14:20: fatal error: wiring.h: No such file or directory
compilation terminated.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

i was trying to compile trasmitter example aaaaand this error appeared

same issue i have faced.Do you have any solution for it


dowload this library :) it works for me

Hi spudz.

I'm using Arudino 1.6.3, and had the same problem that you dit. This is how I fixed it...

You have to edit some files in VirtualWire library:

- in VirtualWire.h change:

#include <wiring.h> to #include <Arduino.h>

- in VirtualWire.cpp change:

#include "WProgram.h" to #include "Arduino.h"

After that restart Arduino studio and compile the program again.

Hope it helps you to.


it helped, thanks!

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

You must install the VirtualWire library before compile the code, you can download it from the article where it says: "First Download the library from Here .". Afterwards, uncompress it to your arduino library folder which is in this case: "C:\Program Files (x86)\Arduino\libraries\"
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 ;)


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.

In file included from transmitter.cpp:11:

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:54: error: variable or field 'vw_set_tx_pin' declared void

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:54: error: 'uint8_t' was not declared in this scope

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:58: error: variable or field 'vw_set_rx_pin' declared void

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:58: error: 'uint8_t' was not declared in this scope

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:62: error: variable or field 'vw_set_ptt_pin' declared void

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:62: error: 'uint8_t' was not declared in this scope

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:66: error: variable or field 'vw_set_ptt_inverted' declared void

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:66: error: 'uint8_t' was not declared in this scope

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: variable or field 'vw_setup' declared void

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: 'uint16_t' was not declared in this scope

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:90: error: 'uint8_t' does not name a type

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:96: error: 'uint8_t' does not name a type

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:99: error: 'uint8_t' does not name a type

C:\Users\decent\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:104: error: 'uint8_t' does not name a type

transmitter.cpp: In function 'void setup()':

transmitter.pde:-1: error: 'vw_set_ptt_inverted' was not declared in this scope

transmitter.pde:-1: error: 'vw_setup' was not declared in this scope

transmitter.cpp: In function 'void loop()':

transmitter.pde:-1: error: 'vw_send' was not declared in this scope

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
vipins320 days ago
Ned9528 days ago

Pls I need help to rectify this errors

Arduino: 1.5.8 (Windows 8), Board: "Arduino Uno"

Build options changed, rebuilding all

Using library VirtualWire in folder: C:\Users\Documents\Arduino\libraries\VirtualWire (legacy)

C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=158 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Users\Documents\Arduino\libraries\VirtualWire C:\Users\AppData\Local\Temp\build8942404980792644047.tmp\Receiver_rx.cpp -o C:\Users\AppData\Local\Temp\build8942404980792644047.tmp\Receiver_rx.cpp.o

Receiver_rx.ino: In function 'void setup()':

Receiver_rx.ino:18:17: error: 'recieve_pin' was not declared in this scope

Receiver_rx.ino: In function 'void loop()':

Receiver_rx.ino:32:3: error: 'unit8_t' was not declared in this scope

Receiver_rx.ino:32:11: error: expected ';' before 'buf'

Receiver_rx.ino:37:22: error: 'buf' was not declared in this scope

Receiver_rx.ino:37:28: error: 'buflen' was not declared in this scope

Error compiling.

Obriris1 month ago

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.


Doesn't complile.

VirtualWire.h:14:20: fatal error: wiring.h: No such file or directory

Where does this file come from?

better into (and newer versions) of the VirtualWire library are here:


Great! This new library solve the problem! Awesome! Thanks!

good to know. Mind you though that virtualWire is at the end of its lifespan and is being replaced by 'radiohead' http://www.airspayce.com/mikem/arduino/VirtualWire...
there is ofcourse also 'Manchester code'

It is a very good tutorial.First time rf worked for me!

MeenaB2 months ago

i've got these modules and i was using them with HT12E and HT12D ICs without micro controller and they work, but they don't work without an antenna. any ideas about how to make the best antenna for that module?

ShawnS32 months ago

How would one handle interference with multiple TX/RX?

Awesome tutorial! I was wondering. Does controller have to be integer? or can it be a string ??

I seem to remember that vw cannot send strings

NiyatiK4 months ago

I am using RF module of 434MHz.I am sending small text from transmitter to receiver ,for that i am using virtual wire library.After receiving the text at receiver site I want to play small audio file.I am using PCM library for playing sound file on arduino ,because my audio file is very small and i don't want to use external memory.but the problem is when I import virtual wire and PCM in same code at receiver it is throwing error.I am beginner in arduino so I am not getting why it is not allowing both library together.
I am using arduino leonardo at transmitter site and Uno as receiver.
Is their any solution through which I can play my audio file at receiver without using sd card?

diy_bloke NiyatiK2 months ago

Hi NiyatiK
I think your probem could be bacause both libraries use timer1.
Also, the PCM library is very processor intensive and relies heavily on interruupts that can cause problems with other time sensitive software

chrischampion2 months ago

I'm wondering if there's any way to just do a simple "on" for the transmitter. I want to make a small box with just a battery and a button. When you press the button, the TX sends a signal that the RX understands.

Yes that is possible. Just pull the datapin HIGH.
But ofcourse if you want a specific code pattern to be sent at the push of a button you still need a device that makes that code pattern. e.g. an attiny that generates that in its set up. 'ON" is than 'run the setup' which you then feed to the transmitter datapin

particalman3 months ago

Great project for my final communications lab

MakisB13 months ago

Is there any way to connect multiple transmiters to one receiver ?

WernerM23 months ago

I was wondering if anyone know how to change or manipulate the frequency because their are a very popular gate motor remote control on the market that interacts with this RF sender .....

Gyalu4 months ago

Hi Mohannad,

Thank you for the instructions, I built my RF project according to the info you shared.

I have an outdoor unit with a DHT22 thermometer and the transmitter unit and an indoor unit with a receiver, a real time clock and an LCD display and I send the measured temperature and humidity values through the RF transmitter to the indoor unit and show them on the LDC. Usually it works properly.

But after a certain time the received string starts to be shorter and I loss first some chars from the humidity value later the whole humidity and some chars from the temperature also. During this I am monitoring the the sent string through the serial monitor and it is correct.

Have you ever detected this issue? Do you have any suggestion / solution to do it?

THX, Gyalu

sitiirani4 months ago

Hi. Can I use RF transmitter and connected to arduino to communicate with smartphone ?

gmt9186 months ago

Hi, this is a good intractable but there is a way easier way to use these modules. Instead of using Virtual Wire library, all you have to do is plug the data pin from the receiver module into the rx (0) pin on your arduino, and plug the data pin from your transceiver module into the tx (1) pin on your other arduino. There is no external library needed for this. Here is the code for the receiver:

//receiving rx code

int incomingByte = 0;

void setup(){

//2400 baud for the 434 model

Serial.begin(2400); }

void loop(){

// read in values, debug to computer

if (Serial.available() > 0) {

incomingByte = Serial.read();

Serial.println(incomingByte, DEC);


incomingByte = 0;


Note****When uploading lis code to your arduino, you need to disconnect the wire from the rx pin or it won't upload.

Here is the code for the transceiver:

//sending tx code

byte counter;

void setup(){

//2400 baud for the 434 model


counter = 5;


void loop(){

//send out to transmitter




Note****You need to disconnect the wire from the tx pin and reconnect it later when uploading your code to the arduino.

Note****This is not my code. I got it from another website.

Hope this helps everybody.

code does not work...because after uploading the code in arduino that is connected with transmitter ,the transmitter led glow but after disconnect the arduino from pc and give it external power supply the transmitter led will not glowing ,and i think the transmitter will not send any data...kindly tell me the solution.

Try unplugging both the tx and rx wires when uploading. It should work then. Sorry about that. Plug those wires back in later.

what project to help this code ??

gocreeps14339 months ago

ERROR help!

transmitter.pde: In function 'void setup()':
transmitter:19: error: 'vw_set_ptt_inverted' was not declared in this scope
transmitter:20: error: 'vw_setup' was not declared in this scope
transmitter.pde: In function 'void loop()':
transmitter:28: error: 'vw_send' was not declared in this scope
transmitter:29: error: 'vw_wait_tx' was not declared in this scope

library would be in wrong place. I had the same problem, I deleted the library downloaded it once more and it worked.

Thanks man. It Worked! Sir can i Have your email? i would like to asked some questions regarding programming wireless communicaiton. I hope it's okay, thanks.

how you resolve this problem, because i have face same problem...please help me even i replaced the library with a new one.but same problem

you could send a private message on instructables itself.

1-40 of 158Next »