Instructables
loading
loading

RF 315/433 MHz Transmitter-receiver Module and Arduino

Picture of RF 315/433 MHz Transmitter-receiver Module and Arduino
RF_315Mhz_Transmitter_Receiver-500x500.jpg
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 .

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

 
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
TX.png
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 :

Vcc>>>>5V
Data>>>D12
Gnd>>>Gnd
1-40 of 134Next »
NiyatiK6 days 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?

gmt9182 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

Serial.begin(2400);

counter = 5;

}

void loop(){

//send out to transmitter

Serial.write(counter);

delay(10);

}

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 ??

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

Don't know if it helps. But i replaced <WProgram.h> with <Arduino.h> in virtualWire.cpp

spudziuvelis3 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
#include
^
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

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

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

Digital Explorer made it!1 month ago
finished
temp_99993441.jpg

share the code please

ka1821 month ago

Hi there,

I need help.. I'm using 433Mhz transmitter/receivers Module. data is sent from my transmitter to my receiver module without any issue but when using adafruit bmp183 temp sensor, sensor data value is wrong. i did some debugging and notice that issue is with vw_setup() function, when value is greater than 0 values temp value goes wrong. does anyone have the same issue or does anyone know how to fix it? i think that it is something related with clock speed issue. adafruit bmp183 calcs are based on 16Mhz and i think that that function may change clock speed on my arduino. :(

please send me the sample code that is working for you.

uolengineer@gmx.com

AdithyaA224 days ago

can you make a one were if you press an led, it sends the signal to the other one

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

Arvix1 month ago

Work great! Thanks!

AndrésM41 month ago

does it work in NLOS conditions??

KilianO2 months ago

Has anyone found a nice Half-Duplex solution for 433MHz modules and VirtualWire on Arduino?

Would appreciate any suggestions. Thanks,

Kilian

take a HC-12 instead...

StatikZ made it!2 months ago

Got it to work, following instructions, of course! Now I'm off to trying to get some wireless communication in order to display information to a LCD display. Shouldn't be too hard if I figure out the LCD commands.

Wireless Arduino TX RX Basic Circuit - 1_22_2015.jpg
azimazwan2 months ago

hi everyone. why i cannot compile this coding? it said that my header is not define. somebody help me please? contact me at azimazwan@gmail.com

tqvm

azimazwan2 months ago

hi everyone. why i cannot compile this coding? it said that my header is not define. somebody help me please? contact me at azimazwan@gmail.com

tqvm

azimazwan2 months ago

hi everyone. why i cannot compile this coding? it said that my header is not define. somebody help me please? contact me at azimazwan@gmail.com

tqvm

TomášV2 months ago

Hi,

can you help me please.. Can I use this for wireless conecting guitar to amp?

Actually can you help me with code or something like this?

Thanks

RobinB12 months ago

NOTHING BUT A BUNCH OF ERRORS !!!!

kalium.pt3 months ago

Hi! Can I use the transmitter module with a VCC of 12 V and connect the data directly to the arduino D12?

Kalium can you help me in a project? Will pay for you...

hi there!!!!!

how do i add multiple switch to transmitter and the receiver is connected to a simple numeric display where it will show which switch is switched in order?

//code for the tx
#include <VirtualWire.h>

//Assigning controller buttons to Digital Pins

int s5 = 8;
int s4 = 9;
int s3 = 10;
int s2 = 11;
int s1 = 12;
int remotePins[]= {8,9,10,11,12};//array to store pin nos

void setup()
{
Serial.begin(9600); // Debugging only
Serial.println("setup");
// Initialise the IO and ISR
vw_setup(2000); // Bits per sec
vw_set_tx_pin(3); //Transmitter Data Pin to Digital Pin 3


for(int i = 0; i<6 ; i++)
{
pinMode(remotePins[i], INPUT);
digitalWrite(remotePins[i],HIGH);
}
/*
This is what the loop above does :-
pinMode(8, INPUT);
pinMode(9, INPUT);
pinMode(10, INPUT);
pinMode(11, INPUT);
pinMode(12, INPUT);

digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);*/
pinMode(groundpin, OUTPUT);
pinMode (powerpin,OUTPUT);
digitalWrite(powerpin, HIGH);
digitalWrite ( groundpin , LOW);
}//close setup

void loop()
{
char *msg2;




if (digitalRead(s1)HIGH);
{
char *msg2 = "1";//send 1 to the receiver
digitalWrite(13, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg2, strlen(msg2));//send the byte to the receiver
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false);
}

if (digitalRead(s2)HIGH);
{
char *msg2 = "2";//send 1 to the receiver
digitalWrite(13, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg2, strlen(msg2));//send the byte to the receiver
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false);
}

if (digitalRead(s3)HIGH);{
{
char *msg2 = "3";//send 1 to the receiver
digitalWrite(13, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg2, strlen(msg2));//send the byte to the receiver
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false);
}

if (digitalRead(s4) HIGH);{
{
char *msg2 = "4";//send 1 to the receiver
digitalWrite(13, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg2, strlen(msg2));//send the byte to the receiver
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false);
}

}
}}
}
}

raininmyhead9 months ago

it's possible create a 433 mhz jammers? i try but it's very difficoult!

why would you want to jam 70cm band? it's main use is for radio navigation and position finding, jamming that would be potentially a felony, and could put others in danger. jammers in general are also not legal, since by definition they create harmful interference preventing use of the band by legitimate users.
liptaka3 months ago

Very useful stuff, thanks! Is it possible that the transnitter module could communicate to more than 1 pcs receiver?

My use case would be: with 1 arduino I would like to control more (e.g. 4 pcs) relays (4 x 1 channel wireless received relay module, like this:

http://www.ebay.com/itm/NEW-DC12V-1-CH-RF-Wireless-Receiver-Relay-Module-Switch-315-433MHz-Learning-Code-/121412715478?pt=LH_DefaultDomain_0&var=&hash=item1c44c303d6

).

I assume that the arduino will send the data with different coding so only the relevant relay will get it.

Is that possible?

liptaka

Eko9884 months ago

Hi!

What is the working distance of these modules?
I tried this sketch but the Rx is blinking only when the distance of the Tx and Rx is less than 2 centimeters :/

1-40 of 134Next »