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

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
 
Remove these adsRemove these ads by Signing Up
1-40 of 79Next »
TaitS16 days ago

Mohannad, This is a really helpful instructable. It would be even more helpful if it was de-jargonized. Could you please explain the acronyms before you start using them, and any other code-language that would not be immediately transparent to beginners? It would turn a good instructable into a great one.

deji4 months ago

Hi , can you help me please, when i compile the program for Transmitter I get "vw_set_ptt_inverted" was not declared in this scope. What I am doing wrong .Thanks

sssww1234 deji28 days ago

make sure that there is only one virtualwire library in arduino folder.set the baud rate in above pgm to make it run

zcui deji4 months ago

try this downlaod it worked for me and try to import it in zip form http://www.pjrc.com/teensy/td_libs_VirtualWire.html

how to replace whit new library?

deji zcui4 months ago
It works , thanks is very usefull
TimoP1 made it!1 month ago

Thanks for a nice instructible! Hooked up the transmitter and receiver with two Arduinos and got them working.

The VirtualWire library did throw some errors first with the Arduino 1.0.5 software version, but they were easily fixed as follows:

1) in the VirtualWire.cpp file, replace the line #include <wiring.h> with #include <Wire.h>

2) in the VirtualWire.h file, replace #include "WProgram.h" with #include "Arduino.h"

For the transmitter and receiver codes, added the line #include <Wire.h> before the line #include <VirtualWire.h>.

In case anybody is interested, note that it is also possible to transmit data and ascii text with this setup. Below is my code for doing that.

To transfer text, open up the Serial Monitor, type text to the input box and press enter. The text is output to the Serial Monitor on the receiving Arduino.

TRANSMITTER CODE:

//simple Tx on pin D12

//Written By : Mohannad Rawashdeh

// 3:00pm , 13/6/2013

//http://www.genotronex.com/

//..................................

// added serial data transmission

// 22.9.2014/Timo.Peltonen [at] iki.fi

#include <Wire.h>

#include <VirtualWire.h>

#include <Serial.h>

char *controller;

void setup() {

pinMode(13,OUTPUT);

vw_set_ptt_inverted(true); //

vw_set_tx_pin(12);

vw_setup(4000);// speed of data transfer bps

Serial.begin(9600); // Serial Monitor used to enter data

Serial.println("Ready to transmit. Write data here.");

}

void loop(){

if (Serial.available() > 0) { // read data from PC Serial Monitor

controller = ""; // delete any old data

controller[0] = (uint8_t)Serial.read(); // read the incoming byte

controller[1] = '\0'; // terminate string with a null character

Serial.print(controller[0]); // output character on Serial Monitor

if(controller[0]==13)

Serial.println(""); // write a newline for enter

digitalWrite(13,1); // turn led on

vw_send((uint8_t *)controller, strlen(controller)); // send string over radio link

vw_wait_tx(); // Wait until the whole message is gone

digitalWrite(13,0); // turn led off

delay(100); // wait a little while before the next character

}

}

RECEIVER CODE:

//simple Rx on pin D12

//Written By : Mohannad Rawashdeh

// 3:00pm , 13/6/2013

//http://www.genotronex.com/

//..................................

// added serial data reception

// 22.9.2014/Timo.Peltonen [at] iki.fi

// NOTE: the receiver needs a better antenna; solder a wire to the receiver ANT connector!

#include <Wire.h>

#include <VirtualWire.h>

#include <Serial.h>

void setup()

{

vw_set_ptt_inverted(true); // Required for DR3100

vw_set_rx_pin(12);

vw_setup(4000); // Bits per sec

pinMode(13, OUTPUT);

Serial.begin(9600); // open Serial Monitor to PC

vw_rx_start(); // Start the receiver PLL running

Serial.println("Receiving...");

}

void loop()

{

uint8_t buf[VW_MAX_MESSAGE_LEN];

uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen)) // Non-blocking

{

digitalWrite(13,1); // turn on led

if(buflen == 1) { // if just one character per time

if(buf[0]==13)

Serial.println(""); // newline

else

Serial.print(char(buf[0]));

}

else

for(int n=0;n<buflen;n++) {

if(buf[n]==13)

Serial.println(""); // newline

else

Serial.print(char(buf[n]));

Serial.println(""); // insert newline at end of buffer

}

digitalWrite(13,0); // turn off led

}

}

unnamed.jpg
Indergod1 month ago

Hi,

In your multi-receiver example, the transmitter is defining the controller code "A1" or "B1" in the sketch before sending it via:

vw_send((uint8_t *)controller, strlen(controller));


is it possible to define the controller code from a client.read instead?

I'm getting error messages as my client.read if of type "char", whereas the above send is looking for it to be of type "char const*" ???

Any help appreciated :-)

zhaymoor1 month ago

thank you muhannad but I want to ask you about the "uint8_t*" ,, what does it mean?

uint8_t is the same as a byte.


its shorthand for: a type of unsigned integer of length 8 bits

And the * means "pointer to", so "uint8_t*" is a pointer to an 8 bit value, it is not an 8 bit value itself.

If you had uint8_t* pValue and you tried to print the value of pValue you would get a 32 or 64 bit number, which would be the memory address of the value pValue is pointing to. If you want the value of what pValue is pointing to you have to dereference it by doing *pValue.

Kutluhan1 month ago

That is not so helpful for me because i need to wire transmitter to my arduino. But i need to wire receiver to a led circuit (or something other, like a dc motor..) without an arduino can anybody give me a solution. So thank you for anything :)

Aybert591 month ago

another example using same devices, rc-switch Library and a Gertboard http://ardpilot.wordpress.com

nudijudi1 month ago

the library has an error it says that there is no such library as <wiring.h>

please reply with awnser

chidu manu1 month ago

Is it possible to use two pair of RF module, for 2 Arduino to communicate with each other..

can some one guide me with the code...

is this 433MHz works if our Arduino for Transmitter is ATMEGA2560 and for Reciever is Nano?

we've tried it but it's not working.. just the coding maybe?

imcirca1 month ago

how can i connect rx or tx if my arduino is atmega 2560?

Can i use the VirtualWire library and the Servo library in a same program ??

I tried it using both in same program, but it is giving some error. Plz help.

Servo\Servo.cpp.o: In function `__vector_11':

E:\G Work\arduino-1.0.5\libraries\Servo/Servo.cpp:103: multiple definition of `__vector_11'

VirtualWire\VirtualWire.cpp.o:E:\G Work\arduino-1.0.5\libraries\VirtualWire/VirtualWire.cpp:568: first defined here

I have the same problem.

jarvanI2 months ago

Hello. Can I use this to trigger a relay?

singhdeolji2 months ago

hi, what would it take, if i have to use multiple transmitter to one receiver, how would you go about doing this? thx

imsanaga3 months ago

Can you please help obtaining Eagle part library for the 433mhz module ? I am learning work on PCB. Thanx !

Hello! This part is attached using simple pin headers from pinhead.lbr. I think you won't need any special Eagle part since this module is not solderable

kasisnu made it!3 months ago

Thanks! This was helpful!

IMG_20140702_230446595.jpgIMG_20140702_230451950.jpg
gsandhu23 months ago

I’m working on a project which is about making a rescue
robot . I have struggling with it for 4 months and now all the mechanical works
had been done . but I’m facing difficulty in make the robot to work with rf
module can u plzz help me…

I want make transmitter and receiver that can control the
motion…I mean that receiver should have control 8 dc gear motor and each dc
motor should have a forward and backward botton to control the motion ……can u
kindly help me with this project ….if u can make the circuit board diagram for
the PCB ….or any other suggestion plz reply……mail me at “sunny1995gagan@gmail.com”

arakib4 months ago

This library works.....!

http://www.airspayce.com/mikem/arduino/VirtualWire/VirtualWire-1.27.zip

R-A4 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-A4 months ago

yes, good signal 70m

raininmyhead4 months ago

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

mde roxas5 months ago

Help me, I need to control 2 Servo motors tru wireless. I bought a pair of RF receiver-transmitter. But I don't know how will they communicate? I need some guide guys

u9715 months ago

Awesome was looking for some info on how to set up the exact same RF devices...thank you!

Jan_Henrik5 months ago

Doog instructable, useful!!

jimdsouza5 months ago

Can i use one arduino for both receiver and transmitter? I need to use it as an emergency vehicle detector for my traffic control project.

Folks, here's a useful link and an update on what I (and others) have done to extend range. The ninjablock has an arduino inside using the same module (I believe) descibed here....

http://forums.ninjablocks.com/index.php?p=/discussion/comment/10534#Comment_10534

c0love6 months ago

I am looking to see if one of these transmitter modules can be used to replace an RF remote (for a remote controlled power outlet). Is it possible for these types of transmitter modules to receive any RF signal and capture what the RF code is so you can then use that RF code in the Arduino code to transmit it?

There are learning RF power outlets that can be programmed to any RF code and I would like to be able to control more receivers than the RF remote has buttons to control.

Thanks for the Instructable!

c0love6 months ago

Here is a direct link to the VirtualWire 1.14 library

http://www.open.com.au/mikem/arduino/VirtualWire/VirtualWire-1.14.zip

Raphango made it!6 months ago

Yay! \o/

Thank you! Got this working for myself!

IMG_20140410_211112.jpg
Alaa inv8 months ago

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

sketch_feb19e:10: error: expected `(' before 'vw_set_rx_pin'

sketch_feb19e:11: error: 'vw_setup' was not declared in this scope

sketch_feb19e:14: error: 'vw_rx_start' was not declared in this scope

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

sketch_feb19e:18: error: 'VW_MAX_MESSAGE_LEN' was not declared in this scope

sketch_feb19e:21: error: 'buf' was not declared in this scope

sketch_feb19e:21: error: 'vw_get_message' was not declared in this scope

mpring Alaa inv8 months ago

I've encountered that same problem too. Then I figured that there is a problem in the current VirtualWire. You have to download the old virtual wire and replace the one you have. It will work as soon as you put it in the library and restart arduino. I forgot the link but the name of the file is, "VirtualWire-1.14.zip". Just search it if you want.

lhäuser1 mpring7 months ago
Library is probably not installed correctly. see here for more details: https://groups.google.com/forum/#!topic/tronixstuff/JFvspcw6vIc
1-40 of 79Next »