Instructables

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

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 119Next »
KilianO15 days 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!5 days 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
azimazwan14 days 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

azimazwan14 days 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

azimazwan14 days 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ášV15 days 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

gmt91817 days 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.

RobinB118 days ago

NOTHING BUT A BUNCH OF ERRORS !!!!

kalium.pt1 month 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...

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

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);
}

}
}}
}
}

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

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

raininmyhead7 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.
liptaka1 month 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

Eko9882 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 :/

At the best 50-100m. Maybe you are facing some problem with the antennae.

At the best 50-100m. Maybe you are facing some problem with the antennae.

letrovin Eko9882 months ago

You need an antenna e.g. a simple wire of specific length, there is a solder point for an antenna on the module. The recommended length is usually (lambda/4=)17cm, but I had better ranges with longer wire (27cm straight wire). With this antenna I got through 2 concrete walls and a distance of 20m. Now I wonder what the best antenna length would be.

R-A8 months ago

Can this be used to transmit data? i.e. let's say I have an Arduino with some sensors in a remote location, say 100m away, and I want to know what the sensor values are from another arduino, can I use this kind of setup?

raininmyhead R-A7 months ago

yes, good signal 70m

Which antenna do you use?

you could make your own antenna. Take a 30 cm long wire and coil it up.

MarkK32 months ago

First VirtualWire tutorial that led me to success, thank you my friend!

warej2 months ago

Hi there! Could someone tell me one simple thing? Mohannad wrote that it should be connected to D12 (SPI) port, but in the code I can see that Rx port number is set by:

vw_set_rx_pin(12);
So can I connect it to a different port?
In general I'd like to have two sensors in two different locations and collect their data in one arduino i.e. have 2 receivers connected to one arduino. Is it possible?
Thanks for any help :)

Franscois2 months ago

Hi there,

Hope there is someone on here who might be able to give some advice please. I want to build a tiny temp sender/receiver unit. All it need to do, is to read a temperature from about -5 °C to ± 95 °C, and send that reading via a analog or digital transmitter to a receiver. The distance is not very important and should only be able to send it about 10 meters. The main focus will be on 'tiny' and 'low' power consumption, and with a low voltage use. I'm not up to date with all the latest devices out there and will really appreciate it if someone can tell me which parts I can link up to get the result. Thanks in advance !!!

edgar sanchez2 months ago

hola buen dia, podian ayudarme,}

tengo arduino uno, el cual tengo que conectarle una pantalla LCD 16x2, al igual que un modulo bluetooth, y enviar la informacion por via bluetooth a 20mtros. el msj que se envia y se visualiza en ambas pantallas es el que entra al arduino, de un enoder´s. que tiene 4 canales de salidas, en forma QAM. los cuales 2 son ascendente y 2 descendente. espeo su ayuda con la programacion. porfavor

pudes ampliarme la informacion a mi correo jadasupport@ gmail.com

edgar sanchez2 months ago

hola, queria saber que programa estan usando para correr el programa del transmisor y receptor. me podian ayudar porfavor

edgar sanchez2 months ago

hola, queria saber que programa estan usando para correr el programa del transmisor y receptor. me podian ayudar porfavor

edgar sanchez2 months ago

hola, queria saber que programa estan usando para correr el programa del transmisor y receptor. me podian ayudar porfavor

1-40 of 119Next »